Math help for brake lockup

adambrouillard
Posts: 19
Joined: Tue Apr 19, 2011 1:46 am

Math help for brake lockup

Postby adambrouillard » Thu Jan 17, 2013 4:15 pm

Trying to setup my system to turn on a light for brake lockup on the fronts and another on the rear.

System is the mk3
I have 1 light setup on output driver 1 and another on 2.

I figure I could just divide carspeed over wheelspeed and then if then have a trigger value of .5 or something.

How do I set it up so that either left or right would make it go on?

Thanks,

osborni
Posts: 497
Joined: Fri Dec 07, 2007 9:08 pm
Location: USA, Michigan

Postby osborni » Thu Jan 17, 2013 7:42 pm

Not sure of the exact logic in the Mk3, but it is an OR statement inside an IF statement.

If I where doing this in excel:

IF(OR(left lock, right lock),Light turns on)

Left Lock = carspeed/wheelspeed>0.05 (or something, need to experiment)

IF(statement, true statement consequence, false statement consequence)
OR(statement A, Statement B) - either is true then OR is true
BMW 2000 M Coupe

Turby
Posts: 296
Joined: Thu Nov 17, 2005 2:28 pm

Postby Turby » Tue Jan 22, 2013 2:10 pm

When doing this sort of math based on wheel speed, remember that the inner and outer wheel speeds will be different when turning, the difference is also dependent on the angle of the steering wheel (ignoring ackerman for now...)

Support

Support

Postby Support » Wed Jan 23, 2013 3:23 pm

Hello,

I would do it like this...
IF(IF(VAR_0407>2,avg(VAR_0300,VAR_0301,VAR_0302,VAR_0304),VAR_0414)-(min(VAR_0300,VAR_0301,VAR_0302,VAR_0304))>1,1,0)

This is doing...

IF(If GPS speed accuracy is more then 2 output the average wheel speeds.) - (minimun wheel speed of all 4) is more then 1MPH output 1 else 0

This will stop the light coming on in poor GPS conditions and use average wheel speed. You may want to average the front wheel speeds.

I recommend you test this in the analysis on some data in a user defined variable and when that user defined variable shows as 1 the light would be on. You then check it is working correctly before attempting to do it in real time.

Kind regards,
Kieran

Turby
Posts: 296
Joined: Thu Nov 17, 2005 2:28 pm

Postby Turby » Wed Jan 23, 2013 3:35 pm

Another thought is that I've had instances where I've been cocking a rear wheel in the air on a FWD car, this causes all sorts of problems as the wheel slows and stops very quickly, not exactly a lock up situation. Maybe gate this in conjunction with -ve acceleration

adambrouillard
Posts: 19
Joined: Tue Apr 19, 2011 1:46 am

Re: Support

Postby adambrouillard » Fri Feb 01, 2013 3:06 pm

[quote="Support"]Hello,

I would do it like this...
IF(IF(VAR_0407>2,avg(VAR_0300,VAR_0301,VAR_0302,VAR_0304),VAR_0414)-(min(VAR_0300,VAR_0301,VAR_0302,VAR_0304))>1,1,0)

This is doing...

IF(If GPS speed accuracy is more then 2 output the average wheel speeds.) - (minimun wheel speed of all 4) is more then 1MPH output 1 else 0

This will stop the light coming on in poor GPS conditions and use average wheel speed. You may want to average the front wheel speeds.

I recommend you test this in the analysis on some data in a user defined variable and when that user defined variable shows as 1 the light would be on. You then check it is working correctly before attempting to do it in real time.

Kind regards,
Kieran[/quote

Thanks, so is a lower number for GPS accuracy better? I read that as if GPS accuracy is less than 2 than use raw GPS if not than average wheelspeed. Is using raw GPS better than VAR_0015 (combined)

adambrouillard
Posts: 19
Joined: Tue Apr 19, 2011 1:46 am

Postby adambrouillard » Fri Feb 01, 2013 3:48 pm

Okay, testing it out in the analysis software.


if(var_0414/4-min(VAR_0300,VAR_0301)>2,1,0)

works fine if I just use GPS speed minus minimum of front 2 wheels. Wheel frequency x 4 is MPH.

but

if(avg(VAR_0300,VAR_0301)-min(VAR_0300,VAR_0301)>2,1,0)

is just outputting the average of the front 2 wheels. Also If I try and add the rear wheels into the average I get a syntax error.

Any help would be appreciated.

Support

Support

Postby Support » Mon Feb 04, 2013 2:07 pm

Yes you are right it does just output the average. Good spot - this will be fixed shortly.

Please use.. if(((VAR_300+VAR_301)/2)-(min(VAR_300,301))>2,1,0)

Kind regards,
Kieran

Image

adambrouillard
Posts: 19
Joined: Tue Apr 19, 2011 1:46 am

Postby adambrouillard » Wed Feb 27, 2013 12:50 am

Got another question. I've noticed that in situations where the wheel goes from say 40 mph to lockup in less than one rotation the sensor reads as if it's still at 60 mph until the wheel starts to turn again and updates.

Is there anyway to make it so it has to have a constant signal otherwise it reads as 0?

Support

Postby Support » Wed Feb 27, 2013 9:52 am

the problem on the speed readings from the pulses on the wheels is that the speed is calculated from the time between pulses, if you don't have a next pulse you can't calculate a new time, so you have to decide at what piont you set the speed to zero. For example, if our theoretical wheel is 2m circumference and gives out 2 pulses per revolution, then at 50m/s we have a 20ms time between pulses, if the wheel slows down massively and we had a pulse after 1s then it would output a speed of 1m/s, if there is a 2s gap then it is 0.5m/s, but at what point do we give up waiting for a pulse and set it to 0m/s? You can't output the speed based on pulses which aren't there.
The slower the speed, the slower the updates, and in the limiting case this means no updates with no speed.

Martin

osborni
Posts: 497
Joined: Fri Dec 07, 2007 9:08 pm
Location: USA, Michigan

Postby osborni » Wed Feb 27, 2013 1:29 pm

Gingerman! Too bad it's snowing out now. :( ~30 minutes from me.
BMW 2000 M Coupe

smoothTouch
Posts: 2
Joined: Sat Mar 23, 2013 7:51 am
Location: Australia

Postby smoothTouch » Thu Apr 04, 2013 12:06 pm

Oh! Is it so? Quite sad to hear that, guess it’s seriously snowing out.


Return to “General software support”

Who is online

Users browsing this forum: No registered users and 186 guests