FOC Implementation for putting multirotor motors in robots

Dependencies:   FastPWM3 mbed

Committer:
benkatz
Date:
Wed Apr 13 04:09:56 2016 +0000
Revision:
8:10ae7bc88d6e
Parent:
6:4ee1cdc43aa8
Child:
9:d7eb815cb057
Multi-turn mechanical position, MA700 position sensing over SPI.  Placeholder torque controller for cogging/ripple compensation;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
benkatz 0:4e1c4df6aabd 1 #ifndef CURRENTRETULATOR_H
benkatz 0:4e1c4df6aabd 2 #define CURRENTREGULATOR_H
benkatz 0:4e1c4df6aabd 3 #include "Inverter.h"
benkatz 0:4e1c4df6aabd 4 #include "SVM.h"
benkatz 0:4e1c4df6aabd 5 #include "PositionSensor.h"
benkatz 0:4e1c4df6aabd 6
benkatz 0:4e1c4df6aabd 7 class CurrentRegulator{
benkatz 0:4e1c4df6aabd 8 public:
benkatz 0:4e1c4df6aabd 9 CurrentRegulator(Inverter *inverter, PositionSensor *position_sensor, float Kp, float Ki);
benkatz 0:4e1c4df6aabd 10 void UpdateRef(float D, float Q);
benkatz 0:4e1c4df6aabd 11 void Commutate();
benkatz 0:4e1c4df6aabd 12 private:
benkatz 5:51c6560bf624 13 float IQ_Ref, ID_Ref, V_Q, V_D, V_Alpha, V_Beta, V_A, V_B, V_C, I_Q, I_D, I_A, I_B, I_C, I_Alpha, I_Beta, theta_elec, _Kp, _Ki;
benkatz 0:4e1c4df6aabd 14 float Q_Integral, D_Integral, Q_Error, D_Error, Int_Max, DTC_Max;
benkatz 0:4e1c4df6aabd 15 void SampleCurrent();
benkatz 0:4e1c4df6aabd 16 void SetVoltage();
benkatz 0:4e1c4df6aabd 17 void Update();
benkatz 4:c023f7b6f462 18 void SendSPI();
benkatz 0:4e1c4df6aabd 19 Inverter* _Inverter;
benkatz 0:4e1c4df6aabd 20 PositionSensor* _PositionSensor;
benkatz 6:4ee1cdc43aa8 21 SVM* PWM;
benkatz 8:10ae7bc88d6e 22 Serial* pc;
benkatz 8:10ae7bc88d6e 23 int count;
benkatz 0:4e1c4df6aabd 24
benkatz 0:4e1c4df6aabd 25
benkatz 0:4e1c4df6aabd 26
benkatz 0:4e1c4df6aabd 27 };
benkatz 0:4e1c4df6aabd 28
benkatz 0:4e1c4df6aabd 29
benkatz 0:4e1c4df6aabd 30 #endif