Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Gyroscope to 3-Axis Gimbal Programming

  1. #1
    Junior Member
    Join Date
    May 2020
    Posts
    19

    Gyroscope to 3-Axis Gimbal Programming

    Greetings Friends,

    I am looking to map the positional readout of a Gyroscope sensor to the position of an object on a 3-Axis gimbal which is controlled by 3 servo motors.

    From a hardware perspective, things are lookin good. I vet datasheets for a living so...

    Now for the crazy task of trying to map the Gyroscope readouts to the servo commands of 3 motors

    I'm not sure where to start. I am an intermediate Arduino coder and know some basic Ras-Pi. I have heard of software for this sort of computation such as Open CV. I know very little about software dev and if possible would want to code in Arduino. I am working with a Teensy 4.1 since there will later be audio incorporated into this project.

    Anybody care to chime in?

    Thank you!!

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    390
    3-axis gyro only and no accelerometer?

  3. #3
    Junior Member
    Join Date
    May 2020
    Posts
    19
    Accelerometer included. Its an MPU9250/6500. Didn't think the rate of change would be necessary since the servos can only update position so often... is there something else I should be considering here?

  4. #4
    Senior Member
    Join Date
    Jul 2020
    Posts
    390
    Quote Originally Posted by siredward View Post
    Accelerometer included. Its an MPU9250/6500. Didn't think the rate of change would be necessary since the servos can only update position so often... is there something else I should be considering here?
    Normally you need a full IMU to capture orientation - just a gyro will drift, just an accelerometer is confused during motion.
    Without a magnetometer you'll still have yaw-drift

    With 6 or 9 DoF you'd normally use an IMU library to maintain the orientation (as a quarternion or a DCM). If you are good at
    3D vector algebra you could roll your own, but its not easy for the non-mathematical, and you really want a feeling for control
    theory too for combining the various sensors.

    Finally you map the orientation into Euler angles specific to the gimbal system. You cannot work internally with Euler angles
    due to gimbal lock-up (and they are even more complicated algebra anyway).

    There a lot of ways to get confused, in particular getting your frames of reference mixed up, or handling Euler angles in the
    wrong order, so it can be quite tricksy.

  5. #5
    Junior Member
    Join Date
    May 2020
    Posts
    19
    Now we're talkin! There is a 9DoF MPU9250 which costs under $10. Same I2C protocol.
    Thank you for the tips.
    And so begins my journey.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •