BWP-WS19-02/Dokumentation/SensorenKartierung: Unterschied zwischen den Versionen
Zeile 1: | Zeile 1: | ||
=Teamstruktur= |
=Teamstruktur= |
||
Phase 1: |
Phase 1: |
||
− | * Jan (Manager) |
+ | * Jan (Manager) |
* Jonas (Tester) |
* Jonas (Tester) |
||
* Mario (Dokumentation) |
* Mario (Dokumentation) |
||
Phase 2: |
Phase 2: |
||
− | * Jan (Tester) |
+ | * Jan (Tester) |
* Jonas (Dokumentation) |
* Jonas (Dokumentation) |
||
* Mario (Manager) |
* Mario (Manager) |
||
+ | |||
+ | Phase 3: |
||
+ | * Jan (Dokumentation) |
||
+ | * Jonas (Manager) |
||
+ | * Mario (Tester) |
||
=Arbeitspakete= |
=Arbeitspakete= |
Version vom 25. Januar 2020, 23:35 Uhr
Teamstruktur
Phase 1:
- Jan (Manager)
- Jonas (Tester)
- Mario (Dokumentation)
Phase 2:
- Jan (Tester)
- Jonas (Dokumentation)
- Mario (Manager)
Phase 3:
- Jan (Dokumentation)
- Jonas (Manager)
- Mario (Tester)
Arbeitspakete
Sensoren & Kartierung
Adafruit BNO055 Absolute Orientation Sensor
Der BNO055-Sensor beinhaltet drei Accelerometer, drei Gyroscope und drei Magnetometer (jeweils X-, Y- und Z-Achse). Außerdem steht ein ARM-Cortex-M0 zur Verfügung, welcher mittels Sensor Fusion direkt auswertbare Daten liefert.
Folgende Daten stehen als Output zur Verfügung:
- Absolute Orientation (Euler Vector, 100Hz)
- Three axis orientation data based on a 360° sphere
- Absolute Orientation (Quaterion, 100Hz)
- Four point quaternion output for more accurate data manipulation Angular
- Velocity Vector (100Hz)
- Three axis of 'rotation speed' in rad/s
- Acceleration Vector (100Hz)
- Three axis of acceleration (gravity + linear motion) in m/s^2
- Magnetic Field Strength Vector (20Hz)
- Three axis of magnetic field sensing in micro Tesla (uT)
- Linear Acceleration Vector (100Hz)
- Three axis of linear acceleration data (acceleration minus gravity) in m/s^2
- Gravity Vector (100Hz)
- Three axis of gravitational acceleration (minus any movement) in m/s^2
- Temperature (1Hz)
- Ambient temperature in degrees celsius
Nachfolgendes Bild zeigt einen Testaufbau mit BNO055 und einem nRF52 Feather auf einem Steckbrett. Das nRF52 Feather kommuniziert über I2C mit dem BNO055.
Um den Sensor für das Projekt zu benutzen, musste ein eigener Treiber entwickelt werden. Dieser basiert im wesentlichen darauf, dass über I2C-Aufrufe von Zephyr in bestimmte Register des Sensor geschrieben bzw. von ihnen gelesen wird. Anhand des Datenblatts wurde bestimmt welche Register zu welchem Zweck dienen. Daraus ergab sich eine API, welche zum jetzigen Zeitpunkt alle benötigten Funktionen des Sensors abbildet, jedoch nicht den selben Umfang wie die Bibliothek von Adafruit aufweist.
VL53L0X Time-Of-Flight Distance Sensor
Positionbestimmung mit einer optischen Maus
For the determination of the X-Y position we used a PS/2 optical mouse.Thanks the "Computer Mouse Project" from hofaciens.de.We were able to read the X-Y positions of the mouse using an Arduino UNO:
Basic overview of the PS/2 protocol of a mouse
The PS2 mouse uses a bidirectional synchronous serial communication. Where both lines(Data and Clock) are open collector. If nothing is done they are in “idle” state/high impedance(two external or internal pull up resistors pull the lines to high state).
The Clock signal is always generated by the Mouse device. In order to get Clock signals, the Host(Micro-controller) need to put the bus lines in “request to send” mode: Put the Clock bus to low, wait at least 100us, put the Data bus low and release the Clock. Now commands can be sent to the mouse.
There is a command set that may be sent to the mouse or that the mouse may sent to the Host. For example, for this implementation the following commands were used:
Reset Mode 0xFF
: set default values.
Remote Mode 0xF0
: mouse send data only when the
Read Data 0xEB
command is received.
- Host to Mouse Communication
Data is sent in a 12 bit frame:
-start bit
-data byte : For example the reset command.
-Parity bit
-stop bit
-acknowledgment bit
- Mouse to Host Communication
Data is sent in a 11 bit frame:
-start bit
-data byte: For example data byte with the X or Y position.
-Parity bit
-stop bit.
Implementation using the "feather_board"
For the implementation using the feather board, some problems popped up:
-Voltage of the nRF52 is 3.3v, mouse is 5v.
-The Data and Clock signals from the mouse are both open-collector. Zephyr OS does not support open collector configuration at this moment.
To solve this, two additional modules were added:
-Level Conversion Module 5-3v System.
-SN74LS07 IC with Open-Collector output. 74LS07_Datasheet
References
THE DESIGN AND DEVELOPMENT OF A PS/2 MOUSE CONTROLLER AND
MULTIPLE I/O BUS SYSTEM INTEGRATION[1]
The PS/2 Mouse/Keyboard Protocol
Zephyr Scientific Library (zscilib)
Für die Berechnungen, die für den Kalman Filter benötigt werden, wurde eine zusätzliche Library in das Projekt eingebunden. Es handelt sich dabei um die Zephyr Scientific Library (zscilib). Die Library wurde mit folgenden Schritten eingebunden:
1. In the manifest/remotes section add:
remotes: - name: zscilib url-base: https://github.com/zscilib
2. In the manifest/projects section add:
- name: zscilib remote: zscilib path: modules/lib/zscilib revision: master
3. Save the file, and run west update
from the project root to retrieve the latest version of zscilib from Github, or whatever revision was specified above.
4. Folgende Parameter wurden in der .conf ergänzt:
CONFIG_FLOAT=y CONFIG_FP_SHARING=y CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_ZSL=y CONFIG_ZSL_PLATFORM_OPT=2 CONFIG_ZSL_SINGLE_PRECISION=y CONFIG_ZSL_VECTOR_INLINE=n CONFIG_ZSL_MATRIX_INLINE=n CONFIG_ZSL_BOUNDS_CHECKS=y