mbed-os github
Dependencies: ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep
Fork of ARNSRS_testDFU by
Revision 86:02e83a215e4e, committed 2018-09-13
- Comitter:
- POTLESS_2
- Date:
- Thu Sep 13 14:54:20 2018 +0000
- Parent:
- 84:49f0acf09f67
- Commit message:
- reprise de compatibilit? windev
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Sep 10 09:33:38 2018 +0000 +++ b/main.cpp Thu Sep 13 14:54:20 2018 +0000 @@ -570,10 +570,12 @@ while (true) { if (FLAG_PID == 1 && EN_MODE_SECU == false) { control_Servo.setProcessValue(ppO2); + float pid_output = control_Servo.compute(); + DEBUG("\r\n pid_ouput = %f \r\n", pid_output); //Nouvelle sortie servo poumon si on est pas en mode SECU - Consigne_poumon = 90 - control_Servo.compute(); + Consigne_fuite = 90 - pid_output;//; // mode volets asservis (simule un seul moteur) - Consigne_fuite = 90 - Consigne_poumon; + Consigne_poumon = 90 - Consigne_fuite; //control_Servo.compute(); wait(RATE_PID); } } @@ -787,32 +789,32 @@ Kc = atof(numb); //control_Servo.reset(); control_Servo.setTunings(Kc, Ti, Td); - OUTPUT(" MAJ PID --> Kc = %f Ti = %f Td = %f\r\n", Kc, Ti, Td); + OUTPUT(" MAJ PID -- Kc = %f Ti = %f Td = %f\r\n", Kc, Ti, Td); } else if (0 == strcmp(com, "ti")) { Ti = atof(numb); //control_Servo.reset(); control_Servo.setTunings(Kc, Ti, Td); - OUTPUT(" MAJ PID --> Kc = %f Ti = %f Td = %f\r\n", Kc, Ti, Td); + OUTPUT(" MAJ PID -- Kc = %f Ti = %f Td = %f\r\n", Kc, Ti, Td); } else if (0 == strcmp(com, "td")) { Td = atof(numb); //control_Servo.reset(); control_Servo.setTunings(Kc, Ti, Td); - OUTPUT(" MAJ PID --> Kc = %f Ti = %f Td = %f\r\n", Kc, Ti, Td); + OUTPUT(" MAJ PID -- Kc = %f Ti = %f Td = %f\r\n", Kc, Ti, Td); } else if (0 == strcmp(com, "cons")) { consigne = atoi(numb); control_Servo.setSetPoint(consigne); - OUTPUT(" MAJ CONSIGNE PID --> Consigne = %d\r\n", consigne); + OUTPUT(" MAJ CONSIGNE PID -- Consigne = %d\r\n", consigne); } else if (0 == strcmp(com, "rate")) { RATE_PID = atof(numb); //control_Servo.reset(); control_Servo.setInterval(RATE_PID); - OUTPUT(" MAJ RATE PID --> Rate = %f\r\n", RATE_PID); + OUTPUT(" MAJ RATE PID -- Rate = %f\r\n", RATE_PID); } else if (0 == strcmp(com, "bornes")) { Borne = atof(numb); Min_Output = 0 + Borne; Max_Output = 90 - Borne; control_Servo.setOutputLimits(Min_Output, Max_Output); - OUTPUT(" MAJ LIMITE OUTPUT PID --> Min_Output = %f Max_Output = %f\r\n", Min_Output, Max_Output); + OUTPUT(" MAJ LIMITE OUTPUT PID -- Min_Output = %f Max_Output = %f\r\n", Min_Output, Max_Output); } else if (0 == strcmp(com, "dfu")) { OUTPUT(" Passage en DFU...\r\n"); FLAG_REC = false; @@ -900,7 +902,7 @@ HAL_Init(); __HAL_RCC_PWR_CLK_ENABLE(); HAL_PWR_EnableBkUpAccess(); - + //Vérifications Flag de démarrage UTILS::START_FLAG(); @@ -1094,8 +1096,7 @@ consigne, Commande_IHM ); - - + //Pour windev if (FLAG_WINDEV) { OUTPUT("%s\r\n", to_store);