Pan/Tilt/Roll - Self-Leveling

First off, I’m new to this stuff, but have three component projects in the works to a large project. Not an electronics background, but plenty of years in software development, queuing, async tasks, background tasks, etc. Anyway, let’s see if I can explain my self-leveling objective. Plenty of searching and videos, but they don’t seem to express my objective.

The platform will be slow moving as say on an ATV, at a crawl. I’ll call it the chip for now, starting with the chip level at the base the 3 XYZ-servos would be at X=90, Y=90, and Z=90 with an action cam riding on top, which I’ll call home. As the base rolls over the ground creating changes in XYZ, adjust need to be made to the servos to keep in its original home orientation to the world. The intent is to keep a steady camera view.

I do have other features I want to add, but for now I want to establish the component foundation.

I’ve attempted to review the following boards: SEN-11486; SEN-10724; SEN-12636; and LSM9050? Not sure which would be the preferred or suggested direction, including education.

Regards

Al

Thanks to Sparkfun support I got the ADXL345 function just displaying XYZ, but having a challenge with the return values to translate to adjustments to the servos.

This application note describes how to measure tilt angles using an accelerometer: http://cache.freescale.com/files/sensor … pdf?fpsp=1

Google “feedback control theory”

fordbuff39:
Thanks to Sparkfun support I got the ADXL345 function just displaying XYZ, but having a challenge with the return values to translate to adjustments to the servos.

The XYZ values from the ADXL345 are not really all that useful on a moving platform. As it is linear acceleration, the gravity vector which normally points down to the earth, gets skewed by any acceleration of the rover-platform as it crawls over any rocks or whatever. Depending on the location of the 9DOF sensor, it could introduce added accelerations when the servo gimbal is rotated on it’s various axes. With compound rotations, on extended arms this gets tricky to solve. Make sure you brush up on mechanics, motion dynamics, trigonometry and perhaps matrix multiplications.

Instead, the ITG-3200 MEMS gyro chip values would be more useful as an initial setup. It generates rotational speed values, which you intend to keep at or very close to 0 (if fixed to the camera board) for a steady cam solution. First you need to calibrate them, so it really reads 0,0,0 when the sensor is motionless. Then comes the task of figuring out which servo to move to null any non-zero gyro axis. This is complicated as rotations of servos further down the arm (as seen from the sensor) influence the rotations of servos closer on the arm.

Reseach robot kinematics:

https://en.wikibooks.org/wiki/Robotics_ … rientation

Yet another option is the Bosch BNO055 absolute orientation chip, available on a breakout board from Adafruit. It has 9DOF sensors and can provide Euler angles (yaw, tilt and pitch). https://learn.adafruit.com/adafruit-bno … r/overview

I’ve been experimenting with it lately and it seems very stable. However, the sensor calibration is automatic, not explained in the documentation and is also rather poor (axial offsets only). Nevertheless, it does resolve object orientation to 1 degree in what appears to be a highly repeatable fashion.

If you want pan/tilt/roll, why reinvent the wheel? Buy an ALEXMOS board and be done with it.