Expedition vehicle - Auto leveling bed - motor and controller conundrum

As part of a van build project, I am including a system to adjust the height of each bed corner to a perfect level regardless of how the vehicle is parked. Adjustments will be made using lead screws that run the full height of the van walls. The mechanical portion of the design is solid including the necessary tolerances to support up to a 10 degree tilt in 3 dimensions. This is the optimal as the other purpose of the lead screws is to retract the bed into the ceiling when not in use.

My initial thought was for the highest corner to stay fixed and the other 3 to raise until level. This would ensure no chance of running out of travel at the lower level and would be more solid when leveled from completely lowered. It also means the controller does not need to know the height of each corner only the level +/- in relation to the others, so cheaper less smart drive motors can be used.

Rather than design a controller completely from scratch, I'm hoping someone is aware of an existing opensource project that includes a X+Y plane tilt sensor and 4 motor output as a guide. The only ones I have found have related to proximity sensors to a floor (i.e. 3D printing) rather than level to the horizon or use 6 servos with a trapezoidal design.

Any help or suggestions would be greatly appreciated.

 

Additonal information:

- Motors not currently selected, but will likely be standard high torque 12v/24v ~300-600rpm (not stepper motors) - Like a faster window wiper motor.

- Total travel height 1500mm

-The van's electrical system is powered from reclaimed 18650 laptop batteries (5kw @24v) and charged by 600w solar and WIFI equipped (4G)

 

 

Lead Screw

Can you provide a drawing or sketch? If the lead screws are fixed in place an the bed is moving, the distance between the connection points will change. If you just need it to be level, then you might want to consider using a pair of linear actuators, a microcontroller and an accelerometer. The bed would pivot in two axes at the center, and the linear actuators would pivot the table in X and Y. 1.5m is quite a lot of travel though.

I can’t visualize.

I can’t visualize what you mean at all. Sorry!!!