Mike Etek Controller

Dependencies:   mbed

Committer:
austinbrown124
Date:
Sat Apr 06 02:16:12 2019 +0000
Revision:
1:94193b31f0ee
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
austinbrown124 1:94193b31f0ee 1 #ifndef FW_CONFIG_H
austinbrown124 1:94193b31f0ee 2 #define FW_CONFIG_H
austinbrown124 1:94193b31f0ee 3
austinbrown124 1:94193b31f0ee 4 //hardware stuff
austinbrown124 1:94193b31f0ee 5 #define R_S 0.027f //Ohms
austinbrown124 1:94193b31f0ee 6 #define L_S 0.00004f //Henries
austinbrown124 1:94193b31f0ee 7
austinbrown124 1:94193b31f0ee 8
austinbrown124 1:94193b31f0ee 9
austinbrown124 1:94193b31f0ee 10 //current controler settings
austinbrown124 1:94193b31f0ee 11 #define KP 0.20f // Volts/Amp
austinbrown124 1:94193b31f0ee 12 #define KI 0.03f // 1/samples
austinbrown124 1:94193b31f0ee 13
austinbrown124 1:94193b31f0ee 14
austinbrown124 1:94193b31f0ee 15 #define V_BUS 24.0f // Volts, actual bus voltage
austinbrown124 1:94193b31f0ee 16 #define MAX_AMPS 100.0f
austinbrown124 1:94193b31f0ee 17
austinbrown124 1:94193b31f0ee 18 #define D_INT_LIM V_BUS/(K_D*KI_D) // Amps*samples
austinbrown124 1:94193b31f0ee 19 #define Q_INT_LIM V_BUS/(K_Q*KI_Q) // Amps*samples
austinbrown124 1:94193b31f0ee 20
austinbrown124 1:94193b31f0ee 21
austinbrown124 1:94193b31f0ee 22 #define DT 0.00005f
austinbrown124 1:94193b31f0ee 23 #define F_SW 20000
austinbrown124 1:94193b31f0ee 24
austinbrown124 1:94193b31f0ee 25
austinbrown124 1:94193b31f0ee 26 #define DTC_MAX 0.95f // Max phase duty cycle, determines current sensor read time
austinbrown124 1:94193b31f0ee 27 #define DTC_MIN 0.02f // Min phase duty cycle
austinbrown124 1:94193b31f0ee 28
austinbrown124 1:94193b31f0ee 29
austinbrown124 1:94193b31f0ee 30
austinbrown124 1:94193b31f0ee 31 #endif
austinbrown124 1:94193b31f0ee 32