Donations towards server fund so far this month.

 
£0.00 / £100.00 per month
Page:
Home > A-Series EFI / Injection > Megasquirt Traction Control

Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

Following on from the thread the other day about the SC Traction Control, I've been investigating how this can be done with the latest Megasquirt code that includes the features for siamese port engines.

Anyway, as identified in the other thread, a guy in Germany has done some initial testing of a simple traction control system on a Formula Student car last year. He has used the latest version of the MS code 3.0.3r and has added some complex assembly code that uses fuzzy logic to control traction.

The system is simple in that it compares front to rear wheel speeds and retards/advances ignition depending on the difference. It will later be developed to include fuel cut as well, but I'm not sure we can implement that on the siamese setup.

Basically the system uses toothed wheels and hall sensor to give a frequency relative to wheel speed. A simple circuit has to be built to convert the frequency into a 0-5v signal. The voltage signals from the front and rear are then fed into the ECU using pins JS4 and JS5.

It is a crude system and has some compromises. Both front and rear wheels need to be the same size and the toothed wheels need to have the same numbers of teeth. However, this does not present too much of a problem on a Mini. It may be possible to extend the system to include 3 or 4 wheel sensors as the frequency converter chips can be paired up to give averages as well as minimum and maximum.

The hall sensors can be the same as I am using for a cam sensor.

Anyway, I've ordered all the parts; sensors, toothed wheels, ICs, veroboard, resistors, diodes, capacitors, a box to put it all in and a switch and I've just spent around £100.

So it has to be worth a try at that price.

I'll update this thread with progress. Maybe I should get an engine built first though.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


robert

User Avatar

6745 Posts
Member #: 828
Post Whore

uranus

woof !!!
good idea .

Medusa + injection = too much torque for the dyno ..https://youtu.be/qg5o0_tJxYM


Anton

User Avatar

1050 Posts
Member #: 764
Post Whore

Staffordshire

Sounds good, I'm planning on a MS based traction control for my next project so this will be an interesting thread.

Do you have any URL's with info for the the german chap project.


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

There is just a thread in the MS2/Extra Development forum "Traction Control Fuzzy Logic in C and Assembler".

I'm a member of the MS forums, so I PM'd him and he has sent me a write up. It would be inappropriate for me to publish his work, but there is no reason why you should not contact him directly.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


Anton

User Avatar

1050 Posts
Member #: 764
Post Whore

Staffordshire

Just had a peek... i think i need to do a bit more reading before reading it again tho.. :s


Rob H

4314 Posts
Member #: 700
Formerly British Open Classic

The West Country

Nice, I like it a lot.

What toothed wheels are you using & where / how are you fitting them?

Isambard Kingdom Brunel said:
Nothing is impossible if you are an Engineer


Brett

User Avatar

9502 Posts
Member #: 1023
Post Whore

Doncaster, South Yorkshire

im watching :)

Yes i moved to the darkside *happy*

Instagram @jdm_brett


jbelanger

1267 Posts
Member #: 831
Post Whore

Montreal, Canada

Actually, since the code compares ADC counts (voltage), it would be possible to have different wheel sizes and/or a different number of teeth as long as you calibrate the frequency-to-voltage circuits to give the same voltage at the same speed.

That may be tricky so it's easier to stay with the same but it is possible in theory.

Jean

http://www.jbperf.com/


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

Jean, in theory you could but there is only a single resistor and capacitor that you can change to adjust the range. The difference in tooth numbers would have to match ratios of available combinations. Tricky.

Rob, Trigger-wheels.com do some traction control wheels. You could fit them onto the outside of a pot joint or, as I plan, fit them to the HS coupling. At the back, they will fit to the rear hub.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

On 16th Feb, 2010 Paul S said:
I'm a member of the MS forums, so I PM'd him and he has sent me a write up. It would be inappropriate for me to publish his work, but there is no reason why you should not contact him directly.


In the MS forum he has made a link available to a basic write-up (he calls it a tutorial)
http://querdenker.dyndns.org/downloads/upb...vTCTurorial.pdf
He just says don't hammer the link (bandwidth issues I presume)

It makes interesting reading.

Schrödinger's cat - so which one am I ???


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

I think that I need to change the value of the resistor fitted to pin 3.

Patrick has used 100k ohms in his calculation, but his schematic shows 56k.

Based on a 12 tooth wheel and 165 x 70 x 10s, the frequency will be 430Hz at 120mph.

So assuming VCC at 7.8v (more on that later) then the calculation with a 56k resistor is:

7.8 * 430 * 0.000000015 * 56000 = 2.82v

2.8v is too low, it needs to be nearer 5v.

Now it would appear that 15nF capacitors are a bit rare, so substituting a 20nF cap gives the following:

7.8 * 430 * 0.000000020 * 56000 = 3.75v - still too low

So using a 68k resistor gives me:

7.8 * 430 * 0.000000020 * 68000 = 4.56v

This seems about right and allows for up to 130mph.

Now the other think is this 7.8v VCC which is stepped down from a 12v supply. Given that the MS runs at battery voltage which can be as high as 14v, do I need to make further adjustments?



EDIT: Had to break to speak to a client *frown*

Edited by Paul S on 17th Feb, 2010.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


robert

User Avatar

6745 Posts
Member #: 828
Post Whore

uranus

is it worth making 5 volts at just above possible spin speed ,say 50 mph ? this would get a greater sensitivity for launch ,then have the system turn off above 50 mph .bit of a different philosophy ?

Medusa + injection = too much torque for the dyno ..https://youtu.be/qg5o0_tJxYM


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

Interesting idea, but we would need the code re-writing to add this facility.

You would also need a facility to stop the converters feeding the MS. It would be 12v at 120 mph and a toasty MS.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


Anton

User Avatar

1050 Posts
Member #: 764
Post Whore

Staffordshire

Interesting read, makes loads more sense now. Would be benificial to be able to change settings on a dash switch, but as said its early days. I wish I had taken more notice at college when we did c and assembly.


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

I'm just planning an on/off switch at the moment. It will just cut power to the sensors and converters. Hopefuuly there will not be any electrical noise to cause problems when switched off.

As far as the code is concerned we will just have to work with what is available at the moment. I've invited Patrick to joins us, so who knows what is possible further down the line.

EDIT: You could actually arrange another LM2917N as a speed switch with histeresis. That could drive a high current driver on the 12v feed.

Edited by Paul S on 17th Feb, 2010.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


jbelanger

1267 Posts
Member #: 831
Post Whore

Montreal, Canada

Once the code is published, I'll have a look at it and see if it's easy to convert it to use timer values instead of ADC values for the speed inputs. There aren't any timers available on MS2 but there are on the I/O Extender and it would mean simply connecting the VR sensors and entering the correct scaling.

Jean

http://www.jbperf.com/


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

I've been thinking about this while waiting for the garage to thaw....

On this point alone...

On 17th Feb, 2010 Paul S said:
Now the other think is this 7.8v VCC which is stepped down from a 12v supply. Given that the MS runs at battery voltage which can be as high as 14v, do I need to make further adjustments?
EDIT: Had to break to speak to a client *frown*

.... looking at the datasheet it just seems a crude way of dropping the voltage with a resistor and using a zenner internal to the IC to regulate the voltage. Even the datasheet says the value of resistor is important and there will still be some internal voltage variations anyway. I can't see what's wrong with using a standard, say 9V, T022 voltage regulator chip to feed all the LM2917s.

On the rest, I see they provide example circuits for minimum, average and maximum voltage so considering the back of the car you could use two and wire for maximum so a lifted inside wheel is ignored and on the front use two and wire for average or even just adapt the speedo drive (which is mechanically "average"), either would detect wheelspin.

The real point I don't understand is how this gets to be in the code..... if it's written in C surely the whole code needs re-assembling to include it ???

It's years since I did assembly (back in Uni days) and we wrote in Pascal (not C) and assembled for the x86 (early PC) processers so it would be well beyond my ability. The MS-Extra forum seems to suggest it could be incorporated in the Extra code but it's far from clear how/if/when.

Just random thoughts at the moment.

Schrödinger's cat - so which one am I ???


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

I would be interested to see how you would wire in a 9v regulator.

As you say we could use 3 or 4 wheel sensors without too much hassle.

As far as the code is concerned, it is already written. Patrick has taken the latest 3.0.3r code and added assembler functions for the traction control. The assembler functions are then compiled along with the C based code.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

On 18th Feb, 2010 Paul S said:
I would be interested to see how you would wire in a 9v regulator.

As you say we could use 3 or 4 wheel sensors without too much hassle.

As far as the code is concerned, it is already written. Patrick has taken the latest 3.0.3r code and added assembler functions for the traction control. The assembler functions are then compiled along with the C based code.


The datasheet has to be one of the worst written ones I've ever looked at....
It seems the 2907 series requires a stable Vcc (ie, an external regulator) and the 2917 series relies on an internal zener diode and an external resistor to do the same but the resistor has to be chosen to limit the voltage swings internally. The value of 470 ohms for the external resistor on the 2917 just seems to be the best compromise against voltage swings internally.

Re. the code, without getting pedantic about the difference between assembling and compiling, what we actually use is a single binary file loaded to the MS2 CPU with all the bits previously written/assembled/compiled/etc in the one file.
I'm not familiar with being able to add bits without re-assembling/re-compiling the whole code. I stand to be corrected but I assume it needs a new version of the code to have it included ???

Schrödinger's cat - so which one am I ???


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland


On 18th Feb, 2010 Rod S said:

Re. the code, without getting pedantic about the difference between assembling and compiling, what we actually use is a single binary file loaded to the MS2 CPU with all the bits previously written/assembled/compiled/etc in the one file.
I'm not familiar with being able to add bits without re-assembling/re-compiling the whole code. I stand to be corrected but I assume it needs a new version of the code to have it included ???


Patrick has done all the compiling etc. On the MS thread he has loaded up a zip file that includes the S19 file to download to the MS and the ini file for TS.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


jbelanger

1267 Posts
Member #: 831
Post Whore

Montreal, Canada

On 18th Feb, 2010 Rod S said:
Re. the code, without getting pedantic about the difference between assembling and compiling, what we actually use is a single binary file loaded to the MS2 CPU with all the bits previously written/assembled/compiled/etc in the one file.
I'm not familiar with being able to add bits without re-assembling/re-compiling the whole code. I stand to be corrected but I assume it needs a new version of the code to have it included ???

At this time Patrick is compiling/assembling/linking the code and providing a new binary to be loaded on the MS2. This is based on the 3.0.3r code with his code added. The goal is to have this additional code included in the official one at some point so that it is simply part of the official release (similar to what was done with the siamese code).

And the MS2/Extra code is already a mix of C and assembler code in a bunch of source files and the whole thing is compiled, assembled and linked using the freely available gcc tools. Everything but the gcc tools is provided when you get the zip file to generate the binary s19 file. You simply need to run the make file.

Jean

http://www.jbperf.com/


Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

Would a 7809, 1A Positive Voltage Regulator do the job better?

http://www.maplin.co.uk/module.aspx?moduleno=7937

Would I need any capacitors for extra filtering?

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

Right,

First thanks Paul/Jean (and of course Patrick), I found the modified s19 file on the Extra forum and have loaded it sucessfully along with the ini file to TS and now have a new menu option to play with !!!!

re. the voltage regulation, as I said, the datasheets confuse me - it seems the 2907 requires external regulation but the 2917 relies on its internal zener and an external current limit resistor. So I doubt you can mix/match....
I'll wait for Jean to correct me but it seems to depend on which chip you use.
Patrick has obviously used the 2917 sucessfully with the external resistor so it must work.

My only reservation was this from the data sheet

"USING ZENER REGULATED OPTIONS (LM2917)
For those applications where an output voltage or current
must be obtained independent of supply voltage variations,
the LM2917 is offered. The most important consideration in
choosing a dropping resistor from the unregulated supply to
the device is that the tachometer and op amp circuitry alone
require about 3 mA at the voltage level provided by the
zener. At low supply voltages there must be some current
flowing in the resistor above the 3 mA circuit current to operate
the regulator. As an example, if the raw supply varies
from 9V to 16V, a resistance of 470X will minimize the zener
voltage variation to 160 mV. If the resistance goes under
400X or over 600X the zener variation quickly rises
above 200 mV for the same input variation"

ie, it implies you only use the 2917 if you don't have an externally regulated power supply. So perhaps a (gruop of) 2907 with an external power supply could do the job a bit better ????

Schrödinger's cat - so which one am I ???


Joe C

User Avatar

12307 Posts
Member #: 565
Carlos Fandango

Burnham-on-Crouch, Essex

i pretty mych agree Paul,

the 07 needs external regulation,

the 17 has an internal zenner, and just needs a resistor in the supply line chosen for the supply voltage, in our case about 470 ohm.

i'd use the 17,

On 28th Aug, 2011 Kean said:
At the risk of being sigged...

Joe, do you have a photo of your tool?



http://www.turbominis.co.uk/forums/index.p...9064&lastpost=1

https://joe1977.imgbb.com/



Paul S

User Avatar

8604 Posts
Member #: 573
Formerly Axel

Podland

Well, I'm not actually convinced that the 2917 has an internal zener. They have drawn one in one of the schematics, but I think it is suposed to be external.

Anyway the zeners and the 2917s arrived in the post today so that is how I'll build it.

I'll use the 20uF cap for C1 and 68k res for R1 as discussed above.

As it's snowing again and too cold in the barn for engine building or manifold welding, this will be a nice little project to keep me amused.

Saul Bellow - "A great deal of intelligence can be invested in ignorance when the need for illusion is deep."
Stephen Hawking - "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."

Home > A-Series EFI / Injection > Megasquirt Traction Control
Users viewing this thread: none. (+ 5 Guests)   Next ->
To post messages you must be logged in!
Username: Password:
Page: