The vehicle data acquisition equipment of a kind of adaptive OBD interface and the multiple automobile bus of self-adaptation and diagnosing protocolTechnical field
The present invention relates to a kind of vehicular data acquisition equipment, relate in particular to the terminal of a kind of adaptive OBD II interface and various automobile bus and diagnosing protocol.
Background technology
Along with the high speed development of automobile industry, the continuous of home-use car popularized, and the Related product of living after automobile also forms great market.Automobile failure diagnosis series products as automobile after the most important components of life Related product, popularized rapidly along with the development of automobile industry.
Existing automobile failure diagnosis series products has two large weakness: the one, and this series products is all could use the in the situation that of known OBD II interface pin definition; The 2nd, this series products is only supported the compatible vehicle of OBD II/EOBD agreement substantially, needs corresponding modify interface circuit, complex operation for the OBD II interface signal of different automobile types.
Summary of the invention
The object of the invention is to OBD II total interface to carry out validation checking, know all signal definitions on an OBD II16 PIN, thereby can carry out automobile information collection and diagnosis service to unknown bus interface.
Brief description of the drawings
Below in conjunction with accompanying drawing, by the specific embodiment of the present invention is described in detail, will make technical scheme of the present invention simple and clear.
Fig. 1 is the hardware module schematic diagram of the present invention for vehicular data acquisition equipment.
Fig. 2 is the schematic flow sheet of confirming GB definition pin signal.
Fig. 3 is the schematic flow sheet that detects self defined interface signal definition.
Fig. 4, for being in bus interface situation at self defined interface, further confirms the process flow diagram of interface signal definition.
Fig. 5 is the schematic diagram that terminal different working modes switches.
Technical scheme of the present invention is as follows:
This automobile information acquisition terminal comprises program control multi-way switch handover module (103), auxiliary separating die block (108), bus transceiver module 1 (101), bus transceiver module 2 (102), the miniature control module of MCU (109), nonvolatile memory (110), GPS locating module (111), wireless communication module (112) and power supply conversion and control module (104).
In this automobile information collecting device, program control multi-way switch handover module (103) is by CPLD, multiplexer and analog switching circuit composition, CPLD control simulation on-off circuit connects the top of bleeder circuit, the tap of resistance in series can connect the input end of multiplexer, analog to digital conversion port and time that multiplexer output can connect miniature control module (109) catch port, bus transceiver module 1 (101), can be according to concrete execution flow process, carry out Dynamic Selection by program control multi-way switch (103) and auxiliary separating die block (108) work, miniature control module (109) sends instruction to CPLD, and control multiplexer and select different point pressure passageway, and then obtain undefined port level value.CPLD model is EPM1270.
The auxiliary separating die block (108) of this terminal by the resistance of 8 series connection to the self-defined OBD II of manufacturer pin signal dividing potential drop, can adaptive MCU microcontroller (109) interface.
The bus transceiver module 1 (101) of this terminal comprises high-speed CAN, low speed/fault-tolerant CAN bus transceiver, SCAN single bus transceiver, K/L bus transceiver and PWM/VPW bus transceiver, high-speed CAN transceiver adopts NXP TJA1042, low speed/fault-tolerant CAN bus transceiver adopts NXP TJA1050, SCAN single bus transceiver adopts MCZ33897, and K/L bus transceiver and PWM/VPW bus transceiver are made up of discrete component.
The bus transceiver module 2 (102) of this terminal comprises high-speed CAN, K/L bus transceiver and PWM/VPW bus transceiver, high-speed CAN transceiver adopts NXP TJA1042, and K/L bus transceiver and PWM/VPW bus transceiver are made up of discrete component.
The miniature control module of MCU (109) of this terminal adopts NXP LPC17XX.
This terminal determines that the concrete execution flow process of all of the port signal definition is as follows:
According to related content in ISO DIS 15031-3,1,3,8,9,11,12,13 to leave automobile vendor for self-defined, and 2,6,7,10,14,15 use as diagnosis communication.
Below to according to 2,6,7,10,14,15 interfaces as diagnosis communication, determine and the validity of its signal see appendix Fig. 2 in explanation.To 1,3,8,9,11,12, the 13 self-defining interfaces of manufacturer, detect its interface features, determine whether, into bus interface, to see appendix Fig. 3 in explanation.
1. MCU microcontroller unit (109) instruct program control multi-way switch handover module (103) to control 2 by SPI interface, 10 pins J1850 PWM interface in bus transceiver module 2 (102) is connected with the SPI module of the miniature control module of MCU (109), press SAE J1850 PWM communications protocol and send diagnostic command, define requirement if any replying and meeting communications protocol, can determine that 2,10 is J1850 PWM interface.Enter the 3rd step, enter the 2nd step without replying.
2. the miniature control module of MCU (109) is connected with the SPI of the miniature control module of MCU (109) through SAE J1850 VPW interface 2, press SAE J1850 VPW communications protocol and send diagnostic command, define requirement if any replying and meeting communications protocol, can determine that 2 for J1850 VPW interface, be without defining interface without replying 2.Enter the 3rd step.
3. the miniature control module of MCU (109) is by 7,10 are connected with the SPI of the miniature control module of MCU (109) through K/L bus transceiver, press ISO9141-2, ISO14230-4 communications protocol sends initialization command, if any replying and meeting communications protocol definition requirement, can determine that 7,10 is K/L bus interface, be without defining interface without replying 7,10.Enter the 4th step.
4. MCU microcontroller unit (109) are by 6,14 access CAN high-speed transceiver CANH, CANL line, by ISO15765-4 communications protocol, CAN control module in MCU being set is listen mode, baud rate starts to successively decrease from 1M, in the time entering CAN receive interruption, record Set For Current baud rate, confirm as high-speed CAN bus.After baud rate traversal, fail to enter CAN receive interruption, 6,14 is not CAN bus.
5. complete to 2,6 the signal definition confirmation work of 7,10,14,15 interfaces.
6. the self-defining interface of pair manufacturer detects, and determines its interface signal definition.Testing process is as follows:
In the process of detection self defined interface level, the miniature control module of MCU (109) is to program control multi-way switch handover module (103) sending controling instruction, connect the PIN3 of OBD II to the head of bleeder circuit, bleeder circuit afterbody ground connection, select dividing potential drop minimum point to be connected to the analog to digital conversion interface of the miniature control module of MCU (109) as tap, continuously docking port number of scans second, change if any level, utilize analog to digital conversion result and intrinsic standoff ratio calculate and record level maximal value and minimum value, change same record without level.Successively self-defining port is carried out to same analog to digital conversion scanning.Scan successively self-defining port by same procedure, obtain the level delta data of each port.Can the possible bus signals of the each port of anticipation according to the level changing value of each port.See accompanying drawing Fig. 4, respectively to high-speed CAN bus voltage, low speed/fault-tolerant CAN bus voltage, single line CAN bus voltage is illustrated.Separately, the noble potential of J1850 PWM is 5V, and electronegative potential is 0V, and the noble potential of J1850 VPW is 12V, and electronegative potential is 0V.Because K/L line need to send after initialization command in bus, communication just can be carried out, therefore put aside.
7. complete after the 6th step, using timer and D/A converter module collaborative work in the miniature control module of MCU (109), can find out existing level and change the pair relationhip between port.For example, according to known port voltage value, the miniature control module of MCU (109) is controlled auxiliary separating die block (108) and port voltage is adjusted to appropriate value connects the analog to digital conversion interface of MCU control module (109) and timer catches port, the duration of timer statistics low and high level is triggered in the hopping edge of port signal, simultaneously, signal saltus step edge can trigger analog-digital conversion function, for high-speed CAN bus, low speed/fault-tolerant CAN bus, J1850 PWM bus three quasi-protocols are determined the matching relationship between port.
8. complete after the 7th step, by the method for the 4th step, need to determine high-speed CAN bus, low speed/fault-tolerant CAN bus, the baud rate of single line CAN bus, configuration CAN functional module is listen mode, miniature control module (109) is controlled program control multi-way switch module (103) and is communicated with corresponding port, baud rate is successively decreased from 1Mbit/s, records current baud rate while successfully entering receive interruption.
9. as the signal port of J1850 PWM or J1850 VPW detected in manufacturer's self defined interface, miniature control module (109) sends control command to program control multi-way switch module (103), be communicated with the signal port of J1850 PWM or J1850 VPW, the corresponding interface of bus transceiver module 1 (101) and miniature control module (109), according to the mode of the 1st step and the 2nd step, determine the port signal authenticity of J1850 PWM or J1850 VPW.
10. the port changing without level in pair manufacturer's self defined interface carries out the judgement of K/L line bus, miniature control module (109) sends control command to program control multi-way switch (103) module, be communicated with the signal port changing without level, the corresponding interface of bus transceiver module 1 (101) and miniature control module (109), according to the mode of the 3rd step, determine in unallocated port, whether there is K/L bus.
After 11. pairs of OBD II all of the port signals are confirmed to finish, carry out data acquisition and diagnosis service.See accompanying drawing Fig. 5, according to the state of OBD IIPIN16 power level value and all of the port bus signals, in the time meeting the terms and conditions of pattern conversion in Fig. 5, the mode of operation of terminal is switched, the power consumption of dynamic adjustments self.Normal mode: all electronic modules are normally worked.The miniature control module of abnormal voltage pattern: MCU (109) monitoring power supply, bus collection and the work of diagnosis service stopping, GPS module (111), wireless communication module (112) is normally worked, and reports abnormal voltage situation.The miniature control module of bus park mode: MCU (109) enters dormancy ready mode, bus collection and the work of diagnosis service stopping, and GPS module (111), wireless communication module (112) is normally worked, reporting position information.The miniature control module of sleep pattern: MCU (109) enters sleep pattern, bus gathers and the work of diagnosis service stopping, GPS module (111), wireless communication module (112) quits work, the miniature control module of MCU (109) can have bus signals to wake up or automatic cycle wakes up, gather port bus signals, monitoring voltage value, and report a secondary data.Deep sleep: monitoring voltage drops to limit value, MCU penetration depth park mode, and periodic wakeup, only monitoring voltage value when periodic wakeup under sleep pattern.Terminal is closed: magnitude of voltage is lower than limit value, and whole terminal quits work.
12. terminals, in bus collection and diagnosis service, can send control command to finished vehicle electronic control module by special diagnostic instruction, and vehicle is oppositely controlled, and as remote activation, release, latches with switch vehicle window etc.