mbed-os github

Dependencies:   ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep

Fork of ARNSRS_testDFU by POTLESS

Files at this revision

API Documentation at this revision

Comitter:
potless
Date:
Wed Jul 11 12:32:14 2018 +0000
Parent:
64:a85cddb22fff
Child:
66:fa183b065efb
Commit message:
M?J pr?paration test 23 juillet

Changed in this revision

Faulhaber.lib Show annotated file Show diff for this revision Revisions of this file
PID.lib Show annotated file Show diff for this revision Revisions of this file
Sensor_Head_RevB_3.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Faulhaber.lib	Tue Jul 10 16:35:57 2018 +0000
+++ b/Faulhaber.lib	Wed Jul 11 12:32:14 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/POTLESS/code/Faulhaber/#561d011b4c38
+https://os.mbed.com/teams/POTLESS/code/Faulhaber/#25604f8e713c
--- a/PID.lib	Tue Jul 10 16:35:57 2018 +0000
+++ b/PID.lib	Wed Jul 11 12:32:14 2018 +0000
@@ -1,1 +1,1 @@
-http://os.mbed.com/teams/POTLESS/code/PID/#cd24b2d90d76
+http://os.mbed.com/teams/POTLESS/code/PID/#c364844f2f17
--- a/Sensor_Head_RevB_3.lib	Tue Jul 10 16:35:57 2018 +0000
+++ b/Sensor_Head_RevB_3.lib	Wed Jul 11 12:32:14 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/POTLESS/code/Sensor_Head_RevB_3/#4430eb1eadfb
+https://os.mbed.com/teams/POTLESS/code/Sensor_Head_RevB_3/#6df6195797f5
--- 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