Validation Maximum Question

Support forum for users of the M1 Build

Validation Maximum Question

Postby t8fanning on Tue Jul 18, 2023 6:25 am

I'm new to M1 Build, so sorry if this question is basic. I'm trying to significantly increase the time constant for the voltage filter of the fuel tank level sensor. I have an old stock fuel level sensor that has a lot of filtering (~30s) in
the stock circuit and am trying to emulate that.

I've adjusted the voltage filter validation maximum to what I want, but keep getting the following error:

Error 1138: "Validation Maximum" must be <= 10 [s].
The "Validation Maximum" on this object must be <= System Maximum 10 [s].

Where is the System Maximum defined? I can't seem to find it. Is there a reason validation maximums are limited to 10s? Is it because of the event rate?

Thank you for any input.
t8fanning
 
Posts: 10
Joined: Wed Sep 22, 2021 5:00 pm

Re: Validation Maximum Question

Postby David Ferguson on Mon Jul 24, 2023 10:16 am

I think your issue is the object "Fuel Tank Level Sensor" is a pre-built object, and the voltage element under it has a defined Filter maximum of 10s (10000ms which is the base unit). So that is the most you can filter the sensor voltage.

However, the "Fuel Tank Level" object uses the channel "Fuel Tank Level Value", and this is set in the "Fuel Tank Level Update" Scheduled Function. I suggest you added additional filtering using a first order filter like:

Value = Filter.FirstOrder(Sensor, 30.0);

or better yet, make the time constant argument be a parameter called "FilterTimeConstant", so you end up with something like this:

Value = Filter.FirstOrder(Sensor, FilteredTimeConstant);

Note the following comment from the Filter function:
The range of time constants depends on the sample rate of the filter. Recommended time constants fall in the range (1/fs, 1/fs * 100] seconds. There is no upper limit on tc, but calculation accuracy may be reduced for excessively large values.

So you might have the change the timing of the Update Scheduled Function to be 1Second to allow up to 100 second filtering, or use 5hz with a maximum filtering of 20 seconds.
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1362
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California

Re: Validation Maximum Question

Postby t8fanning on Sat Jul 29, 2023 2:20 am

Thanks David! You are an invaluable resource on this forum.

I applied the first order filter with additional input parameter to the update function. It seems to be filtering the signal as expected, but I think I need to do some more signal conditioning as it can still result in some undesired outputs.

Thank you again for your input. It helps a novice like me better understand how to think about M1 Build.
t8fanning
 
Posts: 10
Joined: Wed Sep 22, 2021 5:00 pm


Return to M1 Build

Who is online

Users browsing this forum: No registered users and 10 guests