Hi, trying to figure out a way that i could possibly hold the max value displayed on a bar gauge for a set period of time. Specific usage would be for a brake bias value. I can see a scenario where I may not be able to pay attention mid race to the value displayed immediately, having it hold for maybe 5 sec would give you the chance to get through the corner, then adjust bias after. I’m guessing it will have something to with a timer and a max number channel, but i dont have an ADU that i can test this on, so i am going round in circles at the moment. Thanks.
You can do this using numbers and functions in the project tree. In the attachment, you can find an example project.
brakeBiasHoldMaxVal.adu (7.0 KB)
Thanks. That will take me some time to get my head around.
I assume i will need 108 for it to work?
For this specific example, yes, since I used the Rate of Change operation (introduced in version 108), but it’s not the only possible implementation of this functionality. You can achieve it in another way using older software versions.
What would be another way? And would you mind explaining the logic and steps behind the implementation on the example file? Thanks
I have removed a few unnecessary elements from the previous example to use fewer operations.
brakeBiasHoldMaxVal2.adu (7.1 KB)
The logic of finalBrakeBias works like this:
Brake bias is calculated from front and rear brake pressure channels (fakePressureFront and fakePressureRear).
ADU creates n_BrakeBiasRateOfChange, which shows how fast this bias is moving.
f_showMaxBB becomes true when the bias is decreasing (rate < 0). It also has a delay false 5s option. This means that even if the pressures stop changing, the signal stays true for 5 more seconds.
While f_showMaxBB is true, n_finalBrakeBias shows the stored maximum bias value (n_maxBrakeBias).
When the 5 seconds pass, f_showMaxBB becomes false. Then f_showCurrentBB goes true (because it is defined as not f_showMaxBB”). On this rising edge, the stored maximum is reset, so a new maximum can be captured next time.
When the front/rear pressure ratio makes the bias smaller, the system latches the maximum value and keeps showing it for 5 seconds. After that, it switches back to the normal, current brake bias.
That is why in the log you see finalBrakeBias “frozen” for about 5 seconds after the last change in the negative direction. It is because of the delay false option holding the signal.
You can also implement this without using rateOfChange. Just compare the current brake bias (from front and rear pressure) with the previous sample. If the value is different, the bias is moving.
When the bias decreases, store the maximum and display it.
With the function delay false 5s, you can keep this maximum for 5 seconds after the last movement.
After that time, the system goes back to showing the live brake bias.