modified 0511
Dependencies: mbed-dev FastPWM3
Config/current_controller_config.h@65:cb3497b549e9, 24 months ago (annotated)
- Committer:
- WinnieLiu
- Date:
- Fri Aug 19 07:46:05 2022 +0000
- Revision:
- 65:cb3497b549e9
- Parent:
- 60:f009e39e913e
latest code
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 |
WinnieLiu | 60:f009e39e913e | 10 | //#define V_BUS 24.0f // Volts |
WinnieLiu | 60:f009e39e913e | 11 | #define V_BUS 48.0f // Volts |
benkatz | 48:74a40481740c | 12 | #define OVERMODULATION 1.15f // 1.0 = no overmodulation |
benkatz | 20:bf9ea5125d52 | 13 | |
benkatz | 22:60276ba87ac6 | 14 | #define D_INT_LIM V_BUS/(K_D*KI_D) // Amps*samples |
benkatz | 22:60276ba87ac6 | 15 | #define Q_INT_LIM V_BUS/(K_Q*KI_Q) // Amps*samples |
benkatz | 20:bf9ea5125d52 | 16 | |
benkatz | 37:c0f352d6e8e3 | 17 | //Observer// |
benkatz | 37:c0f352d6e8e3 | 18 | #define DT 0.000025f |
benkatz | 37:c0f352d6e8e3 | 19 | #define K_O 0.02f |
benkatz | 37:c0f352d6e8e3 | 20 | |
benkatz | 37:c0f352d6e8e3 | 21 | |
benkatz | 20:bf9ea5125d52 | 22 | |
benkatz | 20:bf9ea5125d52 | 23 | |
benkatz | 20:bf9ea5125d52 | 24 | #endif |