Auto level control for linear actuator

This wheelchair I'm making I made a seat that's hinged at the back and a single 12vdc linear actuator at the front to alter the angle of the seat. I fitted a rocker switch to drive the actuator to lift/lower the front of the seat. So going down hill my chair slopes down but now I can lift the seat so I stay level, or the opposite for uphill. Trying now to make it automatic so my seat is always level going up or downhill. Done a couple of simple mercury switches as level sensors to trip a solenoid switch to operate the actuator which basically does work very well keeping the seat level on any slope when I'm not moving, Problem is when I push the chair to move or brake to slow down it also triggers these level sensors due the the mercury moving so the seat is constantly going up and down when I'm moving. Does anyone by any chance have ideas on what would help keep the seat level but not triggered by forward/backward movement? I'm a mechanic built my own wheelchair but as a sparky my knowledge is very limited. Any help or advice would be very much appreciated.

One option is to use a 3d accelerometer to measure tilt angles, but it will have exactly the same problem of "level" being confused by forward & backward motion, and bumps.

However, if you are a decent programmer, then with good data filtering and averaging, that approach can certainly be made to work well.

1 Like

How good a programmer are you?

This repo does that with an MPU6050 and a DC motor/linear actuator
GitHub - cedarlakeinstruments/StablePlatform. The 6050 is used in the Kalman filter mode, so it integrates accelerometer and gyro to get a better estimate of pose.

No support offered. Wrote the code long ago and I don't remember all that it does, but it will keep a platform level in one axis as the base is moved around.

1 Like