by quadcam on Fri Feb 05, 2021 1:58 am
As the pressure sensor is in the inflate / deflate line maybe you could inhibit the solenoids and sample the pressure after a suitable time for the pressure to equalise in the line. Then run the control algorithm for a fixed time and then resample, etc. In order to calculate control times between pressure sampling can you ascertain (from some static testing) typical inflation and deflation rates with the solenoids?
Also, as the PDM signals from the dash are inflate or deflate only (and not related to the actual pressure error or solenoid duty cycles), is there any need to use a PID function? I think you could achieve the same inflate / deflate commands with a 3D-Table and some hysteresis in the table values.
To measure the pressure I think you could use cascading timers (where each one finishes and starts the next timer) and a maths channel with a condition. The first time would be a settling timer to allow the pressure to stabilise, the next would be a timer where the pressure reading would be valid and the other would be the inflate deflate timer (which could also be no action if the pressure is in range). The condition for the maths channel would be the reading valid timer value.
Could that work?
Edit: Actually, it could probably be done with one timer where the different validities are unique ranges in the timer period.