Slurp

Dependencies:   FastPWM3 mbed

Committer:
austinbrown124
Date:
Sat May 20 21:42:20 2017 +0000
Revision:
0:9edd6ec0f56a
First Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
austinbrown124 0:9edd6ec0f56a 1 #ifndef CURRENT_CONTROLLER_CONFIG_H
austinbrown124 0:9edd6ec0f56a 2 #define CURRENT_CONTROLLER_CONFIG_H
austinbrown124 0:9edd6ec0f56a 3
austinbrown124 0:9edd6ec0f56a 4 #define K_D .05f // Volts/Amp
austinbrown124 0:9edd6ec0f56a 5 #define K_Q .05f // Volts/Amp
austinbrown124 0:9edd6ec0f56a 6 #define KI_D 0.04f // 1/samples
austinbrown124 0:9edd6ec0f56a 7 #define KI_Q 0.04f // 1/samples
austinbrown124 0:9edd6ec0f56a 8 #define V_BUS 24.0f // Volts
austinbrown124 0:9edd6ec0f56a 9
austinbrown124 0:9edd6ec0f56a 10 #define D_INT_LIM V_BUS/(K_D*KI_D) // Amps*samples
austinbrown124 0:9edd6ec0f56a 11 #define Q_INT_LIM V_BUS/(K_Q*KI_Q) // Amps*samples
austinbrown124 0:9edd6ec0f56a 12
austinbrown124 0:9edd6ec0f56a 13 #define DTC_MAX 0.95f // Max phase duty cycle
austinbrown124 0:9edd6ec0f56a 14 #define DTC_MIN 0.05f // Min phase duty cycle
austinbrown124 0:9edd6ec0f56a 15
austinbrown124 0:9edd6ec0f56a 16 #define I_SCALE 0.02014160156f // Amps per A/D Count
austinbrown124 0:9edd6ec0f56a 17 // 1/(.002*1*20*4096/3.3)
austinbrown124 0:9edd6ec0f56a 18
austinbrown124 0:9edd6ec0f56a 19
austinbrown124 0:9edd6ec0f56a 20
austinbrown124 0:9edd6ec0f56a 21 #endif