SEEED Gyro problem (or my problem)?

Hello

I’m trying some things with the Hydra and a gyro module (http://www.ghielectronics.com/catalog/product/331), integrating over time to see the attitude angles.
There are two funny things:

  1. It seems X and Z axis are interchanged.
  2. the up-down axis (yaw, marked X, believed to be Z) is showing almost no response as I yaw the module (both other axes are OK).

This is the (pseudo-)code I am using. It’s initial, but it does the trick for testing the module. All variables are doubles:

=====================

            attitudeGyro.rollX = 0;
            attitudeGyro.pitchY = 0;
            attitudeGyro.yawZ = 0;

            gyro.ContinuousMeasurementInterval = new System.TimeSpan(0, 0, 0, 0, 10);
            gyro.Calibrate();
            gyro.MeasurementComplete +=
                new Gyro.MeasurementCompleteEventHandler(gyro_MeasurementComplete);

        void gyro_MeasurementComplete(GTM.Seeed.Gyro sender, GTM.Seeed.Gyro.SensorData sensorData)
        {
            changeGyro.rollX = (sensorData.X + lastGyroAngularVelocity.rollX * 180 / System.Math.PI) / 2 * sender.ContinuousMeasurementInterval.Milliseconds / 1000 * System.Math.PI / 180; // in rad
            changeGyro.pitchY = (sensorData.Y + lastGyroAngularVelocity.pitchY * 180 / System.Math.PI) / 2 * sender.ContinuousMeasurementInterval.Milliseconds / 1000 * System.Math.PI / 180; // in rad
            changeGyro.yawZ = (sensorData.Z + lastGyroAngularVelocity.yawZ * 180 / System.Math.PI) / 2 * sender.ContinuousMeasurementInterval.Milliseconds / 1000 * System.Math.PI / 180; // in rad
            
            lastGyroAngularVelocity.rollX = sensorData.X * System.Math.PI / 180; // in rad/sec
            lastGyroAngularVelocity.pitchY = sensorData.Y * System.Math.PI / 180; // in rad/sec
            lastGyroAngularVelocity.yawZ = sensorData.Z * System.Math.PI / 180; // in rad/sec

            attitudeGyro.rollX += changeGyro.rollX;
            attitudeGyro.pitchY += changeGyro.pitchY;
            attitudeGyro.yawZ = changeGyro.yawZ;

            Debug.Print("Roll X: " + attitudeGyro.rollX * 180 / System.Math.PI + " - Pitch Y: " + attitudeGyro.pitchY * 180 / System.Math.PI + " - Yaw Z: " + attitudeGyro.yawZ * 180 / System.Math.PI);

            }

=====================

Help please: Is the module faulty or am I?

thanks

Please use code tags.

@ Gus - Of course. My bad.
And by the way - thanks for all the help.

Anyone?

Your question require someone to get the board, the sensor, run the test and provide feedback. This doesn’t happen instantly :slight_smile:

Oh!

It seems what I wrote was read as “Get up off your asses and answer me now!”.

I’m sorry. I just wanted to see if this is being looked by someone.

Again, sorry if I was understood as requiring an answer here and now. Any help is appreciated.

Gabriel

Have you looked in the codeshare area to see if there is any code for the Seeed Gyro?

Hi

Yup, but the only thing that I can think is remotely relevant is something I don’t get:

GTM.Seeed.Gyro.Orientation orient = gyro.ReadOrientation();

there is no GTM.Seeed.Gyro.Orientation and no ReadOrientation() method:

http://gadgeteer.codeplex.com/SourceControl/changeset/view/14112#157902

What am I missing?

@ Gabriel3 - I have the same mainboard and the same Gyro. Send the project to me and I can start to test it.

How can I send the project to you? email?

@ Gabriel3 - yes, you can use e-mail Francescointernal@ msn.com

Thanks. One minute.

Hi, did you ever get this sorted out?

Poncho