Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: config_loop.h
- Revision:
- 58:7316c5a4c417
- Parent:
- 57:fe85b52e223d
- Child:
- 60:22338b6c7a6e
--- a/config_loop.h Sat Jan 28 01:56:28 2017 +0000 +++ b/config_loop.h Sat Jan 28 02:44:52 2017 +0000 @@ -3,8 +3,11 @@ #include "config_inverter.h" -#define K_LOOP 1.0f -#define KI_BASE 0.01f +#define K_LOOP_D 2.5f +#define KI_BASE_D 0.025f + +#define K_LOOP_Q 6.0f +#define KI_BASE_Q 0.01f #define F_SLOW_LOOP 100.0f @@ -16,8 +19,12 @@ #define DQ_FILTER_STRENGTH 0.0f /*internally computed*/ -#define KP (K_LOOP / BUS_VOLTAGE) -#define KI (KI_BASE * K_LOOP / BUS_VOLTAGE * 5000.0f / F_SW) +#define KP_D (K_LOOP_D / BUS_VOLTAGE) +#define KI_D (KI_BASE_D * K_LOOP_D / BUS_VOLTAGE * 5000.0f / F_SW) + +#define KP_Q (K_LOOP_Q / BUS_VOLTAGE) +#define KI_Q (KI_BASE_Q * K_LOOP_Q / BUS_VOLTAGE * 5000.0f / F_SW) + #define SLOW_LOOP_COUNTER ((int) (F_SW / F_SLOW_LOOP)) #endif \ No newline at end of file