# Model the gyroscopic effect for 3axes stabilisation

Context

I am trying to stabilise a platform on a guimbal using 3 axes gyroscopes. I have made tons of research (same problem for weeks even months now) without being able to properly model the 3 orthogonal gyroscope actuators (high inertia flywheels).

Question

What is the dynamic model of a 1-axis gyroscope actuator? Can it be used 3 times on different directions (I have a Simulink model) to get a 3-axes one or is it more complex?

From what I have seen, $\boldsymbol{w_{precession}} =\boldsymbol{h_{gyro}}\times \boldsymbol{\tau_{ext}}$ which may or may not be what I'm looking for (experts?) but I don't see the rotation being instantaneously triggered: what's the corresponding torque?

My Simulink plant implements $\boldsymbol{\theta}=\int_0^t\int_0^t\frac{\boldsymbol{\tau_{ext}}}{\boldsymbol{J}}dt²$; and the gravity torque, to counter, is given by $\boldsymbol{\tau_{grav}}=\boldsymbol{r}\times\boldsymbol{W}$ (weight with moment arm centre of guimbal-CG). If this is the right way to go, I could inject the $\omega_{p}$ after the first integration, but what's the associated torque that counters the gravity's?

• You might compare what you are doing with how this Glowscript model was done. (Not running for me on Google Chrome. Runs for me on Firefox.) See the source code here May 12, 2014 at 21:12
• Thanks, but it seems those equations have been derived for that particular setup - If possible I am looking for something I can implement on that 3 axes stabilised platform. May 13, 2014 at 23:34
• Have you accounted for the rotating inertia frame effects. You know the $\omega \times I \omega$ part of the rotational equations of motion? May 14, 2014 at 17:29
• No you're right (thanks for noticing) I didn't model it yet but it shouldn't be the cause of the problem: I am testing it in one axis and it still does not work. May 14, 2014 at 20:07
• Please show your work if you want a resolution from this group. May 16, 2014 at 21:44

Are you asking about the control system or just the gyros? Why are you interested in torque? If you want to apply counter torque with a motor you'll need to transform your motor's torque into an angular rate model to counter the induced rotation. Since you spent months on this it would be helpful to know where you are stuck and what methods you're using and what isn't working. I'll try to briefly cover both in general.

Micro Electrical Mechanical System gyros (MEMS) are not as accurate as high end ring laser gyros. MEMS have measurement errors which when integrated over time will lead to an accumulating error in the calculated orientation. Therefore, MEMS gyroscopes alone cannot provide an absolute measurement of orientation. And correcting for errors in measurement are important.

$\vec{\omega}_{measured}=\vec\omega_b\times\vec\omega_{sfcc}+\vec\omega_{bias}+\vec{Gs}\times\vec\omega_{gs}+\vec{noise}$

Where $\vec\omega_b$ is the body angular rates, $\vec\omega_{sfcc}$ is a 3x3 matrix of scaling factors on the diagonal and misalignment terms in the nondiagonal, $\vec\omega_{bias}$ are the bias values. $\vec{Gs}$ and $\vec\omega_{gs}$ are the gravity-sensitive biases.

If you just want to start by focusing on the gyroscopes, I suggest looking at this model which deals with the complexities of MEMS errors.

For stabilization you have to look at your inertial reference frame. An accelerometer and a magnetometer will measure the earth's gravitational and magnetic fields respectively and so provide an absolute reference of orientation. These devices are subject to high levels of noise; for example, accelerations due to motion will corrupt measured direction of gravity. So to make a Inertial Measurement Unit (IMU) you'll need an algorithm that integrates gyros, accelerometers and a magnetometer for best long term stabilization. Single estimates are made by filtering positional estimates through a kalman filter which reduces the average multiple errors in the various sensors. The kalman estimation also can help reduce gyroscopic bias drift.

All of these devices together including the filtering look like the following block diagram. Sebastian Madgwick developed an IMU and AHRS sensor fusion algorithm. Where $\hat{q}$ represents a quaternion describing the orientation of the earth frame relative to the sensor frame. There are other parts that need some correction. Magnetic distortion needs to be corrected and more importantly gyroscope drift. The gyroscope zero bias will drift over time, with temperature and with motion and there are several different algorithmic choices in the literature to reduce this drift bias.

I suggest you read Madgwicks paper to really understand the dynamic aspects of IMU control. In addition here is his C source code or a Matlab version.

There is also a FreeIMU group dedicated to algorithmic improvements and open source code.

For the Arduino cpu based system there are some simpler tutorials like Bill Premmerlani's and Mahoney's papers.

EDIT

You need some sort of feed back control system to your motor. You don't need to worry about gravity or other forces as long as your motor has enough torque to stabilize movements of the platform. Most systems can be stabilized using a Proportional Integral Derivative (PID) controller: In this drawing the "Process" is your motors responding to the correction voltage and the output are your gyros which should be showing no movement when stable.

Here is a good tutorial on how PID's work and how to optimize the parameters. And a wiki page on tuning the loop. Part of this involves measuring and characterizing your motor's response to voltage inputs so that you can set the PID gains properly for low-jitter and fast corrections.

However without an accelerometer the bias drift of your gyros will over time cause your platform to fall down. And at that you'll need to expand your system to the larger model I illustrated earlier which is very robust, but might be beyond your project's goals/time.

• Thanks, this is a very thorough answer... Though it is on the gyroscopic sensors, whereas I am trying to assess whether gyroscopic actuators (high inertia flywheels) can stabilise the platform. My attitude sensors are for now completely ideal. I've updated the initial post to reflect that along with additional information. May 19, 2014 at 8:55
• @MisterMystère As I mentioned, I would characterize the motor's rotational effect on the body in terms of $\vec\omega$ and make a control loop that minimizes the difference using $\vec\omega_{measured}-\vec\omega_{motors}=0$ May 19, 2014 at 16:52
• You mean the inertias $I_{ii}\omega_p=J_i\omega_m$, don't you? For this I would need to caracterise the gyroscopic effect that the motors inertia has on the platform, which is exactly what that post is about. Or have I misunderstood what you are saying (in which case I apologise but could you clarify)? May 21, 2014 at 21:48
• @MisterMystère Yes, but your post is mostly about the sensors. Your PID type controller will need to know the transfer function between voltage to the motor and rotational velocity of the platform. See this tutorial brettbeauregard.com/blog/2011/04/… May 21, 2014 at 22:34