Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: buttoncontrol includeair includeair Oudverslag
Diff: controlandadjust.h
- Revision:
- 1:ece12a295ce3
- Parent:
- 0:041a12a5b315
- Child:
- 2:a1b6930947a9
diff -r 041a12a5b315 -r ece12a295ce3 controlandadjust.h
--- a/controlandadjust.h Tue Oct 06 10:58:04 2015 +0000
+++ b/controlandadjust.h Tue Oct 06 12:35:20 2015 +0000
@@ -4,6 +4,19 @@
#include "mbed.h"
#include <string>
+/** A library with a P-, PI- and PID-controller, useful for the module biorobotics
+*Example
+*@code
+*#include "mbed.h"
+*#include "controlandadjust.h"
+*#include "QEI.h" //This is found at https://developer.mbed.org/users/aberk/code/QEI/
+*
+*QEI Encoder (D13, D12, NC, 32); //Encoder with X2 encoding and 32 counts per revolution
+*Ticker controlticker;
+*controlandadjust mycontroller; //NO () AT THE END!!
+*AnalogIn pot1(A0);
+*
+*/
class controlandadjust
{
public:
@@ -11,11 +24,13 @@
void P(float error1, float error2 ,float Kp );
void PI(float error1, float error2, float Kp, float Ki,float Ts, float &error1_int, float &error2_int);
void PID(float error1, float error2, float Kp, float Ki,float Kd,float Ts,
- float &error1_int, float &error2_int, float &error1_prev, float &error2_prev);
+ float &error1_int, float &error2_int, float &error1_prev, float &error2_prev);
+ float motor1pwm();
+ float motor2pwm();
private:
- void verwerksignaal(float , float );
-
+ void verwerksignaal(float , float );
+
};
#endif
\ No newline at end of file