ROBOSTEP_5期 / Hobbyking_Cheetah_Compact_DRV8323

Dependencies:   mbed-dev-f303 FastPWM3

Revision:
0:4e1c4df6aabd
Child:
4:c023f7b6f462
diff -r 000000000000 -r 4e1c4df6aabd CurrentRegulator/CurrentRegulator.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CurrentRegulator/CurrentRegulator.h	Fri Feb 05 00:52:53 2016 +0000
@@ -0,0 +1,28 @@
+#ifndef CURRENTRETULATOR_H
+#define CURRENTREGULATOR_H
+#include "Inverter.h"
+#include "SVM.h"
+#include "PositionSensor.h"
+
+class CurrentRegulator{
+    public:
+        CurrentRegulator(Inverter *inverter, PositionSensor *position_sensor, float Kp, float Ki);
+        void UpdateRef(float D, float Q);
+        void Commutate();
+    private:
+        float IQ_Ref, ID_Ref, V_Q, V_D, V_Alpha, V_Beta, I_Q, I_D, I_A, I_B, I_C, I_Alpha, I_Beta, theta_elec, _Kp, _Ki;
+        float Q_Integral, D_Integral, Q_Error, D_Error, Int_Max, DTC_Max;
+        void SampleCurrent();
+        void SetVoltage();
+        void Update();
+        Inverter* _Inverter;
+        PositionSensor* _PositionSensor;
+        SPWM* PWM;
+        int count;
+            
+    
+    
+    };
+    
+    
+#endif
\ No newline at end of file