Jarvo90
Hi,

I've had an ICD display for a while now with your standard setup in it. However I would now like to look at playing around with it a bit in terms of some strategies, light patterns etc using math.

I understand how most of the math works, the "choose" function is essentially an "if" statement etc. The alt + space really helps to make sure the syntax is correct as well!!

The thing I'm struggling a bit to get my head around is the registers. Do you have an example channel with registers that you can walk me through?
Quote 0 0
AlastairF
Hi,
Registers are powerful additions to math channels and basically they allow local variables to be stored in the math channel. Registers use a syntax that is similar to programming and so will be easier to grasp for some. Crucially Pi Toolset and Pi Toolbox use virtually the same maths and so if you can calculate something in Toolbox then almost certainly you can calculate the same thing in Toolset.

Performing this calculation in real time is done for a few reasons, some obvious like if you want to put the calculation on the dash, but some others use the real time calculation so the end users always get the same answer and you dont have to distribute math channels to everyone.

Some examples of registers in math channels;
  • Lap by lap averages - for example of wheel lock time or distance,endurance racing may want
    to alert the driver when their lock distance starts getting too long, and maybe an indication of tiredness or tyre wear. Other lap by lap averages could be suspension load, steering offset, oil pressure, fuel pressure etc
  • Counters - to see how many times a threshold has been exceeded and for how long, boost or other performance parameters. For example if an oil pressure has spiked for too many times in a short time duration then show an alarm.
  • To provide a filter to a channel or sensor. For example the light dependant resistor built into the ICD benefits from a low pass filter that is defined using registers. Other uses may be noisy level sensors or channels that require exact filters constructing - all possible by the end user with register math channels.
This is a user guide to give you some examples of math channels and goes into the small differences in syntax between Pi Toolset and Pi Toolbox.
http://www.cosworth.com/media/457808/registers_in_math_channels.pdf

This is an older guide to give you some different examples of register based math channels;
http://www.cosworth.com/media/458171/registers_and_math_operators.doc

Quote 0 0
Jarvo90
Hi Alastair,

Thank you very much for your reply, the pdf is really useful and helped a lot.

It was the difference between between the a1 and @a1 that I was stumbling on.

It's interesting that Toolset uses the same maths a Toolbox. I guess that means I can effectively test out strategies in Toolbox with historic data to test them and look for any bugs or scenarios I haven't thought of?
Quote 0 0
AlastairF
Hi,
In almost all cases you should be able to use historical data to test and refine the math definitions - I do this all the time. However, there are a couple of points to be aware of, most of them revolve around Toolbox using data either side of the calculation point whereas the car will clearly be unable to do this.

Interpolation
When presented with different sample rates Toolbox will try and do the best calculation using interpolation between points. So if for example there is a slow temperature channel but an air density math channel wants to use this channel in faster calculation - then Toolbox will interpolate the air temperature data. Probably not a dramatic effect because temperature could be a slow moving channel anyway, but if there is a faster moving channel that is at a slower sample rate then it may become a factor.

Bitfields
Another interpolation gotcha - if for example there is a slow logic channel returning a 0 or 1 but a math channel wants to use this channel in faster calculation - then Toolbox will interpolate the result. Once you know this effect then you can feed the math channel with a correct sample and hold type data defined in a separate math channel.

Filters
Nested math channels could be hiding a filter somewhere in the definitions , a moving average filter will use samples from ahead and behind the sample point. This clearly will show a different answer to a real time calculation which has access to historical data only.
Quote 0 0
rimperial
Is it possible to re-upload that the Registers in Math Channels and the Registers and Math Operators pdfs?
Quote 0 0
rvmorrow
Hi,

Please find these documents attached

Rob

Cosworth Support
Cosworth Electronics 

 

Quote 0 0
rimperial
Thanks Rob!!
Quote 0 0