programa para hacer control PID simple
Fork of DebouncedIn_HelloWorld by
este programa permite hacer control PID simple, se configuran 4 parametros como: SETPOINT KP KI KD
USA 4 PULSADORES ASI AUMENTAR: aumenta el parametro seleccionado por menu DISMINUIR : disminuye el parametro seleccionado por menu MENU: cambia de menu o campo de ingreso ENTER: confirma el menu y se sale
DebouncedIn.h@1:83ffe66ee756, 2013-10-11 (annotated)
- Committer:
- tony63
- Date:
- Fri Oct 11 05:41:20 2013 +0000
- Revision:
- 1:83ffe66ee756
- Parent:
- 0:672241227e0d
programa que implementa un control PID usando cuatro pulsadores y un LCD; de 16x2 la libreria TextLCD.h debe ser modificada en las lineas 45 descomentar...y 101 comentar de lo contrario te compila con error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:672241227e0d | 1 | #include "mbed.h" |
chris | 0:672241227e0d | 2 | |
chris | 0:672241227e0d | 3 | class DebouncedIn { |
chris | 0:672241227e0d | 4 | public: |
chris | 0:672241227e0d | 5 | DebouncedIn(PinName in); |
chris | 0:672241227e0d | 6 | |
chris | 0:672241227e0d | 7 | int read (void); |
chris | 0:672241227e0d | 8 | operator int(); |
chris | 0:672241227e0d | 9 | |
chris | 0:672241227e0d | 10 | int rising(void); |
chris | 0:672241227e0d | 11 | int falling(void); |
chris | 0:672241227e0d | 12 | int steady(void); |
chris | 0:672241227e0d | 13 | |
chris | 0:672241227e0d | 14 | private : |
chris | 0:672241227e0d | 15 | // objects |
chris | 0:672241227e0d | 16 | DigitalIn _in; |
chris | 0:672241227e0d | 17 | Ticker _ticker; |
chris | 0:672241227e0d | 18 | |
chris | 0:672241227e0d | 19 | // function to take a sample, and update flags |
chris | 0:672241227e0d | 20 | void _sample(void); |
chris | 0:672241227e0d | 21 | |
chris | 0:672241227e0d | 22 | // counters and flags |
chris | 0:672241227e0d | 23 | int _samples; |
chris | 0:672241227e0d | 24 | int _output; |
chris | 0:672241227e0d | 25 | int _output_last; |
chris | 0:672241227e0d | 26 | int _rising_flag; |
chris | 0:672241227e0d | 27 | int _falling_flag; |
chris | 0:672241227e0d | 28 | int _state_counter; |
chris | 0:672241227e0d | 29 | |
chris | 0:672241227e0d | 30 | }; |
chris | 0:672241227e0d | 31 |