mbed-os github
Dependencies: ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep
Fork of ARNSRS_testDFU by
Diff: main.cpp
- Revision:
- 65:c7d09a1fbef3
- Parent:
- 64:a85cddb22fff
- Child:
- 68:7f4ab9c03b32
diff -r a85cddb22fff -r c7d09a1fbef3 main.cpp --- a/main.cpp Tue Jul 10 16:35:57 2018 +0000 +++ b/main.cpp Wed Jul 11 12:32:14 2018 +0000 @@ -127,7 +127,7 @@ float Volet_DeadBand = 5; //Paramètre du PID -float Kc = 40; +float Kc = 80; float Ti = 0; float Td = 0; float RATE_PID = Ref_Time; @@ -135,8 +135,8 @@ int consigne = 210; float Max_Input = 1000; float Min_Input = 80; -float Max_Output = 85;//Vérifier la valeur pour angle à laisser ouvert... -float Min_Output = 5; +float Max_Output = 90;//Vérifier la valeur pour angle à laisser ouvert... +float Min_Output = 0; //Init PID PID control_Servo(Kc, Ti, Td, RATE_PID); @@ -315,7 +315,7 @@ HAL_PWREx_EnterSHUTDOWNMode(); } -void PILES_unpluged() +void PILES_unplugged() { DEBUG(" Les piles ont été débranchées.\n"); @@ -519,7 +519,7 @@ //Calcul des OTU //Calcul_OTU(); - + wait(Ref_Time); } } @@ -978,7 +978,7 @@ vusb_off_on.fall(&USB_unplugged); - vpiles_off_on.fall(&PILES_unpluged); + vpiles_off_on.fall(&PILES_unplugged); buzzer.beep(1000,0.3); wait_ms(500); @@ -1060,8 +1060,12 @@ //Update du PID if (FLAG_PID == 1 && EN_MODE_SECU == false) { control_Servo.setProcessValue(ppO2); - //Nouvelle sortie servo fuite si on est pas en mode SECU - Consigne_poumon = control_Servo.compute(); + //pour visu sur graph IDE arduino + DEBUG("ppo2 : %d , consigne : %d \r\n",ppO2, consigne); + //Nouvelle sortie servo poumon si on est pas en mode SECU + Consigne_poumon = 90-control_Servo.compute(); + // mode volets asservis (simule un seul moteur) + Consigne_fuite = Consigne_poumon-90; } //Arrêt du Timer mesurant le temps d'éxecution du code