📜 ⬆️ ⬇️

Installing an autorun with SAE J1939 interface on a car without CAN bus

About how to connect the smartphone to the car, on Habré already wrote . Non-trivial, however, is the task of connecting sensors with a CAN interface to a car without a CAN interface. About 3 years ago a radar sensor for adaptive cruise control got into our hands;



(about sensors for collision avoidance systems, for example, here ). Such sensors work in the 77 GHz range specially allocated for autoradars, the range of action is within 200-250 meters, the viewing angle of the space in modern models is up to ± 30 degrees. On structural diagrams of collision avoidance systems and autopilots, they are designated as LRR (Long Range Radar) and they are usually placed on the front bumper. These sensors are now quite common, the company BOSCH, for example, recently released a millionth sensor , and are relatively inexpensive (<$ 1000). However, then it was still some exotic. At that time we were engaged in the development of a sensor similar in purpose, but 100% of domestic components, we had a sample and we wanted to conduct comparative tests. The testing machine was also domestic, GAZ-66, in driver's jargon "shishiga." Great car, four-wheel drive, comfortable kung with climate control, but not fully adapted to connect imported radar sensors.
In the accompanying documentation on the sensor was specified the standard of the protocol of data exchange with the vehicle systems: SAE J1939. The problem was that the protocol was conversational, and for the sensor to work properly, message exchange was required.

The sensor was connected to the laptop via a USB / CAN adapter, the message exchange was initially carried out using the CANView program. After switching on, the sensor issued several messages to the bus, one or two of which were subsequently repeated periodically. The necessary message with information about the distance to the obstacle was not issued. The nature of the original messages was clear, the sensor tried to “register” in the system, told everything about itself and where it was produced and what it was intended for, and even described the types of vehicles for which it could be installed, but received nothing in response and sent requests again and again. The vehicle’s response to its request was simulated, after which some change occurred in the packages (the sensor was surprised), but the necessary information could not be obtained anyway. After additional partial study of the standard (by the way, paid - in SAE they requested about 650 bucks a year), it was possible to decipher periodic messages from the sensor, it turned out that he constantly reports about the absence of a car. It became clear that the sensor requires information from the vehicle systems, such as speed or direction of travel. Everything that could touch him was given to him - but this was not enough for him. He did not see the car anyway. He needed some information. Then the idea arose to imitate the car completely. After reviewing the approximate composition of messages of the required standard from sensors and systems of modern Western cars, the idea did not seem very successful. For example, the description of diagnostic messages for a truck of one of the western firms occupied about 1000 pages in pdf format. I had to pay attention to the products of Chinese comrades. As a result of not too long searches, a document was found on the Internet that looks a lot like a list of commands according to the J1939 standard for some Chinese truck. The document contained a table of messages according to the standard with explanations in English, and everything else was in the hieroglyphs. The table was not very large, only about two dozen messages, and it was easy to imitate them. After that, the sensor earned.
By successively eliminating messages, it was found out what he, after all, needed. The remaining minimum, at which the radar works, together with the messages issued by it, looks like this:
')
.

It turned out that in addition to the speed information, etc., given to him at the very beginning, the sensor for some reason needed a message from the 2nd vehicle controller. Most likely, he was pleased with the very fact of having such a controller, because he did not seem to be interested in the content of the message at all.
Further preparation of the sensor for work has been reduced to installing it on a durable (10 mm iron) bumper by drilling a bumper and screwing it in with bolts, laying cables and connecting to a laptop through an adapter. Like that:



A program was written that displays information from this sensor in parallel with information from a sensor of its own design. To control the traffic situation in the cabin, a USB camera was installed, the image of which was shown in the window next to the program window. Test video

Source: https://habr.com/ru/post/230205/


All Articles