Arexx JM3-CG32 User guide

JM3-CG32
ASURO Compass / Gyro Module
©2014 AREXX Engineering and JM3 Engineering
www.arexx.com
For latest updates check www.jm3-engineering.com!
AREXX Engineering & JM3 Engineering
Version: 1.03 Nov 1st, 2014 page: 1
Impressum
©2012-2014 AREXX Engineering
Nervistraat 16 8013 RS Zwolle The Netherlands
Tel.: +31 (0) 38 454 2028 Fax.: +31 (0) 38 452 4482
This manual is protected by the laws of Copyright. It is forbidden to copy all or part of the contents without prior written authorization!
Product specifications and delivery contents are subject to changes. The manual is subject to changes without prior notice.
You can find free updates of this manual on
http://www.arexx.com/
ASURO” licensed by DLR and “AREXX” are registered trademarks from AREXX Engineering. All other trademark are the property of their owners. We are not responsible for the contents of external web pages that are mentioned in this manual!
Information about limited warranty and responsibility
The warranty granted by AREXX Engineering is limited to the replacement or repair of the Module and its accessories within the legal warranty period if the default has arisen from production errors such as mechanical damage or missing or wrong assembly of electronic components except for all components that are connected via plugs/sockets. The warranty does not apply directly or indirectly to damages due to the use of the robot. This excludes claims that fall under the legal prescription of product responsibility.
The warranty does not apply in case of irreversible changes (such as soldering of other components, drilling of holes, etc.) of the module or its accessories or if the module is damaged due to the disrespect of this manual!
It cannot be guaranteed that the supplied software will satisfy individual expectations or will run completely error-free and without any interruption. Moreover the software can be freely changed and is loaded into the unit by the user. Therefore the user carries the full risk regarding the quality and performance of the unit including all software. AREXX Engineering guarantees the functionality of the supplied application examples provided the respect of the conditions specified in the data sheet. If the SAM-04-LAN or the PC software turns out to be faulty or insufficient, the customer carries all costs for service, repair or correction. Please note the relevant license agreements on the CD-ROM!
The exclamation mark attracts the attention of the user to important instructions that must be adhered to. If you make a mistake in this part, it can lead eventually to the destruction of the robot or its accessories and even endanger your health or that of your environment!
The "Information" symbol draws the attention to useful tips and tricks or background information. It is not always essential to understand everything but it is often very useful.
Symbols
The manual uses following symbols:
AREXX Engineering & JM3 Engineering
Version: 1.03 Nov 1st, 2014 page: 2
Safety recommendations
IMPORTANT:
Prior to using this robot arm for the first time, please read this manual thoroughly up to the end! They explain the correct use and inform you about potential dangers! Moreover they
contain important information that might not be obvious for all users.
- Check the polarity of the batteries or power supply.
- Keep all products dry, when the product gets wet remove the power directly.
- Remove the batteries or power when you are not using the product for a longer period.
- Before taking the module into operation, always check it and its cables for damage.
- If you have reason to believe that the device can no longer be operated safely,
disconnect it immediately and make sure it is not unintentionally operated.
- Do not operate the module in rooms or under unfavourable conditions.
- This module is equipped with highly sensitive components. Electronic components are very sensitive to static electricity discharge. Only touch the module by the edges and avoid direct contact with the components on the circuit board.
Normal use
This module is developed to use with robots, which allows you to determine basic behaviour patterns and reactions
of the robot to external influences yourself.
The module was developed as an experimental platform for all electronic technicians with interest in robotics. In
practical tests, it visualises the influence and effects of software parameters as well as physical parameters via the
corresponding sensor technology. Any use other than that described above is not permitted.
The product is not a toy and should be kept out of reach of children under 14 years of age! It may only be used in
closed, dry indoor rooms. The product must not get damp or wet. Use other than that described above can lead to
damage to the product and may involve additional risks such as short circuits, fire, electrical shocks etc.
Content
1. Impressum ................................................................................... 2
2. Safety recommendations ............................................................... 3
3. Introduction ................................................................................... 5
4. Manual ........................................................................................... 6
5. Schematic....................................................................................... 9
6. PCB Layout ..................................................................................... 9
AREXX Engineering & JM3 Engineering
Version: 1.03 Nov 1st, 2014 page: 3
ASURO Robot
ASURO xTend with Compass / Gyro Module and Display
AREXX Engineering & JM3 Engineering
Version: 1.03 Nov 1st, 2014 page: 4
Introduction
General purpose 3D accelerometer, 3D magnetometer and 3D gyroscope module for robots. It can be directly plugged into the ASURO expansion port on the ASURO xTend board.
The sensor module is using the LSM9DS0 MEMS. It is a system-in-package featuring a 3D digital linear acceleration sensor, a 3D digital angular rate sensor, and a 3D digital magnetic sensor. The system can be configured to generate interrupt signals on dedicated pins and is capable of motion and magnetic field detection.
Thresholds and timing of interrupt generators are programmable by the user. Magnetic, accelerometer and gyroscope sensing can be enabled or set in power-down mode separately for smart power management.
The differences between a gyro and an accelerometer is often not clear - here a clarification:
A gyroscope is very build to detect the rate of an angular rotation, but can’t detect an absolute
angle – but an accelerometer does! The 3D accelerometer can determine the absolute angle of your robot, e.g. Roll and Pitch value
can be easily calculated by a microcontroller. In addition you can calculate the vector of a collision impulse. This information can be used to
move around an obstacle. A magnetometer detects the 3D magnetic earth field. It is very good in finding the magnetic north
pole for heading calculation.
AREXX Engineering & JM3 Engineering
Version: 1.03 Nov 1st, 2014 page: 5
Manual
1. Connecting to ASURO xTend Board
The module will be simply plug in to the K3 connector on the ASURO xTend board. There is no voltage regulator on the module. Attention a wrong voltage can damage the module!
1.1. PIN OUT Compass / Gyro Module
PIN 1 = VDD_3.3 PIN 2 = DENG PIN 3 = INTG PIN 4 = INT2 PIN 5 = INT1
PIN 6 = n/c PIN 7 = SCA PIN 8 = SCL PIN 9 = DRDY PIN 10 = GND
PIN1 Pin10
2. Software
The data access and initialization works over I2C Bus (for details on registers and functions refer to the datasheet of the LSM9D0. To enable the display function you have to make a change the Makefile - in the Global Defines section you should have IOEXT_NAV defined.
# Global Defines # # Enable demo program for connected sensor module.
DEFINES = IOEXT_NAV
2.1. Writing to the Sensor
Principle way of writing data to I2C modules.
/**********************************************************************\
* write data to the sensor (generalized description) \**********************************************************************/
master.TransmitBytes(I2C Addr, Register | AUTO_INC, Data Byte1, Data Byte2);
AREXX Engineering & JM3 Engineering
Version: 1.03 Nov 1st, 2014 page: 6
2.2. Reading data from I2C
Principle way of reading data from I2C modules.
/**********************************************************************\ * read data from sensor (generalized description) \**********************************************************************/
master.ReadRegisters(I2C Addr, Register | AUTO_INC, mBuffer, 6);
2.3. Initialization of the Sensor
inline void Initialize()
{ /******************************************************************\
* initialize gyro (generalized description) * CTRL_REG1_G: 0011 1100b: Normal mode, Z-axis, DataRate = 95 Hz, Cut-Off 25 * CTRL_REG2_G: 0010 0000b: Normal mode, HP cout-off 7.2 Hz * CTRL_REG3_G: 0000 0000b: default * CTRL_REG4_G: 0000 0000b: continuous mode, little endian, 245 dps * CTRL_REG5_G: 0000 0000b: default, no FIFO & INT \*****************************************************************/
master.TransmitBytes(DGYRO, CTRL_REG1_G | AUTO_INC, 0x3C, 0x22); master.TransmitBytes(DGYRO, CTRL_REG4_G, 0x00);
* initialize magnetometer and accelerometer * reg address MSB is auto-increment * power up sensor,enable x, y, z axis * +/-2 gauss, update rate 3,125 Hz; +/- 2g, update rate 50 Hz * all filter bypassed, Hpc = 512 Hz * CTRL_REG0_XM: 0000 0000b: default * CTRL_REG1_XM: 0111 0111b: accelerometer: continuous mode, no Blockupdate, * update 200 Hz, enable x, y, z axis * CTRL_REG2_XM: 1100 0000b: anit-alias 50Hz, +/- 2g, no self-test
* CTRL_REG4_XM: 0000 0000b: default * CTRL_REG5_XM: 1110 1000b: enable Temp, high Res, update 50 Hz, noLatch * CTRL_REG6_XM: 0000 0000b: +/- 2 gauss * CTRL_REG7_XM: 1000 0000b: normal mode, continuous conversion \******************************************************************/
master.TransmitBytes(MAGACC, CTRL_REG0_XM | AUTO_INC, 0x00, 0x77, 0xC0); // Reg0, 1, 2 master.TransmitBytes(MAGACC, CTRL_REG5_XM | AUTO_INC, 0xE8, 0x00, 0x80); // Reg5, 6, 7
}
/******************************************************************\
* CTRL_REG3_XM: 0000 0000b: default
2.4. Slave Addresses
MAGACC = 0x3A, // LSM9DS0 Magnetometer and Acceleration DGYRO = 0xD6 // LSM9DS0 Gyro
AREXX Engineering & JM3 Engineering
Version: 1.04 Nov 9th, 2014 page: 7
2.5. Register
Name
Slave Address
Type
Register address
Default
Hex
Binary
Reserved
DGYRO
--
00-0E
--
--
WHO_AM_I_G
DGYRO
r
0F
000 1111
11010100
Reserved
DGYRO
--
10-1F
--
--
CTRL_REG1_G
DGYRO
rw
20
010 0000
00000111
CTRL_REG2_G
DGYRO
rw
21
010 0001
00000000
CTRL_REG3_G
DGYRO
rw
22
010 0010
00000000
CTRL_REG4_G
DGYRO
rw
23
010 0011
00000000
CTRL_REG5_G
DGYRO
rw
24
010 0100
00000000
REFERENCE_G
DGYRO
rw
25
010 0101
00000000
Reserved
DGYRO
--
26
--
--
STATUS_REG_G
DGYRO
r
27
010 0111
output
OUT_X_L_G
DGYRO
r
28
010 1000
output
OUT_X_H_G
DGYRO
r
29
010 1001
output
OUT_Y_L_G
DGYRO
r
2A
010 1010
output
OUT_Y_H_G
DGYRO
r
2B
010 1011
output
OUT_Z_L_G
DGYRO
r
2C
010 1100
output
OUT_Z_H_G
DGYRO
r
2D
010 1101
output
FIFO_CTRL_REG_G
DGYRO
rw
2E
010 1110
00000000
FIFO_SRC_REG_G
DGYRO
r
2F
010 1111
output
INT1_CFG_G
DGYRO
rw
30
011 0000
00000000
INT1_SRC_G
DGYRO
r
31
011 0001
output
INT1_TSH_XH_G
DGYRO
rw
32
011 0010
00000000
INT1_TSH_XL_G
DGYRO
rw
33
011 0011
00000000
INT1_TSH_YH_G
DGYRO
rw
34
011 0100
00000000
INT1_TSH_YL_G
DGYRO
rw
35
011 0101
00000000
INT1_TSH_ZH_G
DGYRO
rw
36
011 0110
00000000
INT1_TSH_ZL_G
DGYRO
rw
37
011 0111
00000000
INT1_DURATION_G
DGYRO
rw
38
011 1000
00000000
Reserved
MAGACC
--
00-04
--
--
OUT_TEMP_L_XM
MAGACC
r
5
000 0101
output
OUT_TEMP_H_XM
MAGACC
r
6
000 0110
output
STATUS_REG_M
MAGACC
r
7
000 0111
output
OUT_X_L_M
MAGACC
r
8
000 1000
output
OUT_X_H_M
MAGACC
r
9
000 1001
output
OUT_Y_L_M
MAGACC
r
0A
000 1010
output
OUT_Y_H_M
MAGACC
r
0B
000 1011
output
OUT_Z_L_M
MAGACC
r
0C
000 1100
output
OUT_Z_H_M
MAGACC
r
0D
000 1101
output
Reserved
MAGACC
--
0E
000 1110
--
WHO_AM_I_XM
MAGACC
r
0F
000 1111
01001001
Reserved
MAGACC
--
10-11
--
--
INT_CTRL_REG_M
MAGACC
rw
12
001 0010
11101000
INT_SRC_REG_M
MAGACC
r
13
001 0011
output
INT_THS_L_M
MAGACC
rw
14
001 0100
00000000
INT_THS_H_M
MAGACC
rw
15
001 0101
00000000
OFFSET_X_L_M
MAGACC
rw
16
001 0110
00000000
OFFSET_X_H_M
MAGACC
rw
17
001 0111
00000000
OFFSET_Y_L_M
MAGACC
rw
18
001 01000
00000000
OFFSET_Y_H_M
MAGACC
rw
19
001 01001
00000000
OFFSET_Z_L_M
MAGACC
rw
1A
001 01010
00000000
OFFSET_Z_H_M
MAGACC
rw
1B
001 01011
00000000
REFERENCE_X
MAGACC
rw
1C
001 01100
00000000
AREXX Engineering & JM3 Engineering
Version: 1.04 Nov 9th, 2014 page: 8
REFERENCE_Y
MAGACC
rw
1D
001 01101
00000000
REFERENCE_Z
MAGACC
rw
1E
001 01110
00000000
CTRL_REG0_XM
MAGACC
rw
1F
001 1111
00000000
CTRL_REG1_XM
MAGACC
rw
20
010 0000
00000111
CTRL_REG2_XM
MAGACC
rw
21
010 0001
00000000
CTRL_REG3_XM
MAGACC
rw
22
010 0010
00000000
CTRL_REG4_XM
MAGACC
rw
23
010 0011
00000000
CTRL_REG5_XM
MAGACC
rw
24
010 0100
00011000
CTRL_REG6_XM
MAGACC
rw
25
010 0101
00100000
CTRL_REG7_XM
MAGACC
rw
26
010 0110
00000001
STATUS_REG_A
MAGACC
r
27
010 0111
output
OUT_X_L_A
MAGACC
r
28
010 1000
output
OUT_X_H_A
MAGACC
r
29
010 1001
output
OUT_Y_L_A
MAGACC
r
2A
010 1010
output
OUT_Y_H_A
MAGACC
r
2B
010 1011
output
OUT_Z_L_A
MAGACC
r
2C
010 1100
output
OUT_Z_H_A
MAGACC
r
2D
010 1101
output
FIFO_CTRL_REG
MAGACC
rw
2E
010 1110
00000000
FIFO_SRC_REG
MAGACC
r
2F
010 1111
output
INT_GEN_1_REG
MAGACC
rw
30
011 0000
00000000
INT_GEN_1_SRC
MAGACC
r
31
011 0001
output
INT_GEN_1_THS
MAGACC
rw
32
011 0010
00000000
INT_GEN_1_DURATION
MAGACC
rw
33
011 0011
00000000
INT_GEN_2_REG
MAGACC
rw
34
011 0100
00000000
INT_GEN_2_SRC
MAGACC
r
35
011 0101
output
INT_GEN_2_THS
MAGACC
rw
36
011 0110
00000000
INT_GEN_2_DURATION
MAGACC
rw
37
011 0111
00000000
CLICK_CFG
MAGACC
rw
38
011 1000
00000000
CLICK_SRC
MAGACC
r
39
011 1001
output
CLICK_THS
MAGACC
rw
3A
011 1010
00000000
TIME_LIMIT
MAGACC
rw
3B
011 1011
00000000
TIME _LATENCY
MAGACC
rw
3C
011 1100
00000000
TIME_WINDOW
MAGACC
rw
3D
011 1101
00000000
Act_THS
MAGACC
rw
3E
011 1110
00000000
Act_DUR
MAGACC
rw
3F
011 1111
00000000
AREXX Engineering & JM3 Engineering
Version: 1.04 Nov 9th, 2014 page: 9
3. Technical Data
VDD = 3.3 V +/- 5% IDD 6.5 mA (typ.) Temperature Range: -10 to 65 °C
Key Features of the LSM09D0:
3 acceleration channels, 3 angular rate channels, 3 magnetic field channels ±2/±4/±6/±8/±16 g linear acceleration full scale ±2/±4/±8/±12 gauss magnetic full scale ±245/±500/±2000 dps angular rate full scale 16-bit data output I2C serial interfaces <= 400 kHz Power-down mode / low-power mode Programmable interrupt generators Embedded self-test Embedded temperature sensor Embedded FIFO Position and motion detection functions Click/double-click recognition Intelligent power saving for handheld devices
For more details of the chip functionality please refer to the datasheet of the LSM9D0.
AREXX Engineering & JM3 Engineering
Version: 1.04 Nov 9th, 2014 page: 10
4. Schematic
5. PCB
Top view:
AREXX Engineering & JM3 Engineering
Version: 1.04 Nov 9th, 2014 page: 11
Loading...