gemellocattivo.com

Which means "Evil Twin". Lets see your projects where you change boring into fun or create the fun from scratch.
It is currently Mon Nov 19, 2018 5:51 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Traction Control
PostPosted: Fri Dec 16, 2016 8:12 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 122
mk e wrote:
apalrd wrote:
I would play with it in EL but my main computer is a Mac.

is that even allowed for anyone calling himself an engineer? :D


MATLAB/Simulink and NX both run fine, that's the majority of what I need.


mk e wrote:
It a power generated minus power used. The power used is friction and pumping losses which are based on the BMEP formula... times 2 because it didn't seen enough...so it's a bit of a guess. The flow is based on TPS and available flow area, and some tables to convert to MAF and then MAF to MAP...which feeds the pumping losses.

Right now the throttle stay open until it hits the limit (as you want on a performance setup) but then simply can't react quickly enough to close it so it hits the hard stop and bounces the throttle closed in 4-6 bounces. I may do something to prime the PID so when it hit the soft limit it slams the throttle shut. It works with a less violent input, but WOT in neutral with a powerful engine....it bounce a bit playing catch up.


For the rev limiter, hitting redline in WOT in neutral will require almost no throttle to maintain RPM. If you have a very strong derivative term, it should detect this and request a very large negative throttle if the error rapidly approaches zero. If you are far away from the target, the proportional term will also request a very large positive throttle (to bring RPM up to target), so they will cancel and you'll end up with nothing. But as error becomes smaller, the proportional term will fight much less and the derivative will become huge. You could also use a table for P/I/D gains from RPM error to decrease the D and I at low RPM, and increase the P and I at high RPM.


Another option is an algorithm called 'take back half'. Here, you store a state variable 'h' and calculate error 'e' (setpoint - actual). The output 'o' from the block (the throttle position maximum from 0 to 1) is equal to o = h + integrate(e * k). Every time e changes sign, average h and o and set this as the new h. h will eventually get closer and closer to the TPS required to hold RPM, so the k term is less necessary every time it oscillates.

Edit: I didn't explain it very well. There are two variables stored between loops, h and o. e is calculated each loop. o = o + e * k. If e changes sign, then h = (h + o) /2 and o is reset to h.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Fri Dec 16, 2016 9:58 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 2241
I'm just messing with you on the mac...I know at least 1 engineer who has one ;)


I didn't use any D....it made it unstable. The problem is time. You want the hard stop pretty close to the soft stop and even a hard fuel/spark cut allows a little over-shoot so a soft stop allows more and there is no way around it. The last F1 race I watched (its been a couple years since russia invaded Crimea and Bernie help the F1 race just 600 miles away) you could hear the traction control kicking in.....so it was a fuel and or spark cut...because that reacts FAST

I think the plan should be much like I did. Set the hard stop with fuel/spark but allow the throttle to control the milder stuff. We need to get you set up with EL so we can share stuff.....does VMware offer anything that might work?


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Fri Dec 16, 2016 10:29 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 122
I can use my older Windows laptop, if I need to.

For PID tuning, the derivative is the hardest to tune, but a very large derivative sometimes is sometimes very useful with high inertia systems.

I tried to find the site I used in the past, but it looks like it's offline now. Thankfully the wayback machine has it:
http://web.archive.org/web/201511152332 ... gClassical

To tune it (on the simulator), you would need to set it for proportional only and make it oscillate evenly, then measure the time period of oscillations and the gain that it oscillates at (the 'ultimate gain').

I would make the output of the calculations be subtracted from 100%, and then use that number to limit the maximum throttle request.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Sat Dec 17, 2016 2:50 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 2241
apalrd wrote:
I can use my older Windows laptop, if I need to.

For PID tuning, the derivative is the hardest to tune, but a very large derivative sometimes is sometimes very useful with high inertia systems.

I tried to find the site I used in the past, but it looks like it's offline now. Thankfully the wayback machine has it:
http://web.archive.org/web/201511152332 ... gClassical

To tune it (on the simulator), you would need to set it for proportional only and make it oscillate evenly, then measure the time period of oscillations and the gain that it oscillates at (the 'ultimate gain').


I'll give that a try. What I normally do is
p up until oscillation then p/2
I up until oscillation then I/2
see if D helps....about I x 0.1 is about it usually

With idle(on the simulator) there is no P where oscillation stops, I need to add some I which I guess is a clue its a bit unstable.


apalrd wrote:
I would make the output of the calculations be subtracted from 100%, and then use that number to limit the maximum throttle request.


That is basically what I did. I create a factor that is 0-1 and multiple times the user request....so you get 0-100% of user request.


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Sat Dec 17, 2016 7:29 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 122
The P/I/D you end up with varies a lot by system. Sometimes adding a lot more D than you would expect helps.

In one particular system I ended up with P=1, I=0.1, and D=5. I never got anything near that high magnitude for D on my own.


I think you will want your traction control to output an absolute value, not a % of the user request, since the user request will be changing a lot during a slip event, and this would change the output of the control loop. I would output an 0-1 and then take the MIN of the traction control and pedal commanded throttle.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Sun Dec 18, 2016 10:05 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 2241
I'm torn on the best way to apply the control. I agree that ignoring what the driver is doing with the pedal (until its below the slip control point) will hold it at the limit better.....but I was thinking giving the driver some kind of feed back might be good so if its already slipping and the driver slams the pedal it will slip more monetarily....but may that will just bugger the controller.


hmmmmmmmmm.............


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Sun Dec 18, 2016 4:27 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 2241
Ok, i thought about it....you're right, it should be independent of the driver, as long as its never beyond the driver request.


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Sun Dec 18, 2016 11:25 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 122
You could make the slip ratio target driver selectable (possibly through some wet/dry or on/off road map switch/dial and interpolating/switching between two slip maps). Different surface conditions can have different optimal slip ratios (especially loose surfaces like gravel, loose dirt, loose snow).

Computers are really good at holding the a predefined target on their own. Try driving a modern SUV through a low-mu condition and watch it yaw slightly and then hold a precise drift on its own. If you can calculate what the limit is, the computer can hold it perfectly. A modern TCS system would usually be handled by the ABS/ESP module, which usually runs some sort of vehicle dynamics model considering the vehicle mass/CG, load transfer, accel/gyro data, and tries to estimate mu on each tire to control target slip limits in accel and braking (TCS and ABS), as well as matching the yaw to the driver requests (steering wheel angle) by braking individual wheels. Most systems are tuned for (bad) road drivers, but a system mapped for racing should be faster than a driver with no assistance.

I've become very well acquainted with how the traction control works in my Abarth this past week, with all of the snow around here. I also learned where the tow points are (there aren't any).

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Mon Dec 19, 2016 11:28 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 2241
I think I have something that works pretty well on the rev limiter.

I added a mph based Throttle position to seed the PID so it knows about where it will need to be.....it seems pretty good. There is still a little over-shoot in the unloaded simulationand it hits the hard stop but only once and and only when the driver comand is very big so the throttle just can't close that fast.

I'm guessing TC is going to want to be similar

Also Itried the Zieger-Nichols PID setting in the lionk you posted...they do work well


Top
 Profile Send private message  
 
 Post subject: Re: Traction Control
PostPosted: Mon Dec 19, 2016 2:06 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 122
I found a number of sites with different Ziegler-Nichols constants. The ones at the UMich site worked the best for me.

In terms of physics, the control loop is trying to determine the mu of the surface. Once the mu is known, the tire load can be calculated from static mass * CG rear bias + load transfer mass (calculated from longitudinal acceleration and CG height). Then the tractive load can be calculated, from which the engine torque at slip can be calculated from the gear ratio, axle ratio, and tire size.

So an ideal feed-forward would account for the change in maximum torque with respect to engine RPM (and remember that the throttle blade angle is not linear to torque and this nonlinearity changes with RPM), the gear ratio (which changes the engine output above), and maybe a guess of the mu, and the control loop would handle the mu differences and any other feed-forward errors.

A best guess cal could be something like a curve of base TPS vs RPM for and a % of that curve based on gear ratio or gear number. Higher gears would probably set the number really high (it would be clipped to 100% before being used as a seed), and lower gears would set much lower numbers.

Linearizing load to TPS would be a good thing. This would probably be a table of (RPM, Load) -> TPS where Load is a fraction of 100% torque at that RPM. It might be possible to calculate this with physics if you know the WOT VE.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group