Wifi Webserver to control the Speed of a motor using PID
Dependencies: 4DGL-uLCD-SE PID QEI SDFileSystem mbed
Revision 4:05e4ebafbcaf, committed 2015-11-28
- Comitter:
- electromotivated
- Date:
- Sat Nov 28 03:15:54 2015 +0000
- Parent:
- 3:2151f4b584b5
- Commit message:
- Added comments;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2151f4b584b5 -r 05e4ebafbcaf main.cpp --- a/main.cpp Fri Nov 27 15:29:13 2015 +0000 +++ b/main.cpp Sat Nov 28 03:15:54 2015 +0000 @@ -213,10 +213,10 @@ */ // printf("\r\n*************USER INPUT**********************************\r\n"); parse_input(buff, &setpoint, &kp, &ki, &kd); - setpoint = clip(setpoint, -999.99, 999.99); - kp = clip(kp, 0.00, 999.99); - ki = clip(ki, 0.00, 999.99); - kd = clip(kd, 0.00, 999.99); + setpoint = clip(setpoint, -999.99, 999.99); // -999.99 is max size that can be updated to webpage, i.e. field is 7 digits (see html) + kp = clip(kp, 0.00, 999.99); // 999.99 is max size that can be updated to webpage, i.e. field is 6 digits (see html) + ki = clip(ki, 0.00, 999.99); // 999.99 is max size that can be updated to webpage, i.e. field is 6 digits (see html) + kd = clip(kd, 0.00, 999.99); // 999.99 is max size that can be updated to webpage, i.e. field is 6 digits (see html) // printf("User Entered: \nSetpoint: %7.2f\nKp: %6.2f\nKi: %6.2f\nKd: %6.2f\n", setpoint, kp, ki, kd); pid.set_parameters(kp, ki, kd, Ts_init); // Updata PID params // printf("Updated to Kp: %1.2f Ki: %1.2f Kd: %1.2f Ts: %1.2f\r\n",