Projet Réseau de capteurs 1 of 24 2/23/18, 12:39 PM
PRINTING DZSLIDES VIA IFRAMES file:///media/kerhoas/DATADRIVE1/COURS/WORKSPACE_WEB/print_sli... Architecture du Système Capteur de Pression MPL115A SPI Anémomètre SOMFY Timer Capteur de Luminosité / Distance VL6180X IMU 9 Axes Accelerometre / Gyroscope / Magnétomètre Invensense MPU9250 I2C I2C Carte µc ST-Nucleo CAN Bus Sonde PEAK PCAN-USB PC Host 2 of 24 IHM avec Qt 2/23/18, 12:39 PM
Carte Nucleo F103 gtkterm ou (excl) IHM file manager openocd Mass Storage Virtual Com port Debug Port 3 of 24 2/23/18, 12:39 PM
Carte Nucleo F103 Périphériques SPI Capteur de Pression MPL115A MOSI (PA7) MISO (PA6) SCK (PA5) NSS (CS) (PA4) Anémomètre SOMFY Timer TIM_CLK (PA8) 11 GPIO Expander Display Application INPUT (PC13) VL6180X Expansion Board DISPLAY_SEL GPIO0 SDA I2C SDA (PB9) VL6180x Application SCL SCK (PB8) GPIO1(Interrupt) Capteur de Luminosité / Distance VL6180X EXTI0 (PB0) IMU 9 Axes Accelerometre / Gyroscope / Magnétomètre Invensense MPU9250 I2C SDA (PB9) SCK (PB8) SPI1 Timer1 GPIO I2C1 EXTI0 I2C1 CORTEX M3 CORTEX M3 CORTEX M3 ST-LINK UART2 CAN UART2 CAN UART2 CAN PC (gtkterm) pour debug RX (PA11) SN65 CAN Transceiver TX (PA12) RX (PA11) SN65 CAN Transceiver TX (PA12) RX (PA11) SN65 CAN Transceiver TX (PA12) CAN_H CAN Bus CAN_L PC Sonde PEAK PCAN-USB Environnement de Développement Eclipse IDE Eclipse 4 of 24 2/23/18, 12:39 PM
Le Bus CAN Le bus CAN est un une laison série : asynchrone : pas de fil d horloge (les différents éléments connectés doivent être configurés avec le même débit half Duplex : on parle chacun son tour, à condition que le bus soit libre Node 1 Node 2 Node 3 Node n CAN Controller CAN Controller CAN Controller CAN Controller TX RX SN65HVD251 CAN Transceiver TX RX SN65HVD1050 CAN Transceiver TX RX SN65HVD233 CAN Transceiver SN65HVD257 CAN Transceiver R TERM R TERM 5 of 24 2/23/18, 12:39 PM
Le Bus CAN Format d une Trame de Données (Data Frame) 1 Start of Frame Arbitration Field RTR 0 0 0 0 Control Field DLC3 DLC0 Data Field 8N, 0 N 8 11 8 8 15 7 IDE RB0 DLC2 DLC1 CRC Field CRC Del 1 Ack Field ACK Slot Bit ACK Del 1 End of Frame 1 1 1 1 1 1 1 Inter frame Space 3 1 1 1 Bit de Start : Passage de 1 (état de repos) à 0 Adresse / Identifiant / champ d arbitrage Champ de Commande : Nombre d octets dans le champ de données Champ de données Champ de CRC : Calcul sur les données envoyées permettant de détecter des erreurs de transmission Champ de ACK : Tout message doit être acquité ; le destinataire doit forcer le bus à 0 Fin de Trame 6 of 24 2/23/18, 12:39 PM
Le Bus CAN Format d une Trame de Données (Data Frame) Capture d une Trame avec Analyseur Logique SALEAE : 7 of 24 2/23/18, 12:39 PM
Le Bus CAN Arbitrage node 1 S O R T F 10 9 8 7 6 5 4 3 2 1 0 R Control Data listening only node 1 is loosing the arbitration node 2 node 3 listening only node 2 is loosing the arbitration any data recessive result any data node 3 wins arbitration and transmits his data 8 of 24 2/23/18, 12:39 PM
Le Bus CAN REMARQUE : Format Standard/Etendu 1 Start of Frame Arbitration Field 0 0 0 0 Control Field DLC3 DLC0 Data Field 8N, 0 N 8 11 8 8 15 7 Standart Format Identifier (11 bits) RTR IDE RB0 DLC2 DLC1 CRC Field CRC Del 1 Ack Field ACK Slot Bit ACK Del 1 End of Frame 1 1 1 1 1 1 1 Inter frame Space 3 1 1 1 Extended Format Identifier (29 bits) 11 18 SRR IDE RTR 1 1 0 9 of 24 2/23/18, 12:39 PM
Le Bus CAN Filtrage 10 of 24 2/23/18, 12:39 PM
Le Bus CAN Modèle ISO du Bus CAN La norme CAN spécifie les couches Physique et Liaison de données uniquement. D autres protocoles (devicenet, canopen,..) spécifient les couches hautes. OSI Reference Layers Hardware Implementation Industry Standard CAN Networks SAE J1939, TTCAN, CAN Kingdom, DeviceNet, SDS, Application Presentation Microcontroller or DSP Session CAN Specification Bit encoding protocol, message identification, etc. Transport Network Data Link Layer CAN Controller ISO/SAE Physical Layer Specifications Electrical specifications: transceiver characteristics, connectors, cable, etc. Physical Layer CAN Transceiver CAN_H CAN_L 11 of 24 2/23/18, 12:39 PM
Le Bus CAN La Couche Physique Le bit Stuffing Trame à Stuffer Trame Stuffée Trame à Stuffer Trame Stuffée 12 of 24 2/23/18, 12:39 PM
Le Bus CAN La Couche Physique Une liaison différentielle Typical Bus Voltage (V) 1 2 3 4 CANH CANL V diff(d) V diff(r) Recessive Logic H Dominant Logic L Recessive Logic H Time, t Bus States 13 of 24 2/23/18, 12:39 PM
Le Bus CAN Les autres Trames Trame de requête (Request Frame) 1 Start of Frame Arbitration Field RTR 0 1 0 0 Control Field DLC3 DLC0 Data Field 8N, 0 N 8 11 8 8 15 7 IDE RB0 DLC2 DLC1 CRC Field CRC Del 1 Ack Field ACK Slot Bit ACK Del 1 End of Frame 1 1 1 1 1 1 1 IFS 7 1 1 1 14 of 24 2/23/18, 12:39 PM
Le Bus CAN Les autres Trames Trame d erreur (Error Frame) Error Flag 6 End of Frame 7 Inter frame Space 3 0 0 0 0 0 0 Rem: Bit Stuffing désactivé Reset+config 1 1 1 1 1 1 1 1 1 1 REC>127 ou TEC>127 Error Passive Error Active REC<127 ou TEC<127 TEC>255 Reset+config+reception of 128*11 recessive bits Bus Off 15 of 24 2/23/18, 12:39 PM
PRINTING DZSLIDES VIA IFRAMES file:///media/kerhoas/DATADRIVE1/COURS/WORKSPACE_WEB/print_sli... Capteur de Pression MPL115A1 Rappels : le Bus SPI 16 of 24 2/23/18, 12:39 PM
Capteur de Pression MPL115A1 Mesure de la pression SPI Commands Command to Write Convert Pressure and Temperature = 0x24 Command to Read Pressure ADC High byte = 0x80 Command to Read Pressure ADC Low byte = 0x82 Command to Read Temperature ADC High byte = 0x84 Command to Read Temperature ADC Low byte = 0x86 Command to Read Coefficient data byte 1 High byte = 0x88 Start Pressure and Temperature Conversion, Read raw Pressure: [CS=0],[0x24],[0x00],[CS=1],[3 ms Delay] [CS=0],[0x80],[0x00],[0x82],[0x00],[0x84],[0x00],[0x86],[0x00],[0x00],[CS=1] NOTE: Extra [0x00] at the end of each sequence to output the last data byte on the slave side of the SPI. 17 of 24 2/23/18, 12:39 PM
Anemomètre SOMFY 60 50 Vale urs du ve nt (Hz / km/h) Timer Anemo T1 Hz 40 30 20 10 0 0 5 10 15 20 25 30 km/h 35 40 45 50 55 60 TIM1_CLK Tick Timer T3 Te Interruption Tick Timer --> RAZ Timer Anemo t t t 18 of 24 2/23/18, 12:39 PM
Capteur de Luminosité / Distance VL6180x Rappels Bus I2C VL6180X Expansion Board DISPLAY_SEL 11 GPIO Expander Display Application GPIO0 SDA VL6180x Application SCL GPIO1(Interrupt) Capteur de Luminosité / Distance VL6180X I2C INPUT (PC13) SDA (PB9) SCK (PB8) EXTI0 (PB0) GPIO I2C1 EXTI0 CORTEX M3 19 of 24 2/23/18, 12:39 PM
Capteur Centrale Inertielle 9 axes Invensense MPU9250 +Z +Z +Y +X MPU-9250 +Y MPU-9250 +X +X Orientation of Axes of Sensitivity and Polarity of Rotation for Accelerometer ans Gyroscope +Z +Y Orientation of Axes of Sensitivity for Compass Block Diagram Self test X Accel ADC MPU-9250 Interrupt Status Register FIFO Slave I2C and SPI Serial Interface INT ncs AD0 / SDO SCL / SCLK Self test Self test Self test Self test Y Accel Z Accel X Gyro Y Gyro ADC ADC ADC ADC Signal Conditioning User & Config Registers Sensor Registers Master I2C Serial Interface Digital Motion Processor (DMP) Serial Interface Bypass Mux SDA / SDI AUX_CL AUX_DA FSYNC Self test Z Gyro ADC AK8963 Signal Conditioning Temp Sensor ADC ADC ADC ADC X Compass Y Compass Z Compass Charge Pump Bias & LDOs 20 of 24 2/23/18, 12:39 PM
Capteur Centrale Inertielle 9 axes Invensense MPU9250 Traitement des Données Angles d Euler Roulis (Roll) Φ (phi) X Y Tangage (pitch) Θ (theta) Z Lacet (yaw) Ψ (psi) Problème du Gimbal Lock (blocage de cardan) 21 of 24 2/23/18, 12:39 PM
Capteur Centrale Inertielle 9 axes Invensense MPU9250 Traitement des Données Quaternions X w V a b c Θ Z Repère Body Y Repère Fixe v u Q = [ ],,, q 0 q 1 q 2 q 3 θ 2 θ 2 Q = [ cos( ), a. sin( ), b. sin( ), c. sin( ) ] 1 Q k+1 = Q k +... 2 T e Ω k Q k θ 2 θ 2 22 of 24 2/23/18, 12:39 PM
Capteur Centrale Inertielle 9 axes Invensense MPU9250 Traitement des Données Algorithme de Madgwick Accélérations Repère Body γ γx γy γz Champ de Gravité Mesuré Champ de Gravité estimé Qk Calcul erreur de direction z-1 (retard) β S Girations Repère Body ω ωx ωy ωz Calcul Variation Quaternion Qk ΔQ Qk Normalisation Qk+1 z-1 (retard) Qk code madgwick.c 23 of 24 2/23/18, 12:39 PM
Déroulement du Projet Durée : 12UC Salle : E021 Cahier des Charges Liste des Objectifs IHM Tutoriel Qt Creator Bus Can et Qt > cf Qt Bus Can Affichage 3D des données du capteur MPU9250 > cf Qt OpenGL 24 of 24 2/23/18, 12:39 PM