Soft and hard test of electric sunroof durability test system based on VB serial communication

Abstract: A software and hardware implementation scheme of electric sunroof durability test system based on VB serial communication is proposed. The system includes a host computer composed of a PC and a lower computer composed of a single chip microcomputer. The host computer provides a good human-computer interaction interface; the lower computer uses integrated circuits, as well as signal sampling, V/F, F/V conversion and D/A conversion, and connects the single-chip microcomputer to the PC through serial communication. With this system, durability testing of various electric sunroofs can be easily and flexibly performed.

This article refers to the address: http://

1 Overview

The sunroof is designed to meet the health and comfort requirements of consumers. Therefore, people's requirements for skylight performance are not only in terms of aesthetics and luxury, but also must meet the requirements of safety, reliability and freedom of operation. Therefore, before the car sunroof is loaded, it must first be tested for durability and safety to ensure that it meets the requirements of technology and users after loading. However, the existing sunroof has a lack of travel, the sunroof cannot be opened; the travel is not in place, the sunroof is not tight, posing a threat to the car's anti-theft and rain; the control switch is out of order, and there are hidden dangers and problems such as pinching.

At present, most of the domestic sunroof tests use a single-machine lower-level machine system. Although such systems can perform routine testing, they cannot record or feed back test information. The sunroof test system we designed is divided into upper and lower position machines. The lower position machine has an actuator that controls the sunroof. It can not only control the reciprocating movement of the sunroof, but also complete the test project. It also has the function of automatically distinguishing faults and can automatically record the sunroof motor failure time. . The number of endurance tests is displayed by the host computer, and the fault is displayed. Relying on the reliable communication between the upper computer and the lower computer, the test operation, information transmission and information feedback are realized.

2 Key technologies for electric sunroof durability test system

2.1 Hardware Technical Features

The hardware system should realize the judgment that the sunroof is in place, closed in place, stopped in the middle and the motor must rest. It is mainly composed of two parts: detection circuit and control circuit. The schematic diagram of the system is shown in Figure 1:

Circuit schematic

Figure 1 circuit schematic

In-position detection circuit: In the system, in order to ensure the durability of the sunroof test bench, the design uses a non-contact sensor (infrared photoelectric sensor) instead of the vulnerable contact sensor, and can flexibly adjust the opening or closing of the sunroof. In place, convenient for the user's needs, the working principle of the sunroof in place circuit is: the circuit is composed of 3D infrared emission tube and 3E receiving tube and op amp LM324, the day window is not open or not closed, no signal is sent, only the sunroof is in place Only send signals to the microcontroller.

Midway stop detection circuit: In the system, due to the load characteristics of the control object (sunroof motor), the sunroof motor is not allowed to continue to work continuously, preventing the motor from overheating and affecting normal operation. In the subsystem that acquires the stop signal, it is sampled and held by the sampling resistor. In order to ensure the signal is not distorted, a two-stage amplifying circuit can be used, which is converted by V/F and F/V (because the ground where the signal is taken cannot be shared with the power ground), and then amplified by one stage, and then compared after being compared. In the microcontroller.

Alarm control circuit: The signal from the 8255 passes through the 7405 control optocoupler, and if the system is detected to be blocked, an audible alarm occurs.

Overcurrent protection control circuit: When the system is blocked, the relay is turned on and the motor stops working immediately.

Motor control circuit: After the on-bit signal (closed-in signal) comes out through the 8255, the photocoupler is turned on by the 7405, and then the transistor is controlled by the transistor to stop the motor for 30 seconds.

2.2 Software technical characteristics

The part of the MCU: the lower part is composed of single chip microcomputer and extended interface circuit, mainly 8031, address latch 74LS373, EPROM2764 used as off-chip program memory and 8255 for expansion I/O port, and then through RS-232 interface Host computer communication. Since the input and output levels of the MCU are TTL level, and the PC is configured with the RS-232 standard serial interface, the electrical specifications of the two are inconsistent. Therefore, to complete the data communication between the MCU and the PC, the TTL of the MCU output must be completed. The level is level-shifted. This circuit uses a standard RS-232 chip MAX232. The lower computer software is written in assembly language, and is mainly composed of a main program, a delay subroutine, an interrupt subroutine, a skip motor start subroutine, a handshake contact subroutine, and a blocking current subroutine. Its function is as follows:

22.jpg

Figure 2 MCU program flow chart

Main program: complete the initialization of the system, assign each subroutine to realize the system function;

Delay subroutine: In order to meet the characteristics of the sunroof motor, the control motor does not work continuously;

Interrupt subroutine: When the locked rotor current is greater than the set current, the motor stops working;

Skip the motor start subroutine: When the motor starts up, the current is very large, and it may exceed the stall current. This program can make the motor work normally;

Handshake contact subroutine: When the upper and lower computers are communicating, the handshake contact subroutine ensures reliable communication and reduces the malfunction.

Stall current subroutine: set the stall current value to control the motor work; part of the code is as follows, the program flow chart is shown in Figure 2:

ORG 0000H

LJMP MAIN

ORG 000BH

LJMP TOT0

ORG 0030H

MAIN: MOV R6, #0FFH ; Delay subroutine, waiting for the 8255 to be completely reset

MAIN1: DJNZ R6, MAIN1

MOV P1, #0FFH

MOV SP, #40H

MOV DPTR, #7FF3H ; Write control word for 8255, PA, PB.PC output, 0010 0100 0000 0011

MOV A, #80H

MOVX @DPTR,A

MOV DPTR, #7FF0H ; PA output all 01111111

MOV A, #00H

MOVX @DPTR,A

MOV DPTR, #0BFFFH

MOV A, #0FFH

MOVX @DPTR,A

MOV TMOD, #22H ; T1 is the Bode generator, mode 2, timing. T0 mode 2, timing

MOV TL1, #0F3H ; Porter is 1200B/S

The upper computer part: consists of a PC, with a human-machine interface, as shown in Figure 3. Because VISUAL BASIC language has a very friendly interface, it has played a very good role in its visualization and is favored by programmers. Therefore, the software is written using the VB6.0 language environment, and the interface operation is convenient and direct. In this system to use the upper and lower machine communication, you need to use the serial port technology. Serial communication generally adopts RS232 or RS485 specifications, and has a dedicated chip to implement related hardware communication circuits. In the Windows environment, we can call the API function or directly use the Ac-tiveX serial communication control. It is more complicated to use the API function to write the serial communication program. The MSComm communication control of VB6.0 provides an interface for the standard communication command set. Allows the programmer to establish a serial port-based connection for command acknowledgment, data exchange, and monitoring of various events or errors that may occur at the serial interface. In addition, VB6.0 provides the setting of the serial communication port parameters through the attribute method, which can solve the serial communication problem more easily. Moreover, the MSComm control shields the underlying operations during the communication process, making serial port programming very convenient. Therefore, when developing the system, using the MSComm control can shorten the design cycle and increase the reliability of the system. At the same time, as long as you understand the parameters you need, you can write the PC software in sequence, so MSComm control programming is used here to communicate with the microcontroller. The parameters of the control are as follows:

CommPort: Set and return the communication port number;

PortOpen: Set and return the status of the communication port (true means open, false means closed);

InPut: return and delete data from the receive buffer;

Output: write data to the send buffer;

InBufferSize: set and return the size of the receive buffer;

OutBufferSize: set and return the size of the send buffer;

InputLen: Sets and returns the number of bytes read from the receive buffer once by the Input property.

Settings: Set and return the baud rate, parity, data bits, stop bit parameters;

InputMode: Sets and returns the type of data read by the Input property;

InBufferCount: Returns the number of bytes waiting in the receive buffer. When set to 0, it can also be used to clear the receive buffer.

OutBufferCount: Returns the number of bytes waiting in the send buffer. When set to 0, it can also be used to clear the output buffer.

33.jpg

Figure 3 test system interface diagram

The serial communication program design first initializes the work, sets the communication baud rate and the format of the transmitted characters, including the number of characters, the number of bits of the stop bit, and the parity check method. The baud rate of communication in this system is 1200b/s, and the format of the transmitted characters is 1 bit start bit, 8 data bits and 1 stop bit. It is often the case that once the format of the character is determined, it will not change in future communications.

3 Conclusion

The car sunroof test system based on serial communication developed by us has realized the test operation, information transmission and information feedback through the joint use of the upper and lower position machines. It improves the stand-alone lower position system and can perform routine tests, but cannot record or feedback. Test the performance of the information, as well as more features such as fault identification. Considering that there may be other potential problems with the sunroof, the test system has an external interface to expand and improve more test functions.

In China, actively promoting the independent automobile industry today, designing the durability test system of the sunroof of the car provides an effective platform for ensuring the high reliability of the sunroof in use, which can greatly improve the social benefits of the automobile industry. And economic benefits have broad application prospects.

4 The author of this article is innovative

The system realizes test operation, information transmission and information feedback through the joint use of upper and lower machines. The actuator of the lower machine controls the sunroof, which can control the round trip, opening and stopping of the sunroof, and record the round trip times of the sunroof; it can also automatically identify various faults, record the sunroof motor fault time, and terminate the test process at any time. In addition, the motor stall current is also provided to meet the requirements of various sunroof motors. The host computer provides a user-friendly interface, displays the number of endurance tests, displays faults, has the ability to record the position of the sunroof, test the process, print test results and record the time and location of the fault. The core of the computer is the communication reliability of the upper computer and the lower computer. . In the design, the characteristic requirement of the sunroof motor is to work one cycle, and it must be paused for 30 seconds, and this sunroof motor has a stop function. Due to the durability test of the sunroof, we abandoned the common mechanical switch and adopted the durable photoelectric switch sensor, which increased the reliability and reflection speed of the system and ensured the instantaneous and accurate test data.

In view of the different models and different sunroof design functions, the application of the system is slightly different, and the functions need to be continuously improved. The specific economic benefits created by this system need further statistics and research.

Usb Cable

Data Cable Usb,Usb Charger Bracelet,Usb Flash Bracelet,Gold Plated Usb Bracelet

Dongguan Fangbei Electronic Co.,Ltd , https://www.connectorfb.com