Chetan Sharma
/
HKCC_Controller_MBed_OS
Modifying the HKCC for no readily apparent reason
Config/current_controller_config.h@51:6cd89bd6fcaa, 2019-07-17 (annotated)
- Committer:
- benkatz
- Date:
- Wed Jul 17 03:40:12 2019 +0000
- Revision:
- 51:6cd89bd6fcaa
- Parent:
- 49:83d83040ea51
adding field-weakening to the user menu, switch "torque limit" to "current limit"
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
benkatz | 20:bf9ea5125d52 | 1 | #ifndef CURRENT_CONTROLLER_CONFIG_H |
benkatz | 20:bf9ea5125d52 | 2 | #define CURRENT_CONTROLLER_CONFIG_H |
benkatz | 20:bf9ea5125d52 | 3 | |
benkatz | 37:c0f352d6e8e3 | 4 | // Current controller/// |
benkatz | 44:8040fa2fcb0d | 5 | #define K_D .05f // Loop gain, Volts/Amp |
benkatz | 44:8040fa2fcb0d | 6 | #define K_Q .05f // Loop gain, Volts/Amp |
benkatz | 44:8040fa2fcb0d | 7 | #define K_SCALE 0.0001f // K_loop/Loop BW (Hz) 0.0042 |
benkatz | 44:8040fa2fcb0d | 8 | #define KI_D 0.0255f // PI zero, in radians per sample |
benkatz | 44:8040fa2fcb0d | 9 | #define KI_Q 0.0255f // PI zero, in radians per sample |
benkatz | 48:74a40481740c | 10 | #define V_BUS 24.0f // Volts |
benkatz | 48:74a40481740c | 11 | #define OVERMODULATION 1.15f // 1.0 = no overmodulation |
benkatz | 20:bf9ea5125d52 | 12 | |
benkatz | 22:60276ba87ac6 | 13 | #define D_INT_LIM V_BUS/(K_D*KI_D) // Amps*samples |
benkatz | 22:60276ba87ac6 | 14 | #define Q_INT_LIM V_BUS/(K_Q*KI_Q) // Amps*samples |
benkatz | 20:bf9ea5125d52 | 15 | |
benkatz | 37:c0f352d6e8e3 | 16 | //Observer// |
benkatz | 37:c0f352d6e8e3 | 17 | #define DT 0.000025f |
benkatz | 37:c0f352d6e8e3 | 18 | #define K_O 0.02f |
benkatz | 37:c0f352d6e8e3 | 19 | |
benkatz | 37:c0f352d6e8e3 | 20 | |
benkatz | 20:bf9ea5125d52 | 21 | |
benkatz | 20:bf9ea5125d52 | 22 | |
benkatz | 20:bf9ea5125d52 | 23 | #endif |