idle IM_AUTO fixes and development.

It's all about the code!
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: idle IM_AUTO fixes and development.

Post by stefanst »

It may very well be that idle for automatic needs to have the equivalent of 'fast idle valve' to work properly. CL may not be sufficient to deal with the associated problems gracefully.
Since I'm terribly unfamiliar with the automatic transmission on Miatas, is there any information to the ECU that indicates what state we're in? Idle up needs to happen in "R, D, L" and not in "P" and "N". Which kinda sucks, because with P-R-N-D-L we go for idle "Low-High-Low-High-High".
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: idle IM_AUTO fixes and development.

Post by AndreyB »

stefanst wrote:Since I'm terribly unfamiliar with the automatic transmission on Miatas, is there any information to the ECU that indicates what state we're in
Looks like there is maybe one data link wire - http://rusefi.com/wiki/index.php?title=Vehicle:Mazda_Miata_2001#Automatic_Transmission - AL - "Communication with ECU". What's on this wire who knows :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: idle IM_AUTO fixes and development.

Post by stefanst »

There's also 4Z (pnk/blk) and 4AC (vio/grn) which connect ECU and AT module. No idea what they do, but a voltmeter may be of assistance....
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: idle IM_AUTO fixes and development.

Post by kb1gtt »

Can you set the valve manually such that you know what your output should be for each of those conditions? If you average the outputs, you can set that as the offset, then the PID is only dealing with the changes, not the offset.
Welcome to the friendlier side of internet crazy :)
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: idle IM_AUTO fixes and development.

Post by stefanst »

kb1gtt wrote:Can you set the valve manually such that you know what your output should be for each of those conditions? If you average the outputs, you can set that as the offset, then the PID is only dealing with the changes, not the offset.
You're usually going from one settled state to the other state. So your I-term already modified your offset to reflect steady-state in the previous state. In other words: the offset is only ever important once- when you enter CL. After that the I-term takes over.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: idle IM_AUTO fixes and development.

Post by kb1gtt »

Correct, however you have to wait for your I term to wind up or wind down. I suggest considering this approach to tuning PID.

-- Tune P term until stable, pick a P term based on magic and your gut. You may pick something that is just barely stable, or you may pick something that is perhaps 50% of your stable P term. Any how, pick a P term.
-- In your typical state, check how far off you are from your target. Set your offset to compensate for this, such that your output is dead on, AKA I value = 0.
-- Add a load or change the systems such that you are at an extreme condition, then increase your I term until the I pulls you back down to 0 error.
-- Check dynamic issues with large offset / step responses. Use D term to minimize ringing and increase stability.
-- Write down your results, then start over with a different P term. Keep doing this process until you have terms you are happy with.

By using the I term like this you avoid the need to wind up and wind down your I term. Also adding a band around your target helps. Such that if you are outside this band, the I term is automatically put at 0. You only use the I value when you are close-ish to your target. Basically if your P value is 100%, then your I value should be 0.
Welcome to the friendlier side of internet crazy :)
Rhinoman
contributor
contributor
Posts: 256
Joined: Thu Sep 24, 2015 2:14 pm
Location: Wiltshire, UK

Re: idle IM_AUTO fixes and development.

Post by Rhinoman »

Which transform are you using to move from continuous time to discrete time?
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: idle IM_AUTO fixes and development.

Post by kb1gtt »

We are not dealing very well with Z vs S domain. The digitizing noise could cause problems, or induce errors. For now we generally have over sampling such that the Z is very close to the S, this keeps the errors induced by Z domain minimal. We should be far from Nyquist. There is room for improvements of the Z domain black magic math. For now the induced errors seem to be small enough that they are negligible.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: idle IM_AUTO fixes and development.

Post by AndreyB »

Attachments
screenshot.png
screenshot.png (105.41 KiB) Viewed 10173 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: idle IM_AUTO fixes and development.

Post by kb1gtt »

which debug fields did you use?
http://rusefi.com/wiki/index.php?title=Manual:Debug_fields

I was looking to rename them in the log file, such that they display what they are in the log viewer, but I see several different options. I think you used something close to alternator debug values, but I don't know what you used.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: idle IM_AUTO fixes and development.

Post by AndreyB »

Just added more info for "IDLE" mode which was used here http://rusefi.com/wiki/index.php?title=Manual:Debug_fields with a small correction

"Idle Air Valve" is in the logs as a named field.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: idle IM_AUTO fixes and development.

Post by AndreyB »

Attachments
Zomorrodi_Shahrokhi_PID_Tunning_Comparison.pdf
(3.16 MiB) Downloaded 254 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: idle IM_AUTO fixes and development.

Post by AndreyB »

MS logs have better debug field names now, todo: use same better debug names in rusEfi and console logs.

@ has stopped by and we were able to get some pretty usable idle PID values!

At first we have assumed that period 10pm/100Hz is too fast, we've (wrongly) assumed that changes do not happen so quickly so we've spend some time trying to tune with period=200ms/freq=5Hz. Well, that' was wrong - period of 10ms or 50ms works better, you see much less oscillation with the same P parameter (I=D=0).

Tune session https://svn.code.sf.net/p/rusefi/code/misc/logs/2003_mazda_miata/20170723_12.41.35_idle_pid_tune_in_progress.msl.7z
End result & ride around the block log https://svn.code.sf.net/p/rusefi/code/misc/logs/2003_mazda_miata/20170723_great_idle_pid_tune_and_ride.7z

Even with offset of 0 things are pretty nice!

Next steps: period auto-tune, PID parameters auto-tune like for instance in https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/temperature.cpp#L222
Attachments
screenshot2.png
screenshot2.png (59.62 KiB) Viewed 10148 times
screenshot.png
screenshot.png (93.57 KiB) Viewed 10148 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Abricos
contributor
contributor
Posts: 849
Joined: Mon Aug 18, 2014 12:32 am
Location: Carteret, NJ 07008

Re: idle IM_AUTO fixes and development.

Post by Abricos »

You want use marlin 3d printer firmware ...:))))
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: idle IM_AUTO fixes and development.

Post by stefanst »

Does anybody have any ideas/input on the subject of control-loop frequency tuning?

My basic idea is that there is no point in running the control-loop faster than the process we're controlling can react. So any process with a lag-time, we don't need to run it more often than the lag-time would prescribe. For example CL control of exhaust O2: Depending on engine-load, it takes the exhaust gases from the combustion a certain time to make it to the O2 sensor. The sensor itself also has a small, inherent lag-time. It doesn't make any sense to run the algorithm again until the results of our changes made had a chance to actually propagate to the point of measurement.

Are there any papers/advice on this subject out there in the data-ocean of the internet that deals with this subject? Any advice?
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: idle IM_AUTO fixes and development.

Post by AndreyB »

stefanst wrote:Does anybody have any ideas/input on the subject of control-loop frequency tuning?
Let's continue in http://rusefi.com/forum/viewtopic.php?f=5&t=1256
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply