Does anyone know how to configure APM to use infinite servos with camera stabilization? I have the photoshipone 2x gimbal.

Views: 5490

Reply to This

Replies to This Discussion

I think that this is impossible because the code has no way of knowing the current position of the servo.

Does it have optical encoders? Or how does it get the position data?

I have a 360 modded servo setup that uses the guts from two servos, one is used for the motor/gears the other is used for the potentiometer. they are geared together so I get 720degrees out of standard servo signals. its not really that hard, but if you mess up like i did it costs you a couple servos.


Have you a picture how to do?

I'm wondering this as well.  I've got THESE installed in a pan tilt gimbal, but i'm not sure how to set them up.  Or if you even can.

Has anyone had luck with this?

You need regular servos.

Can these servos be used for joystick control?

If you're using some external rotary encoders, like the AS5040 magnetic encoder, and are using an Arduino or similar board to control a motor driver, maybe use the arduino map function to convert the pulse output from the APM for tilt or pan to a value in degrees at which you want to point the camera, then feed that into the controller for the servo/encoder. There is an excellent PID library for arduino that I've used for this very issue.

In the setup below I'm using a Baby Orangutan B-328 from, which has an ATmega328 and a dual channel motor driver that can push 1 amp, and is compatible with most arduino code. I cut the gears on the servo to allow continuous rotation, and removed all the electronics, setting it up as a basic gear motor. The magnetic encoder is on a board from Mad Scientist Hut.

Turns out the solution was quite simple. I just checked new code into master that will allow users to specify if they are using 360 (continuous) servos. Currently the code uses the angular output from the AHRS solution to compute a corresponding PWM "position" for the servo. This works with regular servos where PWM = position, but with 360 servos PWM = speed of rotation. The solution was to use the output of the gyros (rate of rotation) from the AHRS rather than the angle. This way we know how fast the angle is changing instead of the actual angle. This is then multiplied by the proportional gain and transformed into the PWM signal. I did several tests today with my photoshipone gimbal (Spektrum H6040 servos) and it worked perfectly! This should be available in the next release and I will add documentation to the wiki when the code rolls out to everyone.

Great! There will of course be some drift over time that the user must correct, but it is the best solution you can get on continuous rotation servos without using encoders.

Yeah! I smacked my forehead when I realized how simple it was. It was a "DUH!" moment. The drift should, in theory, be accounted for already. I am using the drift-corrected gyro vector.

Sorry Adam but your changes got accidently removed.

Can you add them again to AP_Mount.cpp ?



Reply to Discussion


© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service