PID Sencillo - Primera Prueba

Dependencies:   Debounced TextLCD1 mbed

Revision:
1:ce04971eceb4
Parent:
0:ab047fb2215f
Child:
2:12dac32e2a8b
--- a/main.cpp	Wed Oct 30 16:02:44 2013 +0000
+++ b/main.cpp	Fri Nov 01 00:51:04 2013 +0000
@@ -621,9 +621,9 @@
            wait(2);
            // se imprimen los parches del control  *****************************************
            lcd.cls();
-           lcd.printf("Er%d",err);
+           lcd.printf("Error%d",err);
            lcd.locate(8,0);
-           lcd.printf("Me%d",med);
+           lcd.printf("Medida%d",med);
            lcd.locate(0,1);
            lcd.printf("Sp%d",sp);
            lcd.locate(8,1);
@@ -633,6 +633,7 @@
            // CICLO PRINCIPAL CONTROLADOR PID
            
            while(1) {
+           med=Vin;                      
                               //leer puerto analogo y asignar a med
            err = (sp-med);
            ap = kp*err;
@@ -646,9 +647,9 @@
            } 
            
            wait(.5);
-           lcd.locate(2,0);
+           lcd.locate(5,0);
            lcd.printf("%d",err);
-           lcd.locate(10,0);
+           lcd.locate(14,0);
            lcd.printf("%d",med);
            lcd.locate(2,1);
            lcd.printf("%d",sp);
@@ -656,6 +657,7 @@
            lcd.printf("%d",pid);
            
            
+           
            // se actualizan las variables *******************************************
            err_v = err;           
            // se verifica que pid sea positivo **************************************