Chetan Sharma
/
HKCC_Controller_MBed_OS
Modifying the HKCC for no readily apparent reason
Config/current_controller_config.h@46:2d4b1dafcfe3, 2018-07-12 (annotated)
- Committer:
- benkatz
- Date:
- Thu Jul 12 02:50:34 2018 +0000
- Revision:
- 46:2d4b1dafcfe3
- Parent:
- 44:8040fa2fcb0d
- Child:
- 47:e1196a851f76
calibration frees up memory when done;
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 | 29:0dbc822dd29a | 10 | #define V_BUS 24.0f // Volts |
benkatz | 46:2d4b1dafcfe3 | 11 | #define OVERMODULATION 1.4f // 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 | 26:2b865c00d7e9 | 16 | #define I_MAX 40.0f |
benkatz | 26:2b865c00d7e9 | 17 | |
benkatz | 37:c0f352d6e8e3 | 18 | //Observer// |
benkatz | 37:c0f352d6e8e3 | 19 | #define DT 0.000025f |
benkatz | 37:c0f352d6e8e3 | 20 | #define K_O 0.02f |
benkatz | 37:c0f352d6e8e3 | 21 | |
benkatz | 37:c0f352d6e8e3 | 22 | |
benkatz | 20:bf9ea5125d52 | 23 | |
benkatz | 20:bf9ea5125d52 | 24 | |
benkatz | 20:bf9ea5125d52 | 25 | #endif |