Self Leveling Deck

I am trying help a friend to get a metal deck to self level. There are 3 points of attachment on the deck.

The first point is in the front. It is connected to a piece of survey equipment that allows you to get an absolute point of level.

The other two point are on the back corner (roughly a triangle shape for attachments)

Essentially what i am looking to do is get the back two rams controlled by the arduino to find a spot as close to level as is feasible.

The back two point are set up so a stepper motor can turn a threaded rod which run them up and down. My initial inclination was for accelerometer, then I looked at gyros, then came IMU's......

What do you all recommend for attempting to get the deck leveled out?

Since this assembly rolls, how would this level be changed if the unit were to be on uneven ground? Would i need another sensor on the actual structure to compare readings and make sure the deck is "square" as well as "level"?

Thanks very much for your advice.

*edit - Thinking more on it.....

If i were to get 3 parallax distance sensor and mount them to the structure of the unit. Each has a "known distance" to the deck itself.

If i we to say the front sensor is showing the deck at 7" then i could just run the stepper motors in the back to correct the rear portion of the deck to make each also 7" distance.....

I don't know. Just spit balling here.

Maybe a pair of accelerometers -- BOSCH BMA180 or the ADXL series? They should give you a "leveling" signal to work with.

As for the rest -- can't help -- as you did not give any dimensions or weights so I don't know the scale of the problem.

What sort of response time do you require. How much overshoot can you tolerate. What weight is the device that you want to level. What size is it etc etc etc

A bit more information on your project would be helpful

Have you considered a simple gimballed device using gravity as the levelling force - seems to work pretty well on ships.

A conductive plumb line with contacts around the bob?

If the platform will be stationary then a single, 3 axis accelerometer is sufficient. If the platform must be leveled while moving then you will need both a 3 axis gyroscope and 3 axis accelerometer.

The deck is essentially the bottom portion of a lawnmower. Picture the piece that holds the blade. Made of 1/8"" steel.

My issue is not how to run it up and down. It's how to get the arduino to sense level. So the weight and all these things should matter very much.

The more i think about it the distance method may be my best way to go. If i mount some parallax sensors on a fixed pint aiming down at the from and use that as a control to make the others sit at the same "height" i should have a deck that is exactly perpendicular to the travel of the vehicle at whatever height i set on the front point.....

Goofballtech: If i mount some parallax sensors on a fixed pint aiming down at the from and use that as a control to make the others sit at the same "height" i should have a deck that is exactly perpendicular to the travel of the vehicle at whatever height i set on the front point.....

Even with an uneven surface? All legs at 8" or whatever is like a table on the ground, it's as level as the ground is....

A picavet won't work?

I'm having trouble imagining your proposed solution, probably because I don't understand what you mean by terms like 'absolute point of level' and 'square as well as level', 'the structure', 'the unit'.

I get that you want the surface of the deck to be horizontal, but I have no idea what you're trying to achieve beyond that. Do you want to achieve this while the deck is moving? If so is it moving sideways, and/or vertically? Does your 'absolute point of level' just give you a point in space that defines the level for the deck, or does it also give you any information about orientation - if so, what information does it give you?

Peter:

Indeed. It can be difficult to envisage solutions when one does not even understand the problem. Precisely the issue I tried to convey in my first post. Now I find out it moves.... Is it animal vegetable or mineral...? ;)

Anyway -- maybe it's type to write up a "Project Document" and post it. Then we can be of more help. Really we will try...

I would use a simple water gauge level using a 2 water flow switch.

I will check for detailed picture if you are interested. This option only required relay, water, water flow swith and tubing. (20$ total if you shop on Ebay).

All these issues are understandable. I have yet to even see this device in person. I was just attempting to get a handle on how i could make something level on a drive-able object.

In order to get a mental image of what we have.....

Picture an old riding lawn mower.... Now the deck of the lawnmower (the thing that houses the blades) is mounted to 3 threaded rods driven by stepper motors for up/down travel.

The forward-most point (the top of the triangle) has a height from a survey grade leveling device. I want to take a measure of earth level on 2 axis (forward/back and side to side)from the deck as a whole and move the rear two points to make the surface of the deck as level as i can.

As i drive the lawnmower around the blades will do their job, when the front point is lowered the error will grow. The rear two points will come down to once again bring the error to 0 for each axis.

This will continue on and on until the overall job is completed.

Right now the job would have to be halted and the rear two points have to be manually adjusted with a bubble level on the deck. As you can imagine this is quite time consuming which is why an automated solution is desired.

Apologies for not posing a more thorough explanation in the OP.

Thanks for the suggestions so far. I have been looking into all options i can.

WillR: Peter:

Indeed. It can be difficult to envisage solutions when one does not even understand the problem. Precisely the issue I tried to convey in my first post. Now I find out it moves.... Is it animal vegetable or mineral...? ;)

Anyway -- maybe it's type to write up a "Project Document" and post it. Then we can be of more help. Really we will try...

WillR

I am thinking of creating a mechanical setup that will be driven by two stepper motors. A more detailed description is as follows: ... A 1 x 1 meter contraption with GPS antenna placed in the middle of the grid placed on top of the tractor roof. Two motors corresponding to the x and y axis are situated at the “back” and “left” of the contraption with x axis pointing to front of vehicle. The tractor will be moving. When the ground is flat, the antenna will remain where it is. When the ground starts going down slope, the down angle will be measured by an accelerometer/gyro and the appropriate math is computed to turn on the “back” motor and pull the antenna towards the back, so the antenna still measures the same pt (arbitrarily set as pt A) as it did when ground was flat. If the ground goes up slope, the reverse will happen relative to antenna movement, but just the same, the objective is to keep the antenna straight on top of point A. Movement will also be similar with regards to vehicle tilting to the left or right. Basically, the mechanical setup looks like an XY milling machine. The math will involve drawing an imaginary line to the ground point that needs to be measured. The maximum tilt angle will be from the straight position to .5m backward or forward, and 0.5m leftward or rightward. It does not have to be 0.5m, but in this case, the 0.5m distance will be graded to correspond to the maximum angle of tilt that the system measures. For example, if the system can accommodate 20? then it will be 0.5m/20?. The only thing I think that needs to be figured out is the dome shape of the mechanical structure so the distance from point of interest will always be constant. Any suggestion how to go about an arduino project to run the mechanical setup. The weight of the antenna is under a kg. Thanks.

So, is it a single point on the front, or is it two; I.e two wheels?

If it's two wheels the surely you could have a left to right incline, so trying to level the rear would result in a chassis twist.

If you actually need to ensure that ride height is equal from to back then two tilt sensors front to back should allow you to do this I'd have though. Rear 1 needs to level with front 1 and rear 2 with front 2.

Front 1 to front 2 could be different altitudes and rear 1 to rear 2.

If you need equal ride height over a particular surface then maybe downwards facing ultrasound distance sensors would work, one on each adjustabme corner? You'd be trying to get them all to read the same as a point of reference. Let's say you had sensors on the front wheels then you could actually have a button for left and right to select the reference and then auto-height the other three from that reference.

I think if you did a diagram showing your 'platform', it's support points and examples of different wrong and right orientations the we could all get a better idea of what you're trying to achieve.

Finding the orientation of a moving platform will be hard. The simple approaches relying on an accelerometer will only work when the platform is stationary. I think you will need to combine data from gyros (to detect short-term changes in the orientation) and accelerometers (to compensate for long-term drift in the gyro output). Getting this to work accurately will be hard. I think your best bet will be to adopt one of the Arduino clones designed for flying drones. This will give you the sensors you need integrated into the board, and the corresponding control software to do the data processing and feedback logic to control the attitude and altitude of your vehicle. In this case the control mechanism will be turning screw jacks rather than changing propeller speeds, so you will still have to design the levelling hardware and the software to drive it, but it seems to me that this is the simple part of the project,

“I think if you did a diagram showing your ‘platform’, it’s support points and examples of different wrong and right orientations the we could all get a better idea of what you’re trying to achieve.”
tack I am attaching an image of the setup but what’s illustrated is just one axis which is as the vehicle moves forward ground slope tilts vehicle to right (but it can easily tilt to the left as well). The other condition not shown is when ground slope makes the vehicle tilt forward (or backward). Thanks for the reply.

GPS antenna tilt problem.jpg

PeterH

Yes your comments on the autopilots is specially relevant. I have access to an arducopter APM1 and relevant shield. Also I agree that the mechanical rig is probably the easiest part of it. The software though is the challenge considering I have next to nill regarding programming. Do you by any chance know of a code that I can plug into the arducopter brain to achieve the balancing act I’m trying to create? The arducopter code is way to convoluted for me to untangle to achieve the balancing act. Thanks.

If you get your hands dirty and dig into the Multiwii code you'll find that it can be used as a camera stabilizer (set the multicopter type as "GIMBAL") for just about any board with a 3 axis accelerometer and gyroscope. As an example, this cheap multicopter board with an ITG3205 and BMA180 should be supported.

http://code.google.com/p/multiwii/

I haven't looked at the Arduplane code for quadrotors, but I'd expect to find that the control algorithm produces demands for pitch, roll, yaw and altitude corrections which are then combined and mixed to produce the control outputs for motors, servos and control surfaces. Since the core code can be used in many different types of vehicle I'd expect to find the combination/mixing logic cleanly separated from the core sensor analysis/feedback algorithms. What you'd need to do is plug in your own code that handles the pitch, roll, yaw and altitude demands using your hardware drivers. Perhaps if you review the code and see how the different vehicle configurations have been implemented, you'll see the parts where your own vehicle-specific code needs to be inserted.

ETA: Chagrin's suggestion about camera stabilisation mode sounds like exactly what you need.

Chagrin and PeterH thanks for the reply ... the APM1 board and the arducopter code turns out to have support for gimbal so I'll explore my options with that.