Thanks, Michael.

The thing is there are these two symptoms that were confirmed in the GHI forum: “I tried your code with my hardware and I have the same issue. In additional I tried with different hardware (FEZ-Spider) and found the same behaviour. It seems a bug in the driver”.

I tried the gyro module again today in a new scenario and it worked well enough that I could find the Y axis to get my device to react to a door opening. The calibration function seems usable, though I’m still not certain the labels are correct on the PCB. The new example is here: http://wp.me/p1TEdE-nN

]]>Thanks

]]>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

]]>