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.
Fork of b_NYP_humanoid by
Diff: control.h
- Revision:
- 4:99891561a38b
diff -r 1345f959c490 -r 99891561a38b control.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/control.h Fri May 25 09:00:15 2018 +0000
@@ -0,0 +1,54 @@
+#ifndef __CONTROL_H
+#define __CONTROL_H
+
+#define CONTROL_MODE_NONE 0
+#define CONTROL_MODE_ONOFF 1
+#define CONTROL_MODE_P 2
+#define CONTROL_MODE_PI 3
+#define CONTROL_MODE_PD 4
+#define CONTROL_MODE_PID 5
+
+typedef struct{
+ unsigned char input;
+
+ double presentvalue;
+
+ double setpoint;
+
+ double upperlimit;
+ double lowerlimit;
+
+ double upperdeadband;
+ double lowerdeadband;
+
+ unsigned char mode;
+ double gain_p;
+ double gain_i;
+ double gain_d;
+
+ double error;
+ double error_p;
+ double error_i;
+ double error_d;
+
+ double output;
+}CONTROLLER;
+
+void CONTROL_InputMode_Set(CONTROLLER* control, unsigned char input, double mode);
+void CONTROL_Setpoint_Set(CONTROLLER* control, double sp);
+void CONTROL_Gain_Set(CONTROLLER* control, double p, double i, double d);
+void CONTROL_Limit_Set(CONTROLLER* control, double upper, double lower);
+void CONTROL_Deadband_Set(CONTROLLER* control, double upper, double lower);
+void CONTROL_PresentValue_Set(CONTROLLER* control, double pv);
+double CONTROL_Output_Get(CONTROLLER* control);
+
+void CONTROL_OnOff(CONTROLLER* control);
+void CONTROL_P(CONTROLLER* control);
+void CONTROL_PID(CONTROLLER* control);
+void CONTROL_PI(CONTROLLER* control);
+void CONTROL_PD(CONTROLLER* control);
+
+void CONTROL_Config(void);
+void CONTROL_Task(void);
+
+#endif
