OVVE / software-controller

Software for the Arduino Mega
Other
2 stars 7 forks source link

new ADC handling #41

Closed jast1982 closed 4 years ago

jast1982 commented 4 years ago

non-blocking ADC with /128 divider for less noise synchronous reading of analog sensors from sensors.cpp removed timer from hal/sensor/sensor.cpp added bias compensation at startup for the flow sensor changed sampling period to 5ms increased flow sensor integrator resolution and used correct timing measurement for integration changed timer handling in sensors and control to ensure correct sampling rate debugged controller as far as possible. All seems to run fine here deactivated control loop during breathing out cycle flow sensor loop runs at 200Hz now -> faster integration and now sync issues with the controller fixed 'target reached' detection is based on end of trajectory planning now.

jast1982 commented 4 years ago

Most of this is tested as far as I could with limited hardware setup. I didn't use the UI extensively, but I was able to connect and start the breathing cycles. Parameter setting didn't work as I expected it, but who knows if I have the correct UI version. The protocol version says 2 in the controller code and 1 in the UI code, so there is something strange for sure.

ADC, Bias estimation, Flow sensor integration and mid-level controller was tested with potentiometers instead of sensors and worked nicely.

mrrosen commented 4 years ago

These changes have made it into develop-fsm