Bayley Wang
/
foc-ed_in_the_bot_compact
robot
config_loop.h@75:591556ce033d, 2017-02-24 (annotated)
- Committer:
- bwang
- Date:
- Fri Feb 24 21:37:14 2017 +0000
- Revision:
- 75:591556ce033d
- Parent:
- 74:f10cb573d7ca
- Child:
- 76:c66014e50384
throttle edges acquired during commutation are invalidated; physically impossible throttle readings are invalidated; removed two-step throttle filtering code in lieu of superior methods
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bwang | 15:b583cd30b063 | 1 | #ifndef __CONFIG_LOOP_H |
bwang | 15:b583cd30b063 | 2 | #define __CONFIG_LOOP_H |
bwang | 15:b583cd30b063 | 3 | |
bwang | 22:72840d3db788 | 4 | #include "config_inverter.h" |
bwang | 22:72840d3db788 | 5 | |
bwang | 62:581aa9235ad6 | 6 | #define K_LOOP_D 2.5f |
bwang | 62:581aa9235ad6 | 7 | #define KI_BASE_D 0.025f |
bwang | 62:581aa9235ad6 | 8 | |
bwang | 62:581aa9235ad6 | 9 | #define K_LOOP_Q 6.0f |
bwang | 62:581aa9235ad6 | 10 | #define KI_BASE_Q 0.01f |
bwang | 62:581aa9235ad6 | 11 | |
bwang | 74:f10cb573d7ca | 12 | #define F_SLOW_LOOP 1000.0f |
bwang | 15:b583cd30b063 | 13 | |
bwang | 15:b583cd30b063 | 14 | #define INTEGRAL_MAX 1.0f |
bwang | 15:b583cd30b063 | 15 | |
bwang | 39:80b38a8e1787 | 16 | /*filter strengths, 0-1.0 |
bwang | 39:80b38a8e1787 | 17 | higher = stronger filtering*/ |
bwang | 24:5e18a87a0e95 | 18 | #define W_FILTER_STRENGTH 0.99f |
bwang | 64:b4175385d718 | 19 | #define DQ_FILTER_STRENGTH 0.95f |
bwang | 75:591556ce033d | 20 | #define THROTTLE_FILTER_STRENGTH 0.0f |
bwang | 74:f10cb573d7ca | 21 | |
bwang | 15:b583cd30b063 | 22 | |
bwang | 44:3fd6a43b91f0 | 23 | /*internally computed*/ |
bwang | 58:7316c5a4c417 | 24 | #define KP_D (K_LOOP_D / BUS_VOLTAGE) |
bwang | 58:7316c5a4c417 | 25 | #define KI_D (KI_BASE_D * K_LOOP_D / BUS_VOLTAGE * 5000.0f / F_SW) |
bwang | 58:7316c5a4c417 | 26 | |
bwang | 58:7316c5a4c417 | 27 | #define KP_Q (K_LOOP_Q / BUS_VOLTAGE) |
bwang | 58:7316c5a4c417 | 28 | #define KI_Q (KI_BASE_Q * K_LOOP_Q / BUS_VOLTAGE * 5000.0f / F_SW) |
bwang | 58:7316c5a4c417 | 29 | |
bwang | 44:3fd6a43b91f0 | 30 | #define SLOW_LOOP_COUNTER ((int) (F_SW / F_SLOW_LOOP)) |
bwang | 44:3fd6a43b91f0 | 31 | |
bwang | 15:b583cd30b063 | 32 | #endif |