Summary of the invention
A kind of automotive electric glass lifting intelligent controller and the control method thereof that provides in order to overcome the shortcoming that has electric glass lifter now is provided, this controller and control method can improve the safety and the reliability of electric glass lifter system, and make electric glass lifter realize more function.
The object of the present invention is achieved like this: automotive electric glass lifting intelligent controller comprises ECU electronic control unit, motor sample of signal module, motor-drive circuit module, sample circuit module, power module; Described power module is used to provide the working power of each module; Be characterized in,
Described ECU electronic control unit comprises micro controller system, clock signal submodule, described micro controller system is integrated port and data processing functions such as voltage regulator, input/output port, crystal oscillator port, input capture port, amplifier and A/D converter; Described clock signal submodule is mainly external crystal oscillation circuit, is connected with the crystal oscillator port of micro controller system;
The input end of described motor sample of signal module is connected with single machine output end; Mouth is connected with the input capture port of micro controller system;
The input end of described motor-drive circuit module is connected with the output port of the driving relay of micro controller system, and its mouth is connected with the drive motor of electric glass lifter;
The input end of described sample circuit module is connected with current sampling resistor, and its mouth is connected with the amplifier and the A/D converter input port of micro controller system;
And, also comprising an I/O terminal module, the mouth of described I/O terminal module is connected with the signal input port of micro controller system.
Above-mentioned automotive electric glass lifting intelligent controller, wherein,
Described micro controller system is the micro controller system with ports such as power input mouth, input/output port, crystal oscillator port, input capture port, amplifier and A/D converter port or function;
The 5V filter circuit that described power module is introduced circuit, power supply input filtering and reverse protection circuit and micro controller system output by power supply is formed, and the micro controller system working power is provided;
Described I/O terminal module by draw on rising end signal, the rising end signal with filter circuit, decline end signal, decline end signal on draw with filter circuit, control end signal, control end signal on draw with filter circuit, diagnosis end signal, diagnosis end signal on draw with the filtering imput output circuit and form; Wherein: draw with filter circuit on the output of rising end signal and the rising end signal to be connected, draw with filter circuit on the output of decline end signal and the decline end signal and be connected, draw with filter circuit on the output of control end signal and the control end signal and be connected, the output of diagnosis end signal with diagnose end signal on draw with the filtering imput output circuit and be connected, draw on each with the output of filter circuit to be connected with input of single chip;
Described clock signal submodule is mainly external crystal oscillation circuit, is connected with the crystal oscillator port of micro controller system;
Described motor signal sample circuit module is formed by drawing with filter circuit and transistor amplifier on hall device, the control hall device signal; Wherein: the output of hall device is drawn with filter circuit and transistor amplifier and is connected respectively with on the control hall device signal, draw on the control hall device signal with the output of filter circuit to connect with the input capture port of micro controller system, the mouth of micro controller system is connected with transistor amplifier;
Described motor-drive circuit module is made up of relay and absorption circuit, and wherein: the input end of relay connects the port of the driving relay work of micro controller system, and the output of relay connects the absorption circuit;
Described sample circuit module is made up of sampling resistor and amplifier input circuit, wherein: the input end of sampling resistor connects the output signal of the relay of motor-drive circuit module, the output of sampling resistor connects the amplifier input circuit, and the output of amplifier input circuit is connected with the amplifier of micro controller system and A/D converter input port.
The method that the above-mentioned automotive electric glass lifting intelligent controller of sampling is controlled is characterized in: may further comprise the steps:
A, at first direct supply is input to micro controller system through power module, the sinusoidal waveform with the crystal oscillator output of clock signal submodule is input to micro controller system simultaneously, makes controller be in dormancy sleep mode of operation or wakes mode of operation up;
B, after controller is in the rising port that wakes mode of operation and I/O terminal module up and obtains " rising " signal, the controller motor drive module drives the electric glass lifter motor rises the glass of lifter; The sample circuit module is monitored with the protection current nonoverload to this electric current and is carried out stall and judge the running current micro controller system of sampling simultaneously; Motor signal sample circuit module is monitored to judge the zone at glass place the number of total coils of motor operation the motor operation number of turns micro controller system of sampling simultaneously; Micro controller system is analyzed to judge whether the being obstacle that foreign matter is clamped or overcome for common need the signal of current sample and the signal of the motor operation number of turns, controls glass rising, rising anti-pinch, rising obstacle negotiation energy, rising overload protection thereby finish;
C, after controller is in the decline port that wakes mode of operation and I/O terminal module up and obtains " decline " signal, the controller motor drive module drives the electric glass lifter motor descends the glass of lifter; The sample circuit module is monitored with the protection current nonoverload to this electric current and is carried out stall and judge the running current micro controller system of sampling simultaneously; Whether motor signal sample circuit module samples to the motor operation number of turns that micro controller system simultaneously monitors with the zone of judging the glass place the number of total coils of motor operation is thereby that soft stop area finishes that control glass descends, soft the stopping and the decline overload protection of decline;
D, after serial interface that controller is in wake up or sleep mode of operation and I/O terminal module obtains " the collection control is risen " signal, the top that is raised on glass is finished to concentrate and is closed window thereby the controller motor drive module drives that the electric glass lifter motor makes lifter.
Above-mentioned control method, wherein, the described dormancy mode of operation of step a is meant the residing mode of operation of controller after controller is in the serial interface that wakes mode of operation and I/O terminal module up to be the high level that continues for some time;
The described mode of operation that wakes up is meant the residing mode of operation of controller after serial interface that controller is in dormancy mode of operation and I/O terminal module is the low level that continues for some time.
Above-mentioned control method, wherein, step b described " rising " signal is meant that finishing high level signal jumps to the signal that low level keeps a period of time.
Above-mentioned control method, wherein, step c described " decline " signal is meant that high level signal jumps to the signal that low level keeps a period of time.
Above-mentioned control method, wherein, steps d described " collection control rise " signal is meant that jumping to low level behind the high level signal keeps a period of time to be the signal of high level then again.
Because the present invention has adopted above technical scheme, adopts Single-chip Controlling, its effect is significant:
1, glass lifting is safe in operation when closing vehicle window.For example: when hand is placed on the vehicle window when rising with glass, lifter controller of the present invention can be discerned it, thereby thereby inverted machine makes the lifter segment distance that descends avoid lifter that hand is crushed even the accident of pinch off when tong.
2, can provide overload protection timely.It is at 0.5 second internal cutting off motor of lifter motor rotation blockage power supply, thereby avoids the lifter motor overheating serious.
3, the life-span of lifter itself and the reliability of system have been improved.Because cutting off motor power in last/lower seal bar position is timely, even the soft hold function of decline of lifter controller realization of the present invention, when being descended, lifter can not cause motor rotation blockage, thereby avoided lifter to be subjected to serious physical shock, made the life-span of lifter itself and the reliability raising of system in stop position up and down.
4, have many functions, as dormancy and arousal function (to reduce quiescent current and power consumption), switch control functions (as going up window and following window, switch crawl automatically), concentrated pass window function etc.
The specific embodiment
See also Fig. 2.The anti-clip controller of electric glass lifter of the present invention comprises: based on ECU electronic control unit, power module 2, I/o terminal module 3, clock signal submodule 4, motor sample of signal module 5, motor-drive circuit module 6, the sample circuit module 7 of micro controller system 1.
Micro controller system 1 is for having the micro controller system of port such as power input mouth, input/output port, crystal oscillator port, input capture port, amplifier and A/D converter and data processing function.
The 5V filter circuit that power module 2 is introduced circuit (power supply+end), power supply input filtering and reverse protection circuit, micro controller system output by power supply is formed, and it guarantees power supply input and the required 5V power supply output of hardware stable operation that the micro controller system stable operation is required.
I/o terminal module 3 by draw on rising end signal, the rising end signal with filter circuit, decline end signal, decline end signal on draw with filter circuit, control end signal, control end signal on draw with filter circuit, diagnosis end signal, diagnosis end signal on draw with the filtering imput output circuit and form; It is realized the reliable extraction of external portion signal and imports micro controller system and the function of diagnosis end signal reliable extraction and input and output.Wherein: draw with filter circuit on the output of rising end signal and the rising end signal to be connected, draw with filter circuit on the output of decline end signal and the decline end signal and be connected, draw with filter circuit on the output of control end signal and the control end signal and be connected, the output of diagnosis end signal with diagnose end signal on draw with the filtering imput output circuit and be connected, draw on each with the output of filter circuit to be connected with input of single chip.
Clock signal submodule 4 is mainly external crystal oscillation circuit, is connected the required clock signal of micro controller system stable operation of giving security with the crystal oscillator port of micro controller system.
Motor signal sample circuit module 5 is formed by drawing with filter circuit and transistor amplifier on hall device, the control hall device signal, and it provides required motor speed of reliable operation and position signal.Wherein: the output of hall device is drawn with filter circuit and transistor amplifier and is connected respectively with on the control hall device signal, draw on the control hall device signal with the output of filter circuit to connect with the input capture port of micro controller system, the mouth of micro controller system is connected with transistor amplifier.
Motor-drive circuit module 6 is made up of relay and absorption circuit, and wherein: the input end of relay connects the port of the driving relay work of micro controller system, and the output of relay connects the absorption circuit; Realization is to the power supply output of lifter motor.
Sample circuit module 7 is made up of sampling resistor and amplifier input circuit, wherein: the input end of sampling resistor connects the output signal of the relay of motor-drive circuit module, the output of sampling resistor connects the amplifier input circuit, and the output of amplifier input circuit is connected with the amplifier of micro controller system and A/D converter input port.It provides the controller reliable operation required motor current signal.
See also Fig. 3.Micro controller system 1 chip that the present invention selects for use is the MC68hc805pv8 type product of motorola inc, and also optional usefulness has other chips identity function or other manufacturers or same manufacturer.
Power module 2 constitutes by positive source input pin VSUP (No. 10 pin), the Power Ground input pin VSS (No. 19 pin) of singlechip chip with through the 5V output pin VDD (No. 9 pin) after the integrated voltage regulator voltage-regulation of singlechip chip and institute's bonded assembly circuit thereof; diode D1 has the reverse protection function; resistance R 1 has current protecting function; C1, C2 are the power supply input filter capacitor; the power supply input of B+ and ground end G through the integrated voltage regulator of chip obtain the VDD pin+5V output, capacitor C 4, C5 are 5V voltage output filter capacitor.
I/O terminal module 2 is by the rising end signal, draw and filter circuit on the rising end signal, the decline end signal, draw and filter circuit on the decline end signal, the control end signal, draw and filter circuit on the control end signal, the diagnosis end signal, draw with the filtering imput output circuit on the diagnosis end signal and form, the signal input port pin PC0 (No. 11 pin) of itself and singlechip chip, PC1 (No. 12 pin), PC2 (No. 13 pin), PC3 (No. 14 pin), PC4 (No. 15 pin) connects, and realizes the reliable extraction of outward sign and imports micro controller system and the function of diagnosis end signal reliable extraction and input and output.Draw on the described rising end signal with the filtering input circuit and constitute by resistance R 3, R27, R28, capacitor C 6, draw on the described decline end signal with the filtering input circuit and constitute by resistance R 30, R4, R29, capacitor C 7, draw on the described control end signal with the filtering input circuit to constitute, draw on the described diagnosis end signal with the filtering imput output circuit to constitute by resistance R 8, R9, capacitor C 9, resistance R 7 by diode D2, resistance R 5, R6, capacitor C 8.
Clock signal submodule 4 is made of crystal oscillator input port pin OSC1 (No. 21 pin), pin OSC2 (No. 20 pin), pin VSS (No. 19 pin) and the circuit crystal oscillator CRY that is connect thereof and the resistance R 2 of singlechip chip.
Motor signal sample circuit module 5 by the output pin PB1 (No. 27 pin) of singlechip chip and input capture port pin PB0 (No. 25 pin), PB2 and institute's bonded assembly Hall element and on draw with filter circuit and constitute.HS1 and HS2 are Hall element, draw on the signal with the filtering input circuit to be made of resistance R 17, R18, R31, R32, capacitor C 12, C18.
Motor drive module 6 is by output port pin PC5 (No. 16 pin), pin PC6 (No. 18 pin) and the institute's bonded assembly motor input detecting circuit and the absorption circuit formation of the driving relay of micro controller system.Described motor input detecting circuit is made of resistance R 12, R13, R14, capacitor C 10 and No. 24 pin PB3, absorbs circuit and is made of resistance R 15, R16, capacitor C 11, variable resistance V1.
Sample circuit module 7 is made of amplifier and A/D converter input port pin PA4 (No. 5 pin), pin PA5 (No. 6 pin), pin PA6 (No. 7 pin) and institute's bonded assembly amplifier input circuit circuit thereof of singlechip chip, and described amplifier input circuit is made of the main R21 of electricity, R22, R23, R24, R25, R26, capacitor C 13, C14, C15 and micro controller system output pin PB4.
The control method of automotive electric glass lifting intelligent controller of the present invention may further comprise the steps:
After the sinusoidal waveform input of the power supply input of power module B+ and ground end G and the 4MHZ that the clock signal submodule obtains the crystal oscillator input port, controller of the present invention is in running order, and the mode of operation of controller of the present invention has two kinds to be dormancy sleep mode of operation and to wake mode of operation up.
When controller of the present invention is in the serial interface that wakes mode of operation and I/O terminal module up is that the high level controller then of the present invention that continues for some time is in the dormancy mode of operation; The serial interface that is in dormancy mode of operation and I/O terminal module when controller of the present invention is that the end level controller of the present invention that continues for some time is in and wakes mode of operation up; Thereby finish the dormancy and the arousal function of controller of the present invention.
When controller of the present invention is in the dormancy mode of operation or the I/O terminal module serial interface SERIAL_IN when being high level, the signal of the rising port UP _ IN of I/O terminal module and decline port DOWN_IN can't be finished the function of the rising and the decline of glass with conductively-closed, thereby finishes the operation prohibiting function of controller of the present invention;
After controller of the present invention was in the rising port UP _ IN that wakes mode of operation and I/O terminal module up and obtains " rising " signal (height finish level signal jump to low level keep a period of time), controller motor drive module of the present invention drives the electric glass lifter motor rose the glass of lifter; The sample circuit module is monitored with the protection current nonoverload to this electric current and is carried out stall and judge the running current micro controller system of sampling simultaneously; Motor signal sample circuit module is monitored to judge the zone at glass place the number of total coils of motor operation the motor operation number of turns micro controller system of sampling simultaneously; Micro controller system is analyzed to judge whether being that foreign matter is clamped or thereby the obstacle that overcomes for common need is finished function, the rising overload protection function that the present invention controls glass rising function, rising pinch resistant functionality, rising obstacle negotiation the signal of the signal of current sample and the motor operation number of turns;
After controller of the present invention was in the decline port DOWN_IN that wakes mode of operation and I/O terminal module up and obtains " decline " signal (high level signal jumps to low level and keeps a period of time), controller motor drive module of the present invention drives the electric glass lifter motor descended the glass of lifter; The sample circuit module is monitored with the protection current nonoverload to this electric current and is carried out stall and judge the running current micro controller system of sampling simultaneously; Thereby whether motor signal sample circuit module is glass decline function, the soft hold function of decline and the decline overload protection function that soft stop area is finished controller to the motor operation number of turns zone that micro controller system simultaneously monitors to judge the glass place the number of total coils of motor operation of sampling;
After serial interface SERIAL_IN that controller of the present invention is in wake up or sleep mode of operation and I/O terminal module obtained " the collection control is risen " signal (jumping to low level behind the high level signal keeps a period of time to be high level then again), the top that is raised on glass was finished and is concentrated the function of closing window thereby controller motor drive module of the present invention drives that the electric glass lifter motor makes lifter.
The modular construction form of the employing main program of automotive electric glass lifting intelligent controller of the present invention and control method thereof, first order function subprogram, interrupt service routine and second-order subroutine.Wherein: main program is main program Main Program; First order subroutine comprises: automotive electric glass lifting intelligent controller rising subprogram, automotive electric glass lifting intelligent controller decline subprogram, automotive electric glass lifting intelligent controller serial communication subprogram, automotive electric glass lifting intelligent controller trouble diagnosing subprogram; Second-order subroutine or interrupt service routine comprise: timer interrupt service routine, automotive electric glass lifting intelligent controller stall and overcurrent protection subsubroutine.
Main program Main comprises six program areas promptly: the sleep of the initialization of micro controller system (Initialize MCU), micro controller system with wake up, enter lifter rising subprogram with return, enter lifter decline subprogram with return, enter the trouble diagnosing subprogram with return, serial communication function and enter the serial communication subprogram with return.
See also Fig. 4.The initialize routine district of main program micro controller system of the present invention is provided with the direction and the state of each port, the state that the partial status control register is set, cleaning internal memory and time-delay 2s and starts working after stable to guarantee external status.
The sleep of micro controller system and wake up procedure district are provided with micro controller system to enter dormant condition are serial communication on-off signal serial_in by zero level and become high level and keep the regular hour, also are provided with the condition of waking up and are serial communication on-off signal serial_in or deagnostic communication on-off signal diag_in by high level vanishing level.When micro controller system is in the sleep mode of operation, controller work is forbidden; When micro controller system was 0 for waking mode of operation and serial_in up, lifter operation control word Win_enable was 1, and controller work allows.
Enter lifter rising subprogram and return information district be provided with enter lifter rising subprogram with return the conditional definition that program is entered lifter rising subprogram be lifter operation control word win_enable control word be 1 and the input switch signal up_in that after filtering, still obtains rising be 0.The glass rising function of controller glass rising function, rising pinch resistant functionality, the function of rising obstacle negotiation, rising overload protection function are realized in the rising subprogram.Timer interrupt service routine and automotive electric glass lifting intelligent controller stall and overcurrent protection subsubroutine provide the service of position judgment, anti-clamping method and overcurrent protection aspect for the rising subprogram.
Entering lifter decline subprogram and return information district, to be provided with the condition that enters lifter decline subprogram be that lifter operation control word win_enable control word is 1; And the input switch signal down_in that still obtains descending after filtering is 0.The glass decline function of controller, the soft hold function that descends and decline overload protection function are realized in the decline subprogram.Timer interrupt service routine and automotive electric glass lifting intelligent controller stall and overcurrent protection subsubroutine provide position judgment, the soft service that stops algorithm and overcurrent protection aspect for the decline subprogram.
Entering automotive electric glass lifting intelligent controller trouble diagnosing subprogram and return information district, to be provided with the condition that enters lifter trouble diagnosing subprogram be that lifter operation control word win_enable control word is 1; And still obtaining trouble diagnosing input switch signal diag_in after filtering is 0.The fault diagnosis functions of controller realize in trouble diagnosing subprogram subprogram.
The management to serial communication signal serial_in has been realized in the serial communication function program area.This program area is divided into serial communication signal serial_in past serial communication signal value serial_level before detecting and detects the present serial communication signal value serial_in that obtains.When serial_level is 0 when simultaneously serial_in is 0, then renovating serial_level, the win_enable control word is set is to return main program area after 1.When serial_level is that the 0 serial_in renovation serial_level that then delays time when being 1 behind the 10ms is provided with and returns the function that main program area realizes that rear window is forbidden after the win_enable control word is 0.When serial_level is 1 and serial_in when being 1, then renovating serial_level, the win_enable control word is set is to return main program area after 0, and micro controller system prepares to enter sleep state after wake-up condition is set.When serial_level is 1 and serial_in is 0 and when still obtaining serial_in being 0 after filtering, then enter lifter serial communication submodule.The function of the concentrated pass window of controller realizes in the serial communication subprogram.Timer interrupt service routine and automotive electric glass lifting intelligent controller stall and overcurrent protection subsubroutine provide the service of position judgment, anti-pinch algorithm and overcurrent protection aspect for the serial communication subprogram.
Simultaneously, controller of the present invention has increased the safety redundant design:
1. electric glass lifter rising knob and decline knob are sampled simultaneously, do any action if rising knob and decline knob are all connected and after avoiding switch to be out of order, cause misoperation;
2. the electric glass lifter on-off signal is repeatedly sampled, if sampled result difference then ignore this time that sampling causes misoperation to avoid interference repeatedly;
3. current value is got repeatedly sampling and the deviation of data to reduce to sample after treatment;
If 4. electric glass lifter total current sustained overload then needs could connect electric glass lifter behind the button again, with protective relay;
5. each starter motor operation electric glass lifter also cuts off the motor wait according to each situation (for example stall, soft stopping or anti-pinch) and could continue action after one second with protective relay and lifter motor.
6. electric glass lifter is when two stop positions up and down, persistent switch or deliberately persistent switch cause motor rotation blockage for several times, then motor cuts out, wait for and could move after two seconds with protective relay and lifter motor; If do not detect motor yet behind the rising/decline 15s automatically, then stop rising/decline.
7. the operation of " house dog " watchdog routine is to prevent that program out of control from causing dysfunction; Recovered part critical function when resetting.
8. after continuous No. 5 the lifter anti-pinch, electric glass lifter then need be learnt again, to improve the reliability of electric glass lifter system.
9. program pointer overflows the dysfunction of service subprogram to prevent that the program pointer race from being caused when flying.
The present invention can realize following function:
1, glass lifting function;
2, pinch resistant functionality;
3, the function of obstacle negotiation (run into obstacle in uphill process, the energy obstacle negotiation guarantees that glass rises as usual);
4, overload protection;
5, dormancy and arousal function;
6, concentrate the pass window;
7, (the controller serial interface obtains " button inefficacy " signal and promptly by after ' zero level uprises level ', forbids the glass port lifting) forbidden in operation;
8, soft stopping (window regulator stops at stop under glass, in case the downward impact of lifter);
9, fault diagnosis functions.