Getting Started With And Gyr

Most people pick up And Gyr expecting a straightforward interface and then spend the first hour figuring out why their calibration data isn't sticking. The platform itself is competent, but it assumes you already know a few things about sensor fusion before it becomes usable. I'm going to walk through the practical workflow here, including where it tends to break and what to do when it does. If you're looking for the official documentation, the primary entry point is the And Gyr project repository, which hosts the full manual and example projects. Download the latest stable release from their GitHub releases page before diving in, because the API changed significantly between v2 and v3 and older tutorials will mislead you on the sensor initialization step. The core workflow starts with hardware attachment. Connect your gyroscope module through the appropriate interface — most users run into problems here because they plug into a pin header without setting the correct voltage level first. And Gyr supports both 3.3V and 5V tolerant inputs, but the default config assumes 3.3V. If your board outputs 5V on the data lines and you haven't adjusted the config file, you will get noisy readings that look like a firmware bug but are actually just a hardware mismatch. I lost an entire afternoon to this on a custom PCB run before checking the schematic against the default gyr_config.h settings.

Once the hardware is connected, the next step is calibration. Run the built-in calibration routine before your first flight or measurement session. This takes about four minutes on a cold start. The routine measures offset and scale factor error across all three axes. Skipping this step and jumping straight into operation is the single most common mistake I see in the forums. The raw output will drift visibly within thirty seconds if you haven't calibrated. After calibration, you initialize the sensor using the library's setup function. Here's the basic pattern: gyr_init(GYR_MODE_CONTINUOUS, GYR_RANGE_2000_DPS, GYR_OSR_64);

The GYR_RANGE_2000_DPS setting is important to get right early. If you're measuring slow rotational movements and pick the 2000 range, you'll have poor resolution. For general purpose work, 500 DPS gives you the best balance between range and precision. Higher ranges are only useful if you're testing reaction wheels or fast-moving drones. Data retrieval works through blocking and non-blocking read modes. The blocking call is simpler but ties up your main loop. The non-blocking approach with gyr_read_ready() is better for real-time systems. Check the ready flag before attempting a read, or you'll pull stale data and waste cycles. This matters more than it sounds — on a tight control loop, reading stale samples at 200Hz adds noticeable latency to your feedback path. One thing the official documentation doesn't emphasize enough is temperature compensation. The And Gyr sensors have built-in temperature monitoring, and the output drifts roughly 0.02 degrees per second per degree Celsius of ambient change. If your environment stays stable, you can ignore this. If you're working outdoors in variable conditions or in an uncontrolled lab, you should enable the temperature correction routine by calling gyr_temp_comp_enable() during initialization. This adds about 2ms to the startup sequence but keeps your bias stability within spec across normal operating temperatures.

Get the Full Details

Landis Gyr Technology EG6R3S2 Gas Meter Module User Manual Installation Guide Part 2
Landis Gyr Technology EG6R3S2 Gas Meter Module User Manual Installation Guide Part 2

Another detail that trips people up: the anti-aliasing filter. By default, the digital low-pass filter is set to a cutoff that works for most applications, but if your sampling rate is below 100Hz and you have significant high-frequency vibration in your setup, you'll see aliasing artifacts in the angular rate output. Lowering the filter cutoff to match your Nyquist frequency resolves this. Set it explicitly with gyr_filter_set(GYR_FILTER_LP_40HZ) or whatever value matches your actual bandwidth needs.

Common Pitfalls

Memory allocation is one area where beginners stumble. The And Gyr library maintains internal buffers for rolling averages and calibration state. If you're running this on a microcontroller with limited RAM, initializing multiple sensor instances can push you over the edge. Keep the number of active gyro instances to one unless you have a specific reason for more. The library isn't designed for multi-sensor fusion at the driver level — that's meant to happen in your application code using the raw outputs. Another issue is interrupt handling. If you're using the data-ready interrupt pin, make sure your ISR is short. The And Gyr interrupt asserts for a specific window, and a lengthy handler will cause you to miss samples. I had a case where a debug serial print inside the ISR was dropping packets and causing the read buffer to overflow silently. The symptom was intermittent data gaps that looked random but were actually caused by the interrupt timing. The library also includes a built-in self-test function. Use it if your readings look wrong but the hardware seems connected properly. It runs a diagnostic that checks the sensor's internal reference and reports back a pass or fail status. This saved me once when a loose solder joint on a breakout board was mimicking a calibration problem. The self-test caught it before I spent time chasing software fixes.

Advanced Usage

For applications that need higher accuracy, And Gyr supports sensor fusion output through its companion library. This combines gyroscope data with accelerometer input to produce a stabilized orientation estimate. The fusion engine uses a complementary filter by default, which is sufficient for most hobbyist and prosumer applications. If you need something more aggressive, the library can interface with external EKF implementations, though that requires additional configuration outside the base package. Logging raw data for post-processing is straightforward. The library provides a serial output mode that streams raw angular rate data at configurable intervals. I typically log at 500Hz for analysis and drop the live sampling rate to 100Hz during normal operation to conserve processing headroom. You can switch between these modes on the fly without reinitializing the sensor. The And Gyr platform is functional and well-documented once you get past the initial friction. The documentation assumes a level of embedded systems familiarity that new users may not have, so don't feel like you're missing something obvious when the manual skips over basics like voltage levels or interrupt constraints. Those details are there, just scattered across the advanced sections and example projects. Pick the right range setting, calibrate properly, watch your interrupt handlers, and it'll run reliably for years.

Landis Gyr Technologies HUNTSU825 3G S4e Gridstream User Manual 98 9103
Landis Gyr Technologies HUNTSU825 3G S4e Gridstream User Manual 98 9103