inemo™ platform - smac to... · inemo™ platform 10/12/2012 . ... inemo™ ahrs and sensor...
TRANSCRIPT
Outline
• General concept and purpose
• Inertial position estimation and Sensor fusion
• Attitude and Heading Reference System (AHRS) / Kalman filtering
• Application example: Inertial Body Motion Reconstruction
• iNEMO™ Hardware
• STM32 microcontroller and peripherals
• Sensors (MEMS)
• External peripherals USB, UART, uSD, …
• iNEMO™ Software and Firmware
• Drivers
• FreeRTOS
• Tasks
• Host applications.
2
10/12/2012 iNEMO™ Platform
iNEMO™ Platform concept
• iNErtial MOdule produced by STMicrolectronics
• Combines accelerometers, gyroscopes and magnetometers to make
an integrated Inertial Measurment Unit (IMU)
• The IMU measures and reports velocity, orientation and gravitational
forces, using a combination of sensors.
3
10/12/2012 iNEMO™ Platform
ST MEMS: the way for the orientation 4
10/12/2012
The accelerometers sense linear acceleration
In static conditions, the projection of gravity on the
three axes allows tilt angles to be computed
The magnetometer senses the magnetic field
In static conditions, the projection of the
geomagnetic field on the three axes allows the
heading angle to be computed
The gyroscope measures the angular rate applied
to the device
In dynamic conditions, by integration of the 3-axis
angular rate, the 3D orientations can be computed
Sensor fusion and
AHRS algorithm
for 3D space orientation
iNEMO™ Platform
Inertial Measurement Unit (IMU)
• Electronic device that measures and reports on an object's velocity,
orientation, and gravitational forces
• Advantages
• Instantaneous output of position and velocity
• Completely self contained
• All weather global operation
• Error characteristics are known and can be modeled quite well
• Works well in hybrid systems (e.g., together with GPS)
• Disadvantages
• Position/velocity information degrade with time
• Expensive systems (usually).
5
10/12/2012 iNEMO™ Platform
Inertial navigation 1/3
• If we can measure the acceleration of an object we can
• Integrate the acceleration to get velocity
• Integrate the velocity to get position (dead reckoning)
• Then, assuming that we know the initial position and velocity we can
determine the position of the system at any time t
𝑥 𝑡 = 𝑎𝑥𝑑𝑡𝑑𝑡 = 𝑥 0 + 𝑣 0 𝑡 +𝑡
0
1
2𝑎𝑥𝑡
2𝑡
0
.
6
10/12/2012 iNEMO™ Platform
Inertial navigation 2/3
• The main problem is that the accelerometer can not tell the difference
between object acceleration and gravity: therefore we need to find a
way to separate the effect of gravity and of acceleration
• Two possible strategies are available:
• Keep the accelerometers horizontal so that they do not sense the gravity vector
(stable platform mechanization)
• Somehow determine in real time the angle between the accelerometer inclination
axis with respect to the horizontal, and then subtract the gravity components from
the measured acceleration (strapdown mechanization)
• The first strategy requires complex mechanical devices; the second is
based on an analytical or computational implementation.
7
10/12/2012 iNEMO™ Platform
Inertial navigation 3/3
• Strapdown navigation is based on the knowledge of acceleration and
orientation in an absolute angular reference
• Orientation is given by an "Attitude and Heading Reference System"
(AHRS)
• Then, the gravity acceleration components along the axes can be
computed and removed, and velocity and position are estimated.
8
10/12/2012 iNEMO™ Platform
AHRS and Sensor fusion 1/2
• Each AHRS sensor used has distinctive features and limitations
• Gyroscopes measure orientation by integrating angular velocities and the
accelerometer and magnetometer provide a noisy and disturbed but drift-free
measurement of orientation
• The combination of information from multiple sources and a suitable
system physical model provides a more reliable estimation of
orientation
• The Kalman filter is one of the most used sensor fusion algorithms,
whose discrete-time version can be easily implemented in software.
9
10/12/2012 iNEMO™ Platform
AHRS and Sensor fusion 2/2
• The Kalman filter suitably weights
the information sources with
knowledge on the signal
characteristics based on their
models, to make the best use of
all sensor data.
10
10/12/2012 iNEMO™ Platform
iNEMO™ AHRS and Sensor fusion
• The iNEMO System-on-Board includes different sensors and a sensor
fusion engine (based on an Extended Kalman Filter) running on the
microprocessor.
11
10/12/2012 iNEMO™ Platform
iNEMO™ Platform concept 12
10/12/2012
The iNEMO™ is a smart combination of
multiple MEMS sensors in a unique Inertial
Measurement Unit (IMU) targeting virtual
reality, platform stabilization, human
machine interfaces, and robotics.
iNEMO™ Platform
iNEMO™ features
• Absolute point tracking and motion tracking accuracy
• Immunity to magnetic interference for high
performance in real-world conditions
• Few user-calibration interruptions enabling innovative
and longer game play
• Reliable compass heading for accurate navigation
• Accurate direction enabling true augmented reality
applications.
13
10/12/2012 iNEMO™ Platform
14
• 1. Chest
• 2. Hips
• 3. Right arm
• 4. Right forearm
• 5. Left arm
• 6. Left forearm
• 7. Right femur
• 8. Right tibia
• 9. Left femur
• 10. Left tibia
1
2
3
4
5
7
8
9
10
The avatar on the screen follows the movements of the operator
6
Application example:
iBMR Body Motion Reconstruction 1/2
iNEMO™ Platform 10/12/2012
▪ Demo functions:
▪ A set of INEMO™
boards is used to
detect the body
movements
▪ All signals are
collected and sent to a
system showing an
avatar following the
human movement.
15
1
2
3
4
5
7
8
9
10
6
Application example:
iBMR Body Motion Reconstruction 2/2
iNEMO™ Platform 10/12/2012
iNEMO™ V2 Board1/2
• Main hardware components:
• STM32F103RE – Microcontroller
• LPR430AL – 2-axis gyro (roll, pitch)
• LY330ALH – yaw-axis gyro
• LSM303DLH – 6-axis geomagnetic module
• LPS001DL – pressure sensor
• STLM75 – temperature sensor
• LDS3985Mxxx – voltage regulator
• Extended connector
for wireless connectivity
• MicroSD™ card slot
• COM connector with RTS and CTS signals
• USB 2.0 full speed connection
• Reset button
• User LED and button
• Power supply switch (USB/VEXT).
16
10/12/2012 iNEMO™ Platform
STM32 Microcontroller 1/2 18
10/12/2012
• Core: ARM 32-bit
CORTEX™-M3 CPU
• 72 MHz maximum frequency
1.25 DMPIS/MHz (Dhrystone 2.1)
• Single-cycle multiplication and
hardware division
• AMBA AHB/APB bus
• Memory:
• 512KB Flash, 64 KB RAM
• Flexible static memory controller
with 4 Chip Select. Supports
Compact Flash, SRAM, PSRAM,
NOR and NAND memories
• Clock, reset and power supply
management
• Low power: sleep, stop,
standby
iNEMO™ Platform
STM32 Microcontroller 2/2 • 3x 12-bit, 1ms A/D converters
• 2x 12-bit D/A converters
• DMA: 12-channel DMA controller
• Supported peripherals: timers, ADCs, DAC, SDIO, I2Ss, SPIs, I2Cs and UARTs
• Debug mode
• Serial wire debug (SWD) & JTAG interfaces
• Cortex-M3 Embedded Trace Macrocell™
• Up to 112 fast I/O ports
• 51/80/112 I/Os, all mappable on 16 external interrupt vectors
• Up to 11 timers
• Up to 13 communication interfaces
• 2x I2Cs, 5x UARTs, 3 SPIs, CAN, USB 2.0, SDIO
• CRC calculation, 96-bit unique ID.
19
10/12/2012 iNEMO™ Platform
iNEMO™ V2 on-board sensors
• Electronic and Micro Electro-Mechanical System (MEMS) technologies
• An integrated sensor usually includes
• The measuring instrument
• A transducer
• Signal conditioning circuitry
• An interface, which can be analog or digital.
20
10/12/2012 iNEMO™ Platform
Accelerometer/magnetometer 1/2
• The MEMS accelerometer is usually based on a miniaturized
mass-spring system, immersed in vacuum
• A capacitive or piezoresistive transducer reads out the electrical signal.
21
10/12/2012 iNEMO™ Platform
© OpenLearn LabSpace, Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Licence
© University of British Columbia
Accelerometer/magnetometer 2/2
• LSM303DLH: 3-axis accelerometer and 3-axis magnetometer
• Linear acceleration full-scale of ±2 g / ±4 g / ±8 g and a magnetic field full-scale of
±1.3 / ±1.9 / ±2.5 / ±4.0 / ±4.7 / ±5,6 / ±8.1 gauss, both fully selectable by the user
• 2-wire I2C serial bus interface
• Can be configured to generate an interrupt signal by inertial
wakeup/free-fall events, as well as by the position of the device itself.
22
10/12/2012 iNEMO™ Platform
MEMS Gyroscope 1/2
• Usually implemented as a vibrating structure gyroscope
• A vibrating object tends to continue vibrating in the same plane as its support rotates
• As the plane of oscillation is rotated, the response detected by the transducer results
from the Coriolis term in its equations of motion (“Coriolis force”)
• Same principle as in the halteres of some kind of flying insects.
23
10/12/2012 iNEMO™ Platform
© San José State Universtiy
MEMS Gyroscope 2/2
• LPR430AL (2-axis) and LY330ALH (single-axis) are high
performance, low-power micro-machined gyroscopes capable of
measuring angular rate along pitch and roll axes
• Full scale of ±300 dps and capable of detecting rates with a -3 dB bandwidth up to
140 Hz
• The measured angular rate to the external world through an analog
output voltage.
24
10/12/2012 iNEMO™ Platform
Temperature sensor
• STLM75: Digital temperature sensor and thermal watchdog
• Temperature range: –55°C to +125°C
• Accuracy: ±2°C from –25°C to +100°C
• Low operating current: 125 μA
• Conversion time:150 ms
• 2-wire I2C/SMBus-compatible serial interface
• Output pin (open drain) can be configured for interrupt or
comparator/thermostat mode.
25
10/12/2012 iNEMO™ Platform
Pressure sensor
• LPS001D: piezoresistive pressure sensor (barometer)
• Pressure range: 300 -1100 mbar
• Resolution: 0.1 mbar
• Very low power consumption
• Embedded offset and span temperature compensation
• Embedded 16-bit ADC
• SPI and I2C interfaces.
26
10/12/2012 iNEMO™ Platform
iNEMO™ Firmware
• Open-source software project available for download http://www.st.com/internet/evalboard/product/250367.jsp
• STM32 libraries
(C and ARM Assembly)
• System configuration drivers (timer interrupt, DMA, power regulator, flash memory, ADC, …)
• Peripheral drivers I2C, UART, USB, SPI
• Timer programming
• GPIO interaction
• Sensor drivers
(mostly C)
• Accelerometer, gyroscope, magnetometer, pressure sensor, thermometer
• Operating System: FreeRTOS porting for STM32
(C and ARM Assembly)
• Sensor read-out and USB PC interaction library
(C/C++)
• ST proprietary AHRS libraries (closed-source).
27
10/12/2012 iNEMO™ Platform
Accelerometer
driver • Set parameter
• Read data
• …
Microcontroller/sensor interaction
• Example: Accelerometer reading
28
10/12/2012 iNEMO™ Platform
CPU I2C LSM303DLH System bus
SDA
I2C driver
SCL
Operating System (OS)
• An OS is a set of software that manages computer hardware
resources
• Provides common services for computer programs (memory allocation, time
measurement, inter-task communication)
• Schedules tasks for efficient use of the system (time-sharing)
• Real-Time Operating System (RTOS)
• Embedded systems are designed for specific control functions with real-time
constraints
• An RTOS is an OS intended to serve real-time application requests
• Main goal is not high troughput, but guaranteeing quick and predictable response to
events
• Soft RTOS: can generally meet deadlines (occasional misses are not catastrophic)
• Hard RTOS: time-critical deadlines must be met (occasional misses cause catastrophic
system failures).
29
10/12/2012 iNEMO™ Platform
FreeRTOS
• Free and open source RTOS written in C/Assembly for small
embedded systems
• Simple and portable through 31 different architectures
• Split the workload in tasks
• Implements a Round Robin priority-based task scheduler with
different algorithms
• preemptive
• cooperative
• hybrid
• Provides inter-task communication mechanisms.
30
10/12/2012 iNEMO™ Platform
FreeRTOS: scheduling and task switching
• Event-driven (e.g. timeout, synchonization events)
• Switch among different states
• Idle task always running
• Timing based on a tick rate.
31
10/12/2012 iNEMO™ Platform
iNEMO™ Firmware behavior 32
10/12/2012
Boot phase:
microprocessor and
peripheral initialization
FreeRTOS startup
Fre
eR
TO
S
iNemoCmd
task
iNemoData
task
iNEMO™ Platform
USB
IRQ
TIM2
IRQ
Receives requests from USB and
sends suitable answers
When active, periodically reads
sensor data and sends them via the
USB connection.
[…]
iNEMO™ suite software and libraries
• Available for download at http://www.st.com/internet/evalboard/product/250367.jsp
• Frame definition for USB communication
• Example:
• C/C++ iNEMO™ interaction library for the development of user
applications
• Graphical interface for sensor interaction (iNEMO™ Suite).
33
10/12/2012 iNEMO™ Platform
iNEMO™ and the SMAC Project
• Smart systems such as the iNEMO platform are currently being
studied within the FP7 SMAC Project, whose main goals are:
• The development of a co-simulation and co-design environment which is aware
(and thus considers) the essential features of the basic subsystems and
components to be integrated;
• The development of modeling and design techniques, methods and tools that,
when added to the platform, will enable multi-domain simulation and optimization at
various levels of abstraction and across different technological domains
• The SMAC platform will allow to successfully address the following
grand challenges related to the design and manufacturing of
miniaturized smart systems:
• Development of innovative smart subsystems and components demonstrating
advanced performance, ultra low power and the capability of operating under
special conditions (e.g., high reliability, long lifetime)
• Design of miniaturized and integrated smart systems with advanced functionality
and performance, including nanoscale sensing systems, possibly operating
autonomously and in a networked fashion.
34
10/12/2012 iNEMO™ Platform
References
• iNEMO™ V2 (STEVAL-MKI062V2):
http://www.st.com/internet/evalboard/product/250367.jsp
• iNEMO™ M1:
http://www.st.com/internet/analog/product/253162.jsp
• FreeRTOS: http://www.freertos.org/
• N. Abbate, A. Basile, C. Brigante, A. Faulisi, “Development of a MEMS based
wearable motion capture system”, IEEE Conference on Human System
Interaction (HSI), 2009, pp. 255-259
• N. Abbate, I. Aleo, A. Basile, C. Brigante, A. Faulisi, “Design of an Inertial Motion
Module”, IEEE International Conference on Robotics and Automation (ICRA),
2011, pp. 1-4
• C. Brigante, N. Abbate, A. Basile, A. Faulisi, S. Sessa, “Towards Miniaturization
of a MEMS-Based Wearable Motion Capture System”, IEEE Trans. on Industrial
Electronics, Vol. 58, N. 8, Aug. 2011, pp. 3234-3241
35
10/12/2012 iNEMO™ Platform