RAM/Variables Question

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

Post Reply
Nfsjunkie91
MS/Extra Newbie
Posts: 8
Joined: Sun Jan 12, 2014 9:19 pm

RAM/Variables Question

Post by Nfsjunkie91 »

Hello everyone,

I've been looking to make some "DIY" improvements to the MSExtra code, and I've compiled my own build with some 'fun" little add-ons already. Something that's a big sticking point for me is the idle control. Namely, I am unable to get it to perform to the same level that my original Mercedes computer could handle -- and that computer was from 1987. Anyway, I have all sorts of ideas for how to fix it, but those are not what I'm here to talk about.

It seems to me from the values that MSE uses for the CL idle control that it's an 8-bit integer, so the resolution is basically 100/255 = 0.39%. I can understand using an 8 bit integer in this circumstance to save memory. What I don't understand is that larger numbers are used for the PID gains with resolution of 0.1%, Max Decel Load is 0.1%, in ORFC "Active Above CLT" value is 0.1%... It seems to me that the extra resolution is not necessary and it's taking up a lot of extra space in the micro-controller. It also seems to me that the CL idle PWM would be better served with a 0.1% resolution.

Now, I may have missed something, and these values may be trimmed down when they are burned to the controller, but I don't believe this to be the case; I need to review the code again though. Any input on this?

BTW, this is all working with code 3.3.1. If 3.3.2 changed any of that, then I guess I need to look harder at it.
jsmcortina
Site Admin
Posts: 39613
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: RAM/Variables Question

Post by jsmcortina »

The internal variables are often in higher precision so that rounding or truncation issues with the integer maths do not give a very coarse end result.

The idle PWM duty is used in a software PWM routine that uses an 8 bit value.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Nfsjunkie91
MS/Extra Newbie
Posts: 8
Joined: Sun Jan 12, 2014 9:19 pm

Re: RAM/Variables Question

Post by Nfsjunkie91 »

James,

Thanks for the quick reply. I took a look at the PID code and noticed that there's a lot of math going on with Long values.

Is there any reason I couldn't rework some of the code to get more resolution out of the PWM idle?
jsmcortina
Site Admin
Posts: 39613
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: RAM/Variables Question

Post by jsmcortina »

Nfsjunkie91 wrote:Is there any reason I couldn't rework some of the code to get more resolution out of the PWM idle?
Yes. The 0.128ms timer interrupt isn't quick enough. There may be other ways to implement the software PWM, but that's the current issue.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Post Reply