CMPS09 - Tilt Compensated Compass Module

Similar documents
CMPS11 - Tilt Compensated Compass Module

RB-Dev-03 Devantech CMPS03 Magnetic Compass Module

USART Digital Compass Manual

Devantech Magnetic Compass on I2C

Modern Robotics Inc. Sensor Documentation

Communications message formats

BW-IMU200 Serials. Low-cost Inertial Measurement Unit. Technical Manual

Parameter Value Unit Notes

Know your energy. Modbus Register Map EB etactica Power Bar

The rangefinder can be configured using an I2C machine interface. Settings control the

BW-VG525 Serials. High Precision CAN bus Dynamic Inclination Sensor. Technical Manual

Attitude and Heading Reference Systems

ROTRONIC HygroClip Digital Input / Output

AHRS400 Series User s Manual

Accelerometer user manual

SOLAR-360 : 360 Inclinometer, RS232 or RS485 Output

SOLAR-2 : Dual Axis Inclinometer, RS232 or RS485 Output

Digiflight II SERIES AUTOPILOTS

Know your energy. Modbus Register Map EM etactica Power Meter

Serial Servo Controller

9DoF Sensor Stick Hookup Guide

Specifications Attitude and Heading Specifications. GP9 GPS-Aided AHRS Datasheet, Revision 1.3

SP-6 magnetometer. User manual. Installation and in-flight calibration

P2-AHU Manual v1.0. P2-AHU Manual. (T-Module) - 1 -

Project Final Report: Directional Remote Control

Magnetic Sensors Frequently Asked Questions

Features. Description. General Specifications. VS Series Inclinometer : Dual Axis, RS232 and Analogue Output

UNSTAR 传感与控制 TEL: FAX: szss AHRS300 Series User s Manual AHRS300CA- (DMU-AHRS) Revision 1.5

2F. No.25, Industry E. 9 th Rd., Science-Based Industrial Park, Hsinchu, Taiwan Application Note of OGM220, AN001 V1.8

HG1120 INERTIAL MEASUREMENT UNIT (IMU) Installation and Interface Manual

SPECIFICATIONS. DCM302B-High Accuracy 3D Electronic Compass(2D Calibration) Item No.:DCM302B

MGA103 Single Axis MEMS Gyro with Triaxial Accelerometer

Supported Servos Any servo motors with "1500 us neutral" specifications. The common brands available for this spec are: Hitec, Futaba.

Debugging a Boundary-Scan I 2 C Script Test with the BusPro - I and I2C Exerciser Software: A Case Study

Multi-channel DC power digital isolation transducer manual CE-AD81-34MN3-0.5

Trademarks & Copyright

Device manual Inclination sensor 2 axes JN /00 04/2015

Mercury technical manual

ASCII Programmer s Guide

MG100 Single Axis MEMS Gyro

Copley ASCII Interface Programmer s Guide

UM7 DATASHEET INTRODUCTION FEATURES. Rev. 1.3 Released 10/27/2014

DMM Technology Corp. DYN AC Servo Drive Modbus RTU Specification [DYNMB1-BL A ] Document Version 1.0A Published Sept 17, 2017

Signal Isolators & Conditioners

User manual. Inclinometer with Analog-RS232-Interface IK360

BV4112. Serial Micro stepping Motor Controller. Product specification. Dec V0.a. ByVac Page 1 of 18

MGS1600. Precision Magnetic Track Following Sensor. Preliminary - Subject to Change

Pi Servo Hat Hookup Guide

Digiflight II SERIES AUTOPILOTS

Modbus communication module for TCX2: AEX-MOD

General Description. The TETRIX MAX Servo Motor Expansion Controller features the following:

DMM Technology Corp. DYN AC Servo Drive CAN Specification [DYNCAN1-BL314-12A] Document Version 1.2A Published March 20, 2018

Carbon Dioxide (Tiny CO2) Gas Sensor. Rev TG400 User Manual

Operating Handbook For FD PILOT SERIES AUTOPILOTS

IMU60 Inertial Measurement Unit

G3P-R232. User Manual. Release. 2.06

Qik 2s12v10 User's Guide

OS3D-FG MINIATURE ATTITUDE & HEADING REFERENCE SYSTEM MINIATURE 3D ORIENTATION SENSOR OS3D-P. Datasheet Rev OS3D-FG Datasheet rev. 2.

Qik 2s12v10 User's Guide

MD04-24Volt 20Amp H Bridge Motor Drive

BLE 4.0 Module ZBModule User Manual 1 / 15

CDR-915 Data Radio Module INTEGRATOR S GUIDE

Tire Temperature and Pressure Monitoring System - Datasheet

Electronic Compass Sensors Rev. 1.1 Jan. 2002

INCLINOMETER RS232 SWITCH

TLE5014 Programmer. About this document. Application Note

Ocean Controls KT-5221 Modbus IO Module

Master Thesis Presentation Future Electric Vehicle on Lego By Karan Savant. Guide: Dr. Kai Huang

METERSUK. SmartLink D Y N A M i T E. EM415 MOD Series. User Manual KEY FEATURES INDEX 3. TECHNICAL DESCRIPTION. Single Phase Metering

Configuration of CPE 310-S and CPE 311-S transmitters by keypad

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

Product Specification for model TT Transducer Tester Rev. B

PalmGauss SC PGSC-5G. Instruction Manual

Special Sensor Report: CMUcam Vision Board

X3M. Multi-Axis Absolute MEMS Inclinometer Page 1 of 13. Description. Software. Mechanical Drawing. Features

Multi-Sensor Integration and Fusion using PSoC

AMS0805WAH. CATALOG No.: AMS0805WAH. Motion Sensor Data Sheet Ver Advanced Material on Technology

EL6483: Sensors and Actuators

ICS3.5 Software Manual Command Refarence

Peripheral Sensor Interface for Automotive Applications

FLCS V2.1. AHRS, Autopilot, Gyro Stabilized Gimbals Control, Ground Control Station

Chapter 6 - Info codes

Pololu TReX Jr Firmware Version 1.2: Configuration Parameter Documentation

LH Series Sensor Configurator Software User Manual rev. D 1/11/2012

INERTIAL LABS SUBMINIATURE 3D ORIENTATION SENSOR OS3DM

ISD4000 Depth & Temperature Sensor With Optional AHRS

Embedded Navigation Solutions VN-300 User Manual

User's Manual. ServoCenter 4.1. Volume 2: Protocol Reference. Yost Engineering, Inc. 630 Second Street Portsmouth, Ohio

SenseAir LP8 CO 2 sensor module for integration into battery-powered applications

1. Line Follower Placing the Line Follower Electrical Wiring of Line Follower Source Code Example and Testing...

DAVIS ANEMOMETER MODBUS INTERFACE MODULE DA485. Manual. Pages 10

medlab Two Channel Invasive Blood Pressure OEM board EG 02000

TETRIX Servo Motor Expansion Controller Technical Guide

Date: January 16, 2003 Page 1 of 1

1. Overview Channel 1: Channel 2: Channel 3: Channel 4: Channel 5: 2. Contacting Pololu

An Improved Version of the Fluxgate Compass Module V. Petrucha

Serial Communication AS5132 Rotary Magnetic Position Sensor

um-pwm1 Pulse-width Modulation Servo Coprocessor Datasheet Release V100 Introduction Features Applications

Device manual Inclination sensor 2 axes. JN2300 from firmware /00 05/2016

Migrating from the 3DM-GX3 to the 3DM-GX4

Transcription:

Introduction The CMPS09 module is a tilt compensated compass. Employing a 3-axis magnetometer and a 3-axis accelerometer and a powerful 16-bit processor, the CMPS09 has been designed to remove the errors caused by tilting of the PCB. The CMPS09 produces a result of 0-3599 representing 0-359.9 or 0 to 255. The output of the three sensors measuring x, y and z components of the magnetic field, together with the pitch and roll are used to calculate the bearing, each of these components are also made available in there raw form. We have also written examples of using the CMPS09 module with a wide range of popular controllers. The CMPS09 module requires a power supply at 3.3-5v and draws a nominal 25mA of current. There are three ways of getting the bearing from the module. A serial interface, an I2C interface or a PWM output. Mode selection For data on each mode please click the mode heading. Note the CMPS09 looks at the mode selection pins at power-up only. I2C mode Serial mode PWM mode To enter the I2C mode of operation leave the mode pin unconnected To enter the serial mode of operation connect the mode pin to ground To enter the PWM mode of operation connect the select PWM pin to ground PCB Drilling Plan The following diagram shows the CMPS09 PCB mounting hole positions. We have examples of using the Compass module with a wide range of popular controllers.

Connections CMPS09 - Tilt Compensated Compass Module I2C mode To enter the I2C mode of operation leave the mode pin unconnected I2C Communication I2C communication protocol with the compass module is the same as popular eeprom's such as the 24C04. First send a start bit, the module address with the read/write bit low, then the register number you wish to read. This is followed by a repeated start and the module address again with the read/write bit high. You now read one or two bytes for 8bit or 16bit registers respectively. 16bit registers are read high byte first. The compass has a 23 byte array of registers. organized as below: Register Function 0 Software version 1 Compass Bearing as a byte, i.e. 0-255 for a full circle 2,3 Compass Bearing as a word, i.e. 0-3599 for a full circle, representing 0-359.9 degrees. 4 Pitch angle - signed byte giving angle in degrees from the horizontal plane 5 Roll angle - signed byte giving angle in degrees from the horizontal plane 6 Unused 7 Unused 8 Unused 9 Unused 10,11 Magnetometer X axis raw output, 16 bit signed integer with register 10 being the upper 8 bits 12,13 Magnetometer Y axis raw output, 16 bit signed integer with register 12 being the upper 8 bits 14,15 Magnetometer Z axis raw output, 16 bit signed integer with register 14 being the upper 8 bits 16,17 Accelerometer X axis raw output, 16 bit signed integer with register 16 being the upper 8 bits 18,19 Accelerometer Y axis raw output, 16 bit signed integer with register 18 being the upper 8 bits 20,21 Accelerometer Z axis raw output, 16 bit signed integer with register 20 being the upper 8 bits 22 Command register Register 1 is the bearing converted to a 0-255 value. This may be easier for some applications than 0-3599 which requires two bytes. For those who require better resolution registers 2 and 3 (high byte first) form a 16 bit unsigned integer in the range 0-3599. This represents 0-359.9. Register 4 is the pitch angle, giving an angle of 0 when the board is flat and up to +/- 85 at maximum tilt in either direction. Register 5 works the same way but with results for the Roll angle. There is then an array of registers (10-21) providing all the raw sensor data from the magnetic and acceleration sensors. Finally Register 22 is the command register and is used to calibrate the compass, change address and if necessary restore the factory default calibration. Calibration the CMPS09 I would recommend evaluating the CMPS09 performance first before implementing this function. Its purpose is to remove offsets caused by constant magnetic sources around the CMPS09. First of all you need to determine North and align the CMPS09 with it, then enter the calibration mode by writing 0xF0 to the command register (22). To

calibrate the first point write 0xF5 to the command register, this should also light the LED, then move the object through 90 and write 0xF5 to the command register. Repeat this twice more so four points are calibrated and the LED should also turn off to confirm calibration completion. Should you need to revert to the factory calibration then write the following to the command register with 100ms between bytes 0x20,0x2A,0x60. These commands must be sent in the correct sequence to restore the calibration, additionally, No other command may be issued in the middle of the sequence. The sequence must be sent to the command register at location 22, which means 4 separate write transactions on the I2C bus. Please make sure that the CMPS09 is not located near to ferrous objects as this will distort the magnetic field and induce errors in the reading. Changing the I2C Bus Address To change the I2C address of the CMPS09 you must have only one module on the bus. Write the 3 sequence commands in the correct order followed by the address with 100ms between writes. Example; to change the address of a compass currently at 0xC0 (the default shipped address) to 0xC2, write the following to address 0xC0; (0xA0, 0xAA, 0xA5, 0xC2 ) with a 100ms delay after each of the first three bytes. These commands must be sent in the correct sequence to change the I2C address, additionally, No other command may be issued in the middle of the sequence. The sequence must be sent to the command register at location 22, which means 4 separate write transactions on the I2C bus. When done, you should label the CMPS09 with its address, however if you do forget, just power it up without sending any commands. The CMPS09 will flash its address out on the LED. One long flash followed by a number of shorter flashes indicating its address. The flashing is terminated immediately on sending a command the CMPS09. Address Decimal Hex Long Flash Short flashes 192 C0 1 0 194 C2 1 1 196 C4 1 2 198 C6 1 3 200 C8 1 4 202 CA 1 5 204 CC 1 6 206 CE 1 7 Take care not to set more than one device to the same address, there will be a bus collision and very unpredictable results. If you need more information on the I2C bus, have a look at our I2C tutorial.

Serial mode Connections To use the serial mode of operation the mode pin must be connected to ground. Communication settings The Serial mode operates over a link with a default baud rate of 9600 bps (no parity, 2 stop bits) and 3.3v-5v signal levels. This is not RS232. Do not connect RS232 to the module, the high RS232 voltages will irreversibly damage the module. Commands Below is a table describing commands that can be sent to the CMPS09 and the data it will respond with. Commands for Serial Command Name Bytes Returned data description returned 0x11 GET VERSION 1 Software version 0x12 GET ANGLE 8 BIT 1 Angle as a single byte 0-255 0x13 GET ANGLE 16 BIT 2 Angle as two bytes, high byte first 0-3600 0x14 GET PITCH 1 Pitch angle +/- 0-85 0x15 GET ROLL 1 Roll angle +/- 0-85 0x21 GET MAG RAW 6 Raw magnetic data, 16 bit signed: X high, X low, Y high, Y low, Z high, Z low 0x22 GET ACCEL RAW 6 Raw accelerometer data, 16 bit signed: X high, X low, Y high, Y low, Z high, Z low 0x23 GET ALL 4 angle high, angle low (0-3600), pitch (+/- 0-85), roll (+/- 0-85) 0x31 CALIBRATE EN1 1 returns ok (0x55) 0x45 CALIBRATE EN2 1 returns ok (0x55) 0x5A CALIBRATE EN3 1 returns ok (0x55) 0x5E CALIBRATE 1 returns ok (0x55) 0x6A RESTORE 1 1 returns ok (0x55) 0x7C RESTORE 2 1 returns ok (0x55) 0x81 RESTORE 3 1 returns ok (0x55) 0xA0 BAUD 19200 1 returns ok (0x55) 0xA1 BAUD 38400 1 returns ok (0x55) Calibration the CMPS09 I would recommend evaluating the CMPS09 performance first before implementing this function. Its purpose is to remove offsets caused by constant magnetic sources around the CMPS09. First of all you need to determine North and align the CMPS09 with it, then write a sequence of 3 commands in the correct order with a small delay between bytes, 100ms will be more than adequate. The sequence to enter calibration mode is 0x31,0x45,0x5A, then calibrate the first point by sending 0x5E to the command register, this should also light the LED. The Compass should then be rotated 90 and 0x5E sent to the command register again, repeat for two further 90 rotations and the calibration completes and the LED turns off. Please make sure that the CMPS09 is not located near to ferrous objects as this will distort the magnetic field and induce errors in the reading. Restore of factory calibration of the CMPS09 To perform a restore of the factory calibration write a sequence of 3 commands in the correct order with a small delay between bytes, 100ms will be more than adequate. The sequence is 0x6A,0x7C,0x81. Changing the baud rate While the CMPS09 operates at a default serial bus baud rate of 9600 you may wish to change this. There are two other baud rates that can be used, for 19200 just send 0xA0 or alternatively for 38400 send 0xA1. Please note that the CMPS09 will always default to its 9600kbps rate after power cycling and after setting a new baud rate the ok response (0x55) will be sent at the newly selected speed.

PWM mode To aid the more basic controllers we have included a PWM mode of operation. As the compass is rotated a high pulse will be generated that is proportional to the current angle. The pulse width varies from 1mS (0 ) to 36.99mS (359.9 ) in other words 100uS/ with a +1mS offset. The signal goes low for 65mS between pulses, so the cycle time is 65mS + the pulse width - ie. 66ms-102ms. Pin connections and mode selection for PWM operation To enter the PWM mode of operation you are required to connect the Select PWM pin to ground. After 500ms the module will enter PWM mode and output a variable high pulse from the PWM out pin dependant on the angle of the PCB. Example 1: Pulse of 20ms - 1ms offset = 19ms = 190 Example 2: Pulse of 6ms - 1ms offset = 5ms = 50 Calibration In some environments it may be necessary to perform a calibration to remove hard iron distortion, however I would recommend evaluating the CMPS09 performance first before implementing the routine. To achieve this a normally open switch must be wired between the calibrate pin and ground. The first step is to line the compass up with north, then press the switch and the CMPS09 will light is LED. Rotate the module by 90 and repeat 3 further times, the LED should now go out and the module will be recalibrated. Should you wish to restore the factory calibration then press and hold the switch for at least 5 seconds before releasing. Please make sure that the CMPS09 is not located near to ferrous objects as this will distort the magnetic field and induce errors in the reading.