Automatic Speed control

Henrik Pedersen

New Member
Joined
Nov 25, 2018
Messages
8
Reaction score
1
Location
Denmark
Your Mercedes
CLS 350 CGI 2007 deisgno
Tried to post this on MBWorld but no reply, so I try to see if there are some CAN bus heroes here on MB- world

I am trying to install an automatic speed regulation system into my CSL 350 CGI 2007 (W219) and I need some help on CAN bus signals.

What I have so far is a Particle Electron (IoT device) that talks to TomTom, asking for the speed limit at the location I am at, using an attached GPS receiver. It compares the groundspeed from the GPS receiver to the speed limit from TomTom, and outputs three different digital output signals: Go-faster, Slow down, or Speed OK. (Speed OK is active if i am near to the speed limit +/- 2 km/h)
I have used it in my AUDI A3 by connecting the outputs directly to the wires coming from the cruise control switch on the stalk, and it have worked fine keeping the speed of the car within the speed limits.
Since i have been lucky swapping the AUDI with a CLS 350, i need to move this system to the Mercedes.

The challenge here is that the Mercedes have Distronic, so my device will try to send "Go-faster" signals to car if the speed is limited by Distronic.

So... I need to do this over CAN bus, and what I am after is a list of the parameters that may tell me if the Distronic is limiting the speed, and I also need the commands to send to the CAN bus for speeding up, and speeding down. (This may just be like switch activated, or something)

Anyone able to help me out with the list of these CAN signal, and i will share how i build the "Particle-Electron + GPS-receiver + TomTom" system.
 

Yugguy

Senior Member
Joined
Mar 4, 2016
Messages
2,241
Reaction score
566
Location
Rugby, UK
Your Mercedes
C220CDI W204 Elegance Comand
I would not want to risk the discrepancy between what TomTom thinks the speed limit is, and what it actually is.
 

flowrider

Senior Member
Joined
Jul 21, 2014
Messages
3,650
Reaction score
1,611
Your Mercedes
SL500 (R230)
Is this safe? What happens if the speed limit says 50 and you need to slow down for an obstacle, does the car keep trying to accelerate back to the speed limit? Maybe I have got the wrong end of the stick!
 

alexanderfoti

MBO Forum Supporter
Authorised Forum Supporter
Joined
Mar 25, 2010
Messages
15,138
Reaction score
6,297
Location
Tonbridge
Your Mercedes
W221 S65 AMG - W204 C63 AMG + Various other MB's
The challenge here is that the Mercedes have Distronic, so my device will try to send "Go-faster" signals to car if the speed is limited by Distronic.

First off A++ on the project ambition! Love it. Would some day hope to code something that sits on the canbus to allow for Android Auto/Ipod control in cars that do not offer full integration!

Secondly, the distronic is not an issue (IMO). I would still feed these signals into the cruise stalk, as you keep an element of safety (the system only works with cruise on!)

I see the issue is with the control side, is that your device will keep increasing the set speed on the dash, in an attempt to increase the vehicle speed. If it were me, I would try and build some speed increase detection into the control side.

If I does not detect speed increase after 1.5 seconds, unset the cruise, wait 30 seconds, set again etc. Repeat this until no car in front of you and the speed limit is achievable.

Interfacing with distronic will be difficult, as its on the high speed can, so your device may not be able to keep up?
 

Craiglxviii

Senior Member
Joined
Sep 6, 2015
Messages
17,781
Reaction score
7,426
Location
Cambs UK
Your Mercedes
970 Panamera Turbo; W221 S500L AMG Line, C215 CL500, W251 R350L AMG Line, plus several more now gone
Jesus. This is difficult enough to do with OEM level access to their own parts. It's been tried and what we find is the GPS speed signal causes conflicts with the wheel speed sensor average input, outside of the system tolerances.

Your TomTom is not calibrated to provide an accurate enough speed signal, it has a refresh rate of between 0.5- 1.0s from memory. Avoid it. Run for the hills.
 

alexanderfoti

MBO Forum Supporter
Authorised Forum Supporter
Joined
Mar 25, 2010
Messages
15,138
Reaction score
6,297
Location
Tonbridge
Your Mercedes
W221 S65 AMG - W204 C63 AMG + Various other MB's
Jesus. This is difficult enough to do with OEM level access to their own parts. It's been tried and what we find is the GPS speed signal causes conflicts with the wheel speed sensor average input, outside of the system tolerances.

Your TomTom is not calibrated to provide an accurate enough speed signal, it has a refresh rate of between 0.5- 1.0s from memory. Avoid it. Run for the hills.

That is a very good point. I think a 10hz receiver would be the minimum for something like this.
 

LostKiwi

Senior Member
Joined
Aug 25, 2006
Messages
31,343
Reaction score
21,600
Location
Midlands / Charente-Maritime
Your Mercedes
'93 500SL-32, '01 W210 Estate E240 (RIP), 02 R230 SL500, 04 Smart Roadster Coupe, 11 R350CDi
As I see it the issue with distronic will be that the unit will tell the car to increase speed but distronic sensing a vehicle in front and being unable to will simply register the request and increase its set limit without speeding up. The unit then senses speed is not high enough, sends the request again on the next cycle which distronic duly ignores in the same way as above. This repeats several times after which the vehicle in front pulls over. Distronic now tries to accelerate to 100mph (or whatever other speed it's set speed has increased to) whereupon the unit has to tell it repeatedly to slow down, during which time you've gone past a speed camera....

Also (if your distronic works like ours) there are 2 increase/decrease options. Stalk up or down increases/decreases speed by 5mph, stalk pulled towards the wheel increases by 1mph but there is no fine granularity decrease.
What's needed is a way to query the distronic to find what it's current speed is and not increase that if it's <1mph higher than the units desired setting.

Alternatively you could just use the speed limiter function built into cruise....
 
Last edited:

Botus

Senior Member
Joined
Jul 29, 2014
Messages
6,287
Reaction score
2,475
Location
UK
Your Mercedes
S500/2010/500
is the OP confusing, cruise with brake function, with distronic radar driven active cruise control?

on distronic plus a long nudge (up or down) adjusts speed by 5mph and a quick nudge is 1mph, pull towards you is resume, push away cancel

the way I read it was use the speed limit database from TomTom, alongside another gadget to pick up vehicle speed and then try to tell the car what to do.... doesn't seem too challenging (could you not link it back to the data the radar is giving and override with the speed limit data when the cruise can't find anyone getting in the way?).

Safety wise I don't see an issue - you press the brake pedal and it turns off just like cruise has for 70 years
 
Last edited:

LostKiwi

Senior Member
Joined
Aug 25, 2006
Messages
31,343
Reaction score
21,600
Location
Midlands / Charente-Maritime
Your Mercedes
'93 500SL-32, '01 W210 Estate E240 (RIP), 02 R230 SL500, 04 Smart Roadster Coupe, 11 R350CDi
Distronic is radar cruise as fitted to our 2002 r230 and behaves in a similar way to how you describe (up or down +/-5 mph, pull +1, push disengage). Distronic plus came along much later.
The early system was called tempomatic I seem to recall. That operates +/-1 for a nudge up/down and nothing for a pull other than engage cruise if not engaged already).
 

Botus

Senior Member
Joined
Jul 29, 2014
Messages
6,287
Reaction score
2,475
Location
UK
Your Mercedes
S500/2010/500
….was about to edit mine ( in fact I now have)

I was wondering if cruise with brake function was harder to manage than just cruise control
what does the plus bring? other safety stuff life pre safe brake? ahh, maybe its that it manages speed from 0 to 200kph

so there's 4 systems

cruise
cruise with brake (overspeed controlled by light brake application)
distronic
distronic plus (manages down to 0)
 
OP
Henrik Pedersen

Henrik Pedersen

New Member
Joined
Nov 25, 2018
Messages
8
Reaction score
1
Location
Denmark
Your Mercedes
CLS 350 CGI 2007 deisgno
  • Thread Starter
  • Thread starter
  • #11
Thanks for all the comments.


For the security part, no issues, as Botus says, it cancels whenever I touch the brake like it always have.


For the reliability of speed limits from TomTom. Like i mentioned a have been using the setup for some months now in the Audi, and i have found only a few exceptions here in Denmark from what was reported by the TomTom API, and what was signed on the road. I would say that in 98% it is correct, but this may be different in other regions.


The current speed is not pulled from TomTom, it is taken directly from the GPS receiver once per second, and this is so far sufficient, my GPS receiver can go up to 10 Hz, but not needed yet.


For the Distronic part, all I need to know is the current setting of the Distronic. If current speed is below this setting then the speed up pulse must be disabled. I would guess that is in the can bus somewhere as a PID. So then, I will only need to read the can bus. Then I will just connect to the switch on the stalk, in order not to tamper too much with the high-speed can.


Will try to post some pictures of the hardware, as I used in the Audi. The three LED’s shows if I am under, over or within the speed limit gap. And then I had two wires going to the stalk, sending a pulse of 100mS each second if I were under or over that gap. It worked very well in the Audi.

Next step will be to look at the current position together with direction, and the calculate a vector, for where i may be after a few seconds, and then use this reference to ask TomTom. This will ensure that my car have the time to slow down before i pass a city limit. Currently i will be 50-200 meters beyond the citylimit, before i have slowed sufficiently down, AND this is usually where the speed traps are set up


2018-12-20 12.24.48.jpg 2018-12-20 12.24.44.jpg 2018-12-20 12.24.08.jpg

Top line is just to show that i do get meaningfull data from the GPS
Second line is the staus showing that i have a "fix" from the GPS with a resonable accuracy of few meters.
Next two lines are the coordinates
Line 6 is the calculated current ground speed, it varies due to the inaccuracy of the coordinates (it is sitting on my desk) it is more stabel out in the wild.
Line 7 shows the response from TomTom, the speed limit of my street is 50 km/h
Line 8 counts the webhooks i send to TomTom, My current dev. account only allows 2500 hooks per day, but this i well suited for my driving if i keep it at a rate of one per second.
Lat line tells me to speed up, slow down, or just keep the speed :)
 
Last edited:

Botus

Senior Member
Joined
Jul 29, 2014
Messages
6,287
Reaction score
2,475
Location
UK
Your Mercedes
S500/2010/500
nice idea,

if you get it sussed you could sell it - maybe using a raspberry pi 3b, a harness and almost make it plug and play
 

Craiglxviii

Senior Member
Joined
Sep 6, 2015
Messages
17,781
Reaction score
7,426
Location
Cambs UK
Your Mercedes
970 Panamera Turbo; W221 S500L AMG Line, C215 CL500, W251 R350L AMG Line, plus several more now gone
nice idea,

if you get it sussed you could sell it - maybe using a raspberry pi 3b, a harness and almost make it plug and play

.... and if you can get it E-marked. Or ECE approved.
 

John Laidlaw

Senior Member
Joined
Nov 15, 2013
Messages
26,373
Reaction score
9,163
Location
Wirral
Your Mercedes
Land Rover Discovery 4
This is all just a noise! :p Wayyyy beyond my pay grade (says the man buying a huge battery with wheels)
 

Blobcat

Moderator
Joined
Feb 8, 2006
Messages
38,923
Reaction score
27,653
Location
Grange Moor
Your Mercedes
R171 SLK280, Smart R451, Land Rover 110 County SW, 997 C2S, R1250 GSA TE 40th, CBR600FP
This is all just a noise! :p Wayyyy beyond my pay grade (says the man buying a huge battery with wheels)
You just saw the "shiny shiny" and headed towards the light :D
 


Chris Knott Insurance, see oursticky posts here!
www.ckinsurance.co.uk
Top Bottom