sangbae Kim / QEI

Dependents:   BilateralTeleoperation

Revision:
1:f39ce45861fb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PID.h	Mon Sep 26 19:38:40 2022 +0000
@@ -0,0 +1,54 @@
+//Ben Katz, 2013
+//PID Controller class
+
+#include "mbed.h"
+#ifndef PID_H
+#define PID_H
+
+class PIDController{
+public:
+
+PIDController(float desired_position, float desired_torque, float p_gainp, float d_gainp, float i_gain_p, float p_gain_c, float i_gain_c);
+~PIDController();
+
+float goal_position;
+float current_position;
+
+float kp_p;
+float kd_p;
+float ki_p;
+
+float kp_c;
+float ki_c;
+float c_error;
+float error_sum;
+float command;
+float torque_command;
+float c_torque;
+
+float error;
+float old_error;
+float integral_error;
+
+
+int counter;
+
+Timer timer;
+
+float torque;
+float direction;
+
+float past_currents [5];
+
+float command_position(void);
+float command_torque(void);
+float command_position_tm(void);
+private:
+
+
+
+
+
+
+};
+#endif