repurpose automotive radar for UAV/UGV

Hello,

I was interested in trying an automotive radar for collision avoidance on a UGV. Automotive radar should be cheaper than LIDAR due to scale production and no moving parts, and requires less brains than stereo vision.

I got a Bosch sensor for an Audi Q5 (Audi part 8R0907561) off eBay. The magical search term was "Adaptive Cruise Control". There are other radars from other companies, I got that one because it was the cheapest and there was some information about it on the net.

Hooked it up to my laptop using a CAN-USB interface (photo below). It outputs a steady stream of messages, unfortunately those messages don't change when I change the distance to objects in front of the sensor. An example of the stream of packets is attached. I feel there may be some configuration that is sent to the sensor to get it to output range information. It gets a little warm to touch and draws around 180mA@12V, so something is happening.

What would really help is a log of the CAN bus traffic from an operational sensor. I could replay this log back into my sensor and see if it came alive.

* Has anyone tried to use an automotive radar?

* Does anyone have an Audi with adaptive cruise control and could log some data for me?

PS for anyone who is interested, here is some links about Bosch automotive radar:

Nice summary article talking about Bosch's radar development, no details. I think I have LRR2, not LRR3.
http://spectrum.ieee.org/green-tech/advanced-cars/longdistance-car-radar/0

A university thesis about how well the radar detects different objects. Has some details about the CAN messages but none of the messages match what I get. Probably the audi part has a different firmware.
http://etd.ohiolink.edu/view.cgi?acc_num=ohiou1304083389

Service manual for Adaptive cruise control in an audi a8 (in German) has some CAN bus and state diagrams.
www.volkspage.net/technik/ssp/ssp/SSP_289.PDF

Some more Bosch marketing material with nice detail (shows LRR3 has much wider field of view than LRR2).
http://www.vehicledynamics-expousa.com/08_conf/pdfs/day%202/09.50_hoetzer.pdf

Retrofit of ACC to an Audi Q7, this is where I got the pinout from.
http://audiforum.us/threads/adaptive-cruise-control-acc-retrofit.13441/

The CAN bus log is from a Kvaser leaf using Kvaser's canlib library, data format is
id length messages[0..7] flags time
- time is in milliseconds
- the logs are taken from start up, so step 1 start logging, step 2 turn on sensor.

script sort-log.py shows the unique messages.
Cheers

3690963596?profile=original

log1.txt

log2.txt

sort-log.py

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

        • I haven't worked on this in a long time. As pointed out by James M earlier, the firmware on the radar used in the ohio university thesis is surely not the same as the firmware in the audi part.

  • Hi there,

    I've bought one lrr3 but hadn't any time to test it yet. As far as I know, the Bosch sensors have some kind of gyroscope onboard and throw out an error on CAN when the sensor isn't aligned properly. I've seen that you placed your sensor horizontally on the table. Maybe that's the reason why the sensor didn't work. I've heard that even the position of the connector is important (if it sits on the side, bottom or elsewhere is programmed to the sensor ECU and differs from car to car model) So try to align the sensor to it's original position and try again.

    I don't think the sensor needs any data from CAN to get into an active mode, because the sensor provides a list of all recognized targets including the angel and relative speed offset. If the sensor would get any speed data or steering angel from CAN-Bus the sensor itself could provide absolute speed of recognized targets and could minimize bus-traffic by sending only those targets, which are in the lane of the car (those with corresponding angel).

    • Hi,

      There is no gyro or accelerometer on the LRR3 or any automotive radar that I know about, they typically receive data on the vehicle motion from the ESC system. 

      The alightment error is because the system needs to be aligned to very high accuracy - because at 150m+ distance small angular errors add up to large absolute errors in position of the tracked objects. Typically when the radars are installed they are aligned against special targets (or sometimes with a small mirror on the radar). When the alignment is complete the technician will tell the radar that it has been aligned via a diagnostic command, which will make the fault go away. 

      The radar system may still send out object info on CAN, but none of the high level functionality (ACC or Automatic Emergency Braking) will be allowed. 

      • Hi.

        the alignment procedure you describe is correct, but the fine calibration (+/- 0.8°) the sensor does itself. And because only the LRR itself knows it's actual position, my thought was that there must be any kind of a sensor which provides the internal ECU with tilt information for those alignment purposes. Maybe I'm wrong here, but it's worth to try ;-)

        Anyways … I've seen a bachelor thesis where someone uses a Bosch Lane keeping camera over CAN-Bus to control an RC-Car. The Author provides all the source code he used and there isn't mentioned any handshake-procedure to get data out of the sensor. Why should Bosch handle things different on different sensors?

        link

        • You're correct that there is some limited self correction functionality, but the sensor has no way of knowing where it is and where it's pointed. It needs to be told these things via diagnostic commands which are either executed at the end of the production line, or at a repair workshop. 

          Each sensor will be slightly different because even though the hardware is the same, the software is different for each manufacturer and vehicle platform. The OEM has a lot of say in how the SW is adapted for their vehicle, especially in relation to CAN and diagnostics. 

          Most of these research projects won't be using off the shelf automotive spare parts, but radars with special sw for general purpose usages. Bosch sells versions of its radars called SGU's (sensor gateway unit) which have SW specifically designed for these purposes - unfortunately they're not intended for hobby use, and are quite expensive. 

          • You're right. It seems to be very hard to get those automotive radars working outside a car. What I've read so far (and what it makes it even more difficult) is the fact, that audi (where the sensors used here come from) have component protection implemented on all their ECUs, which makes it impossible to get them to work out of its origin in-car environment. But even if you would be able to bypass this, the audi acc will not output any detailed information of tracked targets since it calculates all the acc-relevant commands for other ECUs internally and only sends commands like acceleration. Full target tracking information like in some research studies mentioned above would be to much traffic on the slow CAN-Bus.

            But even though I won't give up for now and after a little research I discovered, that there is  something called XCP on CAN. It's a protocol for calibration and measurement purposes which is implemented in all the Bosch sensors, even in OEM-versions. Over specific commands you get access to all internally stored variables - which means to us: all recognized Targets. To tell the ACC Sensor, which data it should dump-out, there are ECU-specific asam-files (.a2l) which describe the memory-location of the preferred value and how to convert the hex values in a readable form. Since those files are not puplic, I asked myself, if there is a universal asam-request method to dump all data and do a bit of reverse-engineering.

            Maybe the author here (http://etd.ohiolink.edu/view.cgi?acc_num=ohiou1304083389) has done something similar with his CAPL-program? (see p. 49 and Annex)

            James, do you have any ideas, if it's possible?

            • Hi,

              XCP on CAN is interesting. The measurement bandwidth is quite limited compared to proper XCP on ethernet, but it should be sufficient to measure some simple info depending on how heavily loaded the CAN bus is already. 

              There are a few problems though. Pretty much every automotive ECU will either disable XCP on CAN on production parts or require some sort of authentication to prevent exactly this sort of reverse engineering.

              The link you sent doesn't work for me, but here are my thoughts. The a2l is usually generated during SW compilation, I haven't read the asam specification but I doubt there is a way to read these values via XCP, since that would require storing the memory addresses and formats of all measurable variables inside the HEX file, which would be expensive in terms of ROM space, which is very limited on these devices. 

              To be honest, it's difficult enough to get there radars running in isolation even with all the required info (CAN matrix, a2l, source SW etc.). I won't say it's impossible, but there are a lot of challenges. Audi parts are probably not the best approach though, lower cost cars are starting to get radars now, and their interfaces are likely to be simpler. What you really want is the slave radar of a master-slave pair, which will definitely send object tracking info to the master radar. 

  • Hi Zach,


    I'm interested in making an adaptive cruise control unit to my old Honda as a final project at uni and I would be much grateful for some helping informations about radar sensors.
    I'm not sure what type of sensor should I use, but due to poor range of sonic or laser sensors (I need at least 40m/130ft) I think that I have no other choice than radar sensor.
    I wonder if is this possible to use radar sensor as the standard sonic sensor to detect objects in its range?
    I mean like read (for example by ATmega) changing value of current or voltage in the output of the radar sensor, or there is no other way to communicate than by CAN?
    I read all of the comments at the topic and I see that there are some input informations required first to get anything back from the output. Am I thinking right?
    Sorry if my english is not understandable enough.


    Thanks a lot,
    Kuba

  • Hi  zach w  i bought sensor but they don't give any details about wiring and ...

    Can you give me some advises to test its. 
    3692868778?profile=original

  • Hi Zach,

    I am trying to do what you did. But when I power the sensor with 12V with a power supply, there is no current shown in the meter. Therefore, I can not get anything from the CAN bus. What kind of power supply did you use? Is there anything I should pay attention to?

    BTW, the sensor at my hand is for BMW. I hope this model is similar to your Audi one.

    Thanks a lot.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…