richard misi
/
STM32F303-ESSAI-DS3231-16102018
Essai ds3132
objet.h@0:13c98588f2fc, 2018-10-17 (annotated)
- Committer:
- RCMISbed
- Date:
- Wed Oct 17 12:01:00 2018 +0000
- Revision:
- 0:13c98588f2fc
essai ds3132
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RCMISbed | 0:13c98588f2fc | 1 | |
RCMISbed | 0:13c98588f2fc | 2 | #include <string> |
RCMISbed | 0:13c98588f2fc | 3 | |
RCMISbed | 0:13c98588f2fc | 4 | //1- Definition/ Constantes |
RCMISbed | 0:13c98588f2fc | 5 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
RCMISbed | 0:13c98588f2fc | 6 | |
RCMISbed | 0:13c98588f2fc | 7 | #define wBUFFER 300 // Processus principal/ Trame/ Profondeur MAX du buffer de donnees (exprimé en caracteres) |
RCMISbed | 0:13c98588f2fc | 8 | #define wDTRAME 6 // Processus principal/ Trame/ Nombre de donnees MAX par trame |
RCMISbed | 0:13c98588f2fc | 9 | // Definition/ Constante/ Nombre d'objet Event MAX |
RCMISbed | 0:13c98588f2fc | 10 | #define nbEVENTMAX 12 |
RCMISbed | 0:13c98588f2fc | 11 | |
RCMISbed | 0:13c98588f2fc | 12 | // Definition/ Constante/ Nombre de LED intégrées MAX |
RCMISbed | 0:13c98588f2fc | 13 | #define nbLEDMAX 4 // Carte/ nombre Max LED |
RCMISbed | 0:13c98588f2fc | 14 | |
RCMISbed | 0:13c98588f2fc | 15 | // Definition/ Constante/ Nombre de Moteurs MAX |
RCMISbed | 0:13c98588f2fc | 16 | #define nbMOTORMAX 2 |
RCMISbed | 0:13c98588f2fc | 17 | |
RCMISbed | 0:13c98588f2fc | 18 | // Definition/ Constante/ Nombre de SERVO MAX |
RCMISbed | 0:13c98588f2fc | 19 | #define nbSERVOMAX 2 |
RCMISbed | 0:13c98588f2fc | 20 | |
RCMISbed | 0:13c98588f2fc | 21 | //Definition/ Parametrage/ GPS/ Parcours/ Nombre maximal de WP |
RCMISbed | 0:13c98588f2fc | 22 | #define nbWPMAX 100 // Parcours GPS/ Nombre de Way Point Maximum enregistrés |
RCMISbed | 0:13c98588f2fc | 23 | |
RCMISbed | 0:13c98588f2fc | 24 | //Definition/ Constante/ Nombre d'objet PID MAX |
RCMISbed | 0:13c98588f2fc | 25 | #define nbPIDMAX 2 |
RCMISbed | 0:13c98588f2fc | 26 | |
RCMISbed | 0:13c98588f2fc | 27 | //Definition/ Constante/ Nombre d'objet commande.axe |
RCMISbed | 0:13c98588f2fc | 28 | #define nbAXEMAX 2 |
RCMISbed | 0:13c98588f2fc | 29 | |
RCMISbed | 0:13c98588f2fc | 30 | //Definition/ Constante/ ojet PAD/ nb axe MAX et nb SW MAX |
RCMISbed | 0:13c98588f2fc | 31 | #define padNBAXEMAX 2 |
RCMISbed | 0:13c98588f2fc | 32 | #define padNBSWMAX 4 |
RCMISbed | 0:13c98588f2fc | 33 | |
RCMISbed | 0:13c98588f2fc | 34 | //Definition/ Constante/ Nombre Parametres MAX |
RCMISbed | 0:13c98588f2fc | 35 | #define nbPARAMAX 11 |
RCMISbed | 0:13c98588f2fc | 36 | |
RCMISbed | 0:13c98588f2fc | 37 | |
RCMISbed | 0:13c98588f2fc | 38 | // Definition/ Protocole/ Constantes/ Mode |
RCMISbed | 0:13c98588f2fc | 39 | #define mSTB 0 // Mode/ STANDBY |
RCMISbed | 0:13c98588f2fc | 40 | #define mSTP 1 // Mode/ STOP |
RCMISbed | 0:13c98588f2fc | 41 | #define mMAN 2 // Mode/ MANUAL |
RCMISbed | 0:13c98588f2fc | 42 | #define mPA 4 // Mode/ Pilote Automatique |
RCMISbed | 0:13c98588f2fc | 43 | #define mWP 8 // Mode/ Enregistrement WP |
RCMISbed | 0:13c98588f2fc | 44 | #define mRAZ 64 // Mode/ Remise à 0 des commandes |
RCMISbed | 0:13c98588f2fc | 45 | #define mCHG 128 // Mode/ recharge Accumulateurs |
RCMISbed | 0:13c98588f2fc | 46 | |
RCMISbed | 0:13c98588f2fc | 47 | |
RCMISbed | 0:13c98588f2fc | 48 | |
RCMISbed | 0:13c98588f2fc | 49 | //2- Definition/ Type de donnees |
RCMISbed | 0:13c98588f2fc | 50 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
RCMISbed | 0:13c98588f2fc | 51 | |
RCMISbed | 0:13c98588f2fc | 52 | //2.1- Definition/ Type/ global/ data/ objet GLOBAL |
RCMISbed | 0:13c98588f2fc | 53 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 54 | bool fValid; // Validation module |
RCMISbed | 0:13c98588f2fc | 55 | string designation; // Identification produit |
RCMISbed | 0:13c98588f2fc | 56 | string version; // Version produit (v.xx/yy , xx: annee, yy: semaine dans l'annee) |
RCMISbed | 0:13c98588f2fc | 57 | bool debug; // Activation du mode DEBUG |
RCMISbed | 0:13c98588f2fc | 58 | int nbLED; // Nombre LED integrées |
RCMISbed | 0:13c98588f2fc | 59 | int tBATT; // Batterie/ Structure Chimique |
RCMISbed | 0:13c98588f2fc | 60 | int NbElement; // Batterie/ Nombre Elements |
RCMISbed | 0:13c98588f2fc | 61 | int Dynmin; // Variables/ dynamique minimum |
RCMISbed | 0:13c98588f2fc | 62 | int DynMAX; // Variables/ dynamique MAXIMUM |
RCMISbed | 0:13c98588f2fc | 63 | float TSample; // Periode d'echantillonnage du processus (exprimée en secondes) |
RCMISbed | 0:13c98588f2fc | 64 | int TPWM; // periode PWM (exprimée en micro secondes) |
RCMISbed | 0:13c98588f2fc | 65 | int USBBaud; // UART sur USB BaudRate |
RCMISbed | 0:13c98588f2fc | 66 | int UART1Baud; // UART 1 BaudRate |
RCMISbed | 0:13c98588f2fc | 67 | int UART2Baud; // UART 2 BaudRate |
RCMISbed | 0:13c98588f2fc | 68 | int I2CBaud; // Frequence bus I2C |
RCMISbed | 0:13c98588f2fc | 69 | int CANBaud; // Frequence bus CAN |
RCMISbed | 0:13c98588f2fc | 70 | struct{ // Event |
RCMISbed | 0:13c98588f2fc | 71 | bool fValid; // Event/ Validité |
RCMISbed | 0:13c98588f2fc | 72 | bool fPeriode; // Event/ Periodicité |
RCMISbed | 0:13c98588f2fc | 73 | int wdt; // Event/ WatchDog |
RCMISbed | 0:13c98588f2fc | 74 | int wdtMAX; // Event/ WatchDog MAX |
RCMISbed | 0:13c98588f2fc | 75 | }event[nbEVENTMAX]; |
RCMISbed | 0:13c98588f2fc | 76 | } GLOBAL_t; |
RCMISbed | 0:13c98588f2fc | 77 | |
RCMISbed | 0:13c98588f2fc | 78 | |
RCMISbed | 0:13c98588f2fc | 79 | //2.2- Definition/ Type/ objet TRAME |
RCMISbed | 0:13c98588f2fc | 80 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 81 | bool fValid; // Validation module |
RCMISbed | 0:13c98588f2fc | 82 | int wdtTX; // WatchDog Emission |
RCMISbed | 0:13c98588f2fc | 83 | int wdtRX; // WatchDog Reception |
RCMISbed | 0:13c98588f2fc | 84 | int pcar; // Pointeur de caracteres |
RCMISbed | 0:13c98588f2fc | 85 | char sb; // Protocole communication/ Start Beacon: |
RCMISbed | 0:13c98588f2fc | 86 | char dlb; // Protocole communication/ Delimiter Beacon |
RCMISbed | 0:13c98588f2fc | 87 | char eb; // Protocole communication/ End Beacon |
RCMISbed | 0:13c98588f2fc | 88 | int id; // Mot identificateur de trame |
RCMISbed | 0:13c98588f2fc | 89 | char rx[wBUFFER]; // tableau des caracteres recus |
RCMISbed | 0:13c98588f2fc | 90 | char tx[wBUFFER]; // tableau des caracteres envoyés |
RCMISbed | 0:13c98588f2fc | 91 | bool fSB, fEB; // status startB et endB |
RCMISbed | 0:13c98588f2fc | 92 | int c[wDTRAME]; // Data Consigne |
RCMISbed | 0:13c98588f2fc | 93 | int r[wDTRAME]; // Data Reponse |
RCMISbed | 0:13c98588f2fc | 94 | int nbdata; // Nombre de Data sur la Trame |
RCMISbed | 0:13c98588f2fc | 95 | } TRAME_t; |
RCMISbed | 0:13c98588f2fc | 96 | |
RCMISbed | 0:13c98588f2fc | 97 | |
RCMISbed | 0:13c98588f2fc | 98 | |
RCMISbed | 0:13c98588f2fc | 99 | //2.3- Definition/ Type/ objet COMMANDE |
RCMISbed | 0:13c98588f2fc | 100 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 101 | struct{ |
RCMISbed | 0:13c98588f2fc | 102 | bool fValid; // Validation Module |
RCMISbed | 0:13c98588f2fc | 103 | float in; // Variable Entree |
RCMISbed | 0:13c98588f2fc | 104 | float out; // Variable Sortie |
RCMISbed | 0:13c98588f2fc | 105 | float dzm; // Valeur Dead Zone inferieure (0..1) |
RCMISbed | 0:13c98588f2fc | 106 | float dzM; // Valeur Dead Zone supérieure (0..1) |
RCMISbed | 0:13c98588f2fc | 107 | float cti; // Valeur Constante de temps Integrale (0..1) |
RCMISbed | 0:13c98588f2fc | 108 | float ctf; // Valeur Constante de temps Proportionnelle (0..1) |
RCMISbed | 0:13c98588f2fc | 109 | float ctg; // Valeur Constante de Temps Filtre de sortie |
RCMISbed | 0:13c98588f2fc | 110 | float cgg; // Valeur Gain Filtre de sortie |
RCMISbed | 0:13c98588f2fc | 111 | float l; // Valeur calcul loi non lineaire |
RCMISbed | 0:13c98588f2fc | 112 | float i, i0; // Valeur calcul integral |
RCMISbed | 0:13c98588f2fc | 113 | float p; // Valeur calcul proportionnelle |
RCMISbed | 0:13c98588f2fc | 114 | float c; // Valeur calcul proportionnelle - integrale |
RCMISbed | 0:13c98588f2fc | 115 | float x, dx; // Valeur filtre passe bas |
RCMISbed | 0:13c98588f2fc | 116 | }axe[nbAXEMAX]; |
RCMISbed | 0:13c98588f2fc | 117 | } COMMANDE_t; |
RCMISbed | 0:13c98588f2fc | 118 | |
RCMISbed | 0:13c98588f2fc | 119 | |
RCMISbed | 0:13c98588f2fc | 120 | |
RCMISbed | 0:13c98588f2fc | 121 | |
RCMISbed | 0:13c98588f2fc | 122 | |
RCMISbed | 0:13c98588f2fc | 123 | //2.4- Definition/ Type/ objet MUX (multiplexeur) |
RCMISbed | 0:13c98588f2fc | 124 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 125 | bool fValid; // Validation Module |
RCMISbed | 0:13c98588f2fc | 126 | float in0x, in0y, in1x, in1y, in2x, in2y, // Variables d'état d'entree du module: variables d'entree |
RCMISbed | 0:13c98588f2fc | 127 | outx, outy; // Variables d'état de sortie du module: variables de sortie |
RCMISbed | 0:13c98588f2fc | 128 | unsigned char sel; // Variables d'état d'entree du module: selection de la variable d'entrée |
RCMISbed | 0:13c98588f2fc | 129 | unsigned char Status; // Variables Status du module s0:, s1:, s2:, s3:, s4:, s5:, s6:, s7: |
RCMISbed | 0:13c98588f2fc | 130 | }MUX_t; |
RCMISbed | 0:13c98588f2fc | 131 | |
RCMISbed | 0:13c98588f2fc | 132 | |
RCMISbed | 0:13c98588f2fc | 133 | |
RCMISbed | 0:13c98588f2fc | 134 | //2.5- Definition/ Type/ objet ENERGIE |
RCMISbed | 0:13c98588f2fc | 135 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 136 | bool fValid, fCHARGE, fVhigh, fVlow, fIhigh, fIlow, fFailed; |
RCMISbed | 0:13c98588f2fc | 137 | unsigned char tBATT; // Type de batterie (1: LEAD, 2: NIMH, 2: LION, 3: LIPO) // Definition/ Parametres/ Type de batterie |
RCMISbed | 0:13c98588f2fc | 138 | unsigned char NbElement; // Nombre Element en Serie |
RCMISbed | 0:13c98588f2fc | 139 | int seqPointer; // Sequenceur du processus de charge |
RCMISbed | 0:13c98588f2fc | 140 | float tension, courant; // Variables differentielles Energie, Tension, Courant Acquisition |
RCMISbed | 0:13c98588f2fc | 141 | float dE,dV,dI; // Variables differentielles Energie, Tension, Courant Filtrage |
RCMISbed | 0:13c98588f2fc | 142 | float E, E0, V, I; // Variables Energie, Tension, Courant |
RCMISbed | 0:13c98588f2fc | 143 | float VMax, Vmin, IMax, Imin; // Parametres internes |
RCMISbed | 0:13c98588f2fc | 144 | int wPWM, pPWM; // Largeur Impulsion, Periode PWM (chargeur) |
RCMISbed | 0:13c98588f2fc | 145 | unsigned char Status; // Variables Status du module s0: fValid, s1: fCharge, s2:fVlow, s3:fVhigh, s4:fIlow, s5:fIhigh, s6: NA, s7: fFailed |
RCMISbed | 0:13c98588f2fc | 146 | } ENERGY_t; |
RCMISbed | 0:13c98588f2fc | 147 | |
RCMISbed | 0:13c98588f2fc | 148 | |
RCMISbed | 0:13c98588f2fc | 149 | //2.6- Definition/ Type/ objet GPS |
RCMISbed | 0:13c98588f2fc | 150 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 151 | bool fValid, fLocked, fFailed; // Validation Module, Trame Valide |
RCMISbed | 0:13c98588f2fc | 152 | int baud; // BaudRate |
RCMISbed | 0:13c98588f2fc | 153 | int TSample; // Periode rafraichissement des trames |
RCMISbed | 0:13c98588f2fc | 154 | int dop; // Variable Indice Dilution Satellites |
RCMISbed | 0:13c98588f2fc | 155 | double utc, lng, lat, hdg, spd; // Variables: Temps Universel (UTC), Longitude (LNG), Latitude (LAT), Cap (HDG), Vitesse Air (SPD) |
RCMISbed | 0:13c98588f2fc | 156 | int speedmin; |
RCMISbed | 0:13c98588f2fc | 157 | unsigned char Status; //Variables Status du module s0:fValid, s1:fLocked, s2:na, s3:na, s4:na, s5:na, s6:na, s7:fFailed |
RCMISbed | 0:13c98588f2fc | 158 | } GPS_t; |
RCMISbed | 0:13c98588f2fc | 159 | |
RCMISbed | 0:13c98588f2fc | 160 | |
RCMISbed | 0:13c98588f2fc | 161 | //2.7- Definition/ Type/ objet IMU |
RCMISbed | 0:13c98588f2fc | 162 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 163 | bool fValid, fFailed; // Validation module |
RCMISbed | 0:13c98588f2fc | 164 | float roll, pitch, yaw, temp; // Variables attitude; Roulis, Tangage, Lacet, Temperature |
RCMISbed | 0:13c98588f2fc | 165 | float q0, q1, q2, q3; // Variables attitude/ Quarternions |
RCMISbed | 0:13c98588f2fc | 166 | float liax, liay, liaz; // Variables acceleration lineaire x, y, z |
RCMISbed | 0:13c98588f2fc | 167 | float grvx, grvy, grvz; // Variables gravité |
RCMISbed | 0:13c98588f2fc | 168 | float gyrox, gyroy, gyroz; // Variables gyroscopiques x, y, z |
RCMISbed | 0:13c98588f2fc | 169 | float magx, magy, magz; // Variables magnetometriques x, y, z |
RCMISbed | 0:13c98588f2fc | 170 | unsigned char Status; // Variables Status module. s0:fValid, s1:fLocked, s2:na, s3:na, s4:na, s5:na, s6:na, s7:fFailed |
RCMISbed | 0:13c98588f2fc | 171 | } IMU_t; |
RCMISbed | 0:13c98588f2fc | 172 | |
RCMISbed | 0:13c98588f2fc | 173 | |
RCMISbed | 0:13c98588f2fc | 174 | //2.8- Definition/ Type/ objet PA (pilote automatique) |
RCMISbed | 0:13c98588f2fc | 175 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 176 | bool fValid, fGPSLocked, fWPLocked, fDmin, fDMax, fFailed; |
RCMISbed | 0:13c98588f2fc | 177 | double wLNG, wLAT, // Variables d'état d'entree du module: Coordonnnees Consigne (WayPoint à rejoindre) |
RCMISbed | 0:13c98588f2fc | 178 | mLNG, mLAT; // Variables d'état d'entree du module: Coordonnees reponse (mesure GPS) |
RCMISbed | 0:13c98588f2fc | 179 | float mSPD, // Variables d'état d'entree du module: Vitesse (km/h) (mesure GPS) |
RCMISbed | 0:13c98588f2fc | 180 | mHDG, // Variables d'état d'entree du module: Cap (deg) (mesure GPS) |
RCMISbed | 0:13c98588f2fc | 181 | CtG, // Cap à suivre au WP (calculé) |
RCMISbed | 0:13c98588f2fc | 182 | DtG, // Distance à parcourir au WP (calculée) |
RCMISbed | 0:13c98588f2fc | 183 | cPowerMax, // Niveau de puissance Max (0 .. 1) |
RCMISbed | 0:13c98588f2fc | 184 | Dmin, DMax, // Distance Max et minau WP |
RCMISbed | 0:13c98588f2fc | 185 | Kp, // Correction/ Gain Proportionnel (exprimé en % 0..300) |
RCMISbed | 0:13c98588f2fc | 186 | outx, outy; // Variables d'état de sortie du module |
RCMISbed | 0:13c98588f2fc | 187 | unsigned char Status; // Variables Status du module s0: fValid, s1: fGPSLocked, s2: fWPLocked, s3:fDmin, s4:fDMax, s5: NA, s6: NA,s7: fFailed |
RCMISbed | 0:13c98588f2fc | 188 | } PA_t; |
RCMISbed | 0:13c98588f2fc | 189 | |
RCMISbed | 0:13c98588f2fc | 190 | |
RCMISbed | 0:13c98588f2fc | 191 | //2.9- Definition/ Type/ objet DIGITAL (Accessoire) |
RCMISbed | 0:13c98588f2fc | 192 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 193 | bool fValid; // Validation Module |
RCMISbed | 0:13c98588f2fc | 194 | unsigned int cDigital; // Variables d'état d'entree du module (c0: Klaxon, c1: Phare) |
RCMISbed | 0:13c98588f2fc | 195 | unsigned int rDigital; // Variables d'état de sortie du module (c0: Klaxon, c1: Phare) |
RCMISbed | 0:13c98588f2fc | 196 | unsigned char Status; // Variable Status du module s0:, s1:, s2:, s3:, s4:, s5:, s6:, s7: |
RCMISbed | 0:13c98588f2fc | 197 | }DIGITAL_t; |
RCMISbed | 0:13c98588f2fc | 198 | |
RCMISbed | 0:13c98588f2fc | 199 | |
RCMISbed | 0:13c98588f2fc | 200 | //2.10- Definition/ Type/ objet SERVO |
RCMISbed | 0:13c98588f2fc | 201 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 202 | bool fValid; // Validation Module |
RCMISbed | 0:13c98588f2fc | 203 | int c; // Variables d'état d'entree du module/ Variable (0 .. 1) |
RCMISbed | 0:13c98588f2fc | 204 | float x, dx, tSERVO; // Variables d'état Filtre x, dx/ constante de temps du filtre |
RCMISbed | 0:13c98588f2fc | 205 | int r; // Variables d'état de sortie du module/ Variable (0 .. 1) |
RCMISbed | 0:13c98588f2fc | 206 | int pmin; // Constante/ valeur position minimum |
RCMISbed | 0:13c98588f2fc | 207 | int pmax; // Constante/ valeur position maximum |
RCMISbed | 0:13c98588f2fc | 208 | unsigned char Status; // Variable Status du module s0:, s1:, s2:, s3:, s4:, s5:, s6:, s7: |
RCMISbed | 0:13c98588f2fc | 209 | } SERVO_t; |
RCMISbed | 0:13c98588f2fc | 210 | |
RCMISbed | 0:13c98588f2fc | 211 | //2.11- Definition/ Type/ objet LOI |
RCMISbed | 0:13c98588f2fc | 212 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 213 | bool fValid; // Validation Module |
RCMISbed | 0:13c98588f2fc | 214 | float inx; // Variable/ Entree/ Power |
RCMISbed | 0:13c98588f2fc | 215 | float iny; // Variable/ Entree/ Teta |
RCMISbed | 0:13c98588f2fc | 216 | float outx; // Variable/ Sortie/ Gauche |
RCMISbed | 0:13c98588f2fc | 217 | float outy; // Variable/ Sortie/ Droit |
RCMISbed | 0:13c98588f2fc | 218 | unsigned char Status; // Variable Status du module s0:, s1:, s2:, s3:, s4:, s5:, s6:, s7: |
RCMISbed | 0:13c98588f2fc | 219 | } LAW_t; |
RCMISbed | 0:13c98588f2fc | 220 | |
RCMISbed | 0:13c98588f2fc | 221 | |
RCMISbed | 0:13c98588f2fc | 222 | |
RCMISbed | 0:13c98588f2fc | 223 | //2.12- Definition/ Type/ objet filtre PID |
RCMISbed | 0:13c98588f2fc | 224 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 225 | bool fValid; // Filtre PID/ Validite |
RCMISbed | 0:13c98588f2fc | 226 | float inc; // Filtre PID/ Variable/ Consigne |
RCMISbed | 0:13c98588f2fc | 227 | float inr; // Filtre PID/ Variable/ FeedBack |
RCMISbed | 0:13c98588f2fc | 228 | float eM; // Filtre PID/ Variable/ Erreur (Consigne- Feedback) |
RCMISbed | 0:13c98588f2fc | 229 | float eMp; |
RCMISbed | 0:13c98588f2fc | 230 | float eMd; |
RCMISbed | 0:13c98588f2fc | 231 | float eMd0; |
RCMISbed | 0:13c98588f2fc | 232 | float uMi; |
RCMISbed | 0:13c98588f2fc | 233 | float uMi0; |
RCMISbed | 0:13c98588f2fc | 234 | float uMd; |
RCMISbed | 0:13c98588f2fc | 235 | float uMd0; |
RCMISbed | 0:13c98588f2fc | 236 | float out; // Filtre PID/ Variable/ Sortie |
RCMISbed | 0:13c98588f2fc | 237 | float cPID1; // Filtre PID/ Constante/1/ |
RCMISbed | 0:13c98588f2fc | 238 | float cPID2; // Filtre PID/ Constante/2/ |
RCMISbed | 0:13c98588f2fc | 239 | float cPID3; // Filtre PID/ Constante/3/ |
RCMISbed | 0:13c98588f2fc | 240 | float cPID4; // Filtre PID/ Constante/4/ |
RCMISbed | 0:13c98588f2fc | 241 | float cPID5; // Filtre PID/ Constante/5/ |
RCMISbed | 0:13c98588f2fc | 242 | float cPID6; // Filtre PID/ Constante/6/ |
RCMISbed | 0:13c98588f2fc | 243 | unsigned char Status; // Filtre PID/ Variable Status du module s0:, s1:, s2:, s3:, s4:, s5:, s6:, s7: |
RCMISbed | 0:13c98588f2fc | 244 | } PID_t; |
RCMISbed | 0:13c98588f2fc | 245 | |
RCMISbed | 0:13c98588f2fc | 246 | |
RCMISbed | 0:13c98588f2fc | 247 | //2.13- Definition/ Type/ objet MOTEUR |
RCMISbed | 0:13c98588f2fc | 248 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 249 | bool fValid; // Validite Module |
RCMISbed | 0:13c98588f2fc | 250 | float in; // Variable d'état/ entrée/ puissance (0..1) |
RCMISbed | 0:13c98588f2fc | 251 | float dx, x; // Variables d'etat/ interne / Filtre Passe Bas |
RCMISbed | 0:13c98588f2fc | 252 | float out; // Variables d'état/ sortie / puissance (0.. 1) |
RCMISbed | 0:13c98588f2fc | 253 | float tMOTOR; // Constante de temps/ Filtre Passe Bas |
RCMISbed | 0:13c98588f2fc | 254 | float gMOTOR; // Constante/ Gain/ Filtre Passe Bas |
RCMISbed | 0:13c98588f2fc | 255 | unsigned char Status; // Variable Status du module s0:, s1:, s2:, s3:, s4:, s5:, s6:, s7: |
RCMISbed | 0:13c98588f2fc | 256 | } MOTOR_t; |
RCMISbed | 0:13c98588f2fc | 257 | |
RCMISbed | 0:13c98588f2fc | 258 | |
RCMISbed | 0:13c98588f2fc | 259 | |
RCMISbed | 0:13c98588f2fc | 260 | //2.14- Definition/ Type/ objet TRACK |
RCMISbed | 0:13c98588f2fc | 261 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 262 | bool fValid; // TRACK/ validite/ module |
RCMISbed | 0:13c98588f2fc | 263 | bool fRecord; // TRACK/ Acquisition/ En cours |
RCMISbed | 0:13c98588f2fc | 264 | int nbWP; // TRACK/ nombre WP |
RCMISbed | 0:13c98588f2fc | 265 | int pWP; // TRACK/ pointeur WP |
RCMISbed | 0:13c98588f2fc | 266 | struct{ // TRACK/ structure WP |
RCMISbed | 0:13c98588f2fc | 267 | bool fValid; // wp/ valide |
RCMISbed | 0:13c98588f2fc | 268 | double lat, lng; // wp/ Coordonnees Geographiques |
RCMISbed | 0:13c98588f2fc | 269 | }wp[nbWPMAX]; |
RCMISbed | 0:13c98588f2fc | 270 | int Status; // wp/ status |
RCMISbed | 0:13c98588f2fc | 271 | } TRACK_t; |
RCMISbed | 0:13c98588f2fc | 272 | |
RCMISbed | 0:13c98588f2fc | 273 | |
RCMISbed | 0:13c98588f2fc | 274 | |
RCMISbed | 0:13c98588f2fc | 275 | //2.15- Definition/ Type/ objet MOBILE |
RCMISbed | 0:13c98588f2fc | 276 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 277 | bool fValid; // Mobile/ Validite |
RCMISbed | 0:13c98588f2fc | 278 | int cWDTRX; // Mobile/ Contante/ WatchDog RX |
RCMISbed | 0:13c98588f2fc | 279 | float inx, iny, outx, outy; // Mobile/ Commande: Niveau de puissance vectorielle: Amplidude/ Phase exprimé de 0 à 100% |
RCMISbed | 0:13c98588f2fc | 280 | int cMODE, rMODE; // Mobile/ Mode de Fonctionnement |
RCMISbed | 0:13c98588f2fc | 281 | double lng, lat, alt, speed, head; // Mobile/ Variables localisation (GPS) |
RCMISbed | 0:13c98588f2fc | 282 | float roll, pitch, yaw, altitude; // Mobile/ Variables attitude (IMU) |
RCMISbed | 0:13c98588f2fc | 283 | int Status; // Mobile/ Status Module |
RCMISbed | 0:13c98588f2fc | 284 | } MOBILE_t; |
RCMISbed | 0:13c98588f2fc | 285 | |
RCMISbed | 0:13c98588f2fc | 286 | |
RCMISbed | 0:13c98588f2fc | 287 | //2.16- Definition/ objet PAD |
RCMISbed | 0:13c98588f2fc | 288 | typedef struct{ |
RCMISbed | 0:13c98588f2fc | 289 | bool fValid; |
RCMISbed | 0:13c98588f2fc | 290 | struct{ |
RCMISbed | 0:13c98588f2fc | 291 | float in; // Variable Entree |
RCMISbed | 0:13c98588f2fc | 292 | float out; // Variable Sortie |
RCMISbed | 0:13c98588f2fc | 293 | int scB; // Pourcentage Proportionnal- Integral (0..100) sc=0: Commande Integrale pure .... sc= 100: Commande Proportionnelle pure |
RCMISbed | 0:13c98588f2fc | 294 | int dzB; // Pourcentage Dead Zone (0..100) |
RCMISbed | 0:13c98588f2fc | 295 | int znlB; // Pourcentage Zone Non Lineaire (0..100) |
RCMISbed | 0:13c98588f2fc | 296 | float ctiB; // Pourcentage Constante de temps loi integrale (0..100) |
RCMISbed | 0:13c98588f2fc | 297 | float gainI; // Gain Integrale deuxieme zone lineaire |
RCMISbed | 0:13c98588f2fc | 298 | float ctfB; // Pourcentage Constante de temps loi proportionnelle (0..100) |
RCMISbed | 0:13c98588f2fc | 299 | float sc; // Valeur Proportionnel Integral |
RCMISbed | 0:13c98588f2fc | 300 | float dzm; // Valeur Dead Zone inferieure |
RCMISbed | 0:13c98588f2fc | 301 | float dzM; // Valeur Dead Zone supérieure |
RCMISbed | 0:13c98588f2fc | 302 | float znlm; // Valeur Non Linearite inferieure |
RCMISbed | 0:13c98588f2fc | 303 | float znlM; // Valeur Non Linearite supérieure |
RCMISbed | 0:13c98588f2fc | 304 | float cti; // Valeur Constante de temps Integrale |
RCMISbed | 0:13c98588f2fc | 305 | float ctf; // Valeur Constante de temps Proportionnelle |
RCMISbed | 0:13c98588f2fc | 306 | float l; // Valeur calcul loi non lineaire |
RCMISbed | 0:13c98588f2fc | 307 | float i, i0; // Valeur calcul integral |
RCMISbed | 0:13c98588f2fc | 308 | float p; // Valeur calcul proportionnelle |
RCMISbed | 0:13c98588f2fc | 309 | // float fm[5]; // Valeur filtre moyenneur |
RCMISbed | 0:13c98588f2fc | 310 | float x, dX, X; // Valeur filtre passe bas |
RCMISbed | 0:13c98588f2fc | 311 | }axe[padNBAXEMAX]; |
RCMISbed | 0:13c98588f2fc | 312 | struct{ |
RCMISbed | 0:13c98588f2fc | 313 | bool value; |
RCMISbed | 0:13c98588f2fc | 314 | }sw[padNBSWMAX]; |
RCMISbed | 0:13c98588f2fc | 315 | |
RCMISbed | 0:13c98588f2fc | 316 | // float roulis, tangage; |
RCMISbed | 0:13c98588f2fc | 317 | } PAD_t; |