Bayley Wang
/
flash_configuration
flash based config testing
config.h@0:941e150e78b6, 2017-03-01 (annotated)
- Committer:
- bwang
- Date:
- Wed Mar 01 00:52:47 2017 +0000
- Revision:
- 0:941e150e78b6
- Child:
- 1:df6bbacb7bb9
first commit, reading/writing of config arrays works
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bwang | 0:941e150e78b6 | 1 | #ifndef __CONFIG_H |
bwang | 0:941e150e78b6 | 2 | #define __CONFIG_H |
bwang | 0:941e150e78b6 | 3 | |
bwang | 0:941e150e78b6 | 4 | /*---driving---*/ |
bwang | 0:941e150e78b6 | 5 | #define _TORQUE_MODE __int_reg[0] |
bwang | 0:941e150e78b6 | 6 | #define _MAX_TQPCT_PLUS __float_reg[0] |
bwang | 0:941e150e78b6 | 7 | #define _MAX_TQPCT_MINUS __float_reg[1] |
bwang | 0:941e150e78b6 | 8 | #define _TORQUE_MAX __float_reg[2] |
bwang | 0:941e150e78b6 | 9 | #define _W_MAX __float_reg[3] |
bwang | 0:941e150e78b6 | 10 | |
bwang | 0:941e150e78b6 | 11 | /*---inverter---*/ |
bwang | 0:941e150e78b6 | 12 | #define _BUS_VOLTAGE __float_reg[4] |
bwang | 0:941e150e78b6 | 13 | #define _F_SW __float_reg[5] |
bwang | 0:941e150e78b6 | 14 | |
bwang | 0:941e150e78b6 | 15 | /*---logging---*/ |
bwang | 0:941e150e78b6 | 16 | #define _ENABLE_LOGGING __int_reg[1] |
bwang | 0:941e150e78b6 | 17 | #define _LOG_FREQUENCY __float_reg[6] |
bwang | 0:941e150e78b6 | 18 | |
bwang | 0:941e150e78b6 | 19 | /*---loop---*/ |
bwang | 0:941e150e78b6 | 20 | #define _K_LOOP_D __float_reg[7] |
bwang | 0:941e150e78b6 | 21 | #define _KI_BASE_D __float_reg[8] |
bwang | 0:941e150e78b6 | 22 | |
bwang | 0:941e150e78b6 | 23 | #define _K_LOOP_Q __float_reg[9] |
bwang | 0:941e150e78b6 | 24 | #define _KI_BASE_Q __float_reg[10] |
bwang | 0:941e150e78b6 | 25 | |
bwang | 0:941e150e78b6 | 26 | #define _F_SLOW_LOOP __float_reg[11] |
bwang | 0:941e150e78b6 | 27 | |
bwang | 0:941e150e78b6 | 28 | #define _INTEGRAL_MAX __float_reg[12] |
bwang | 0:941e150e78b6 | 29 | |
bwang | 0:941e150e78b6 | 30 | #define _W_FILTER_STRENGTH __float_reg[13] |
bwang | 0:941e150e78b6 | 31 | #define _DQ_FILTER_STRENGTH __float_reg[14] |
bwang | 0:941e150e78b6 | 32 | #define _THROTTLE_FILTER_STRENGTH __float_reg[15] |
bwang | 0:941e150e78b6 | 33 | |
bwang | 0:941e150e78b6 | 34 | #define _KP_D __float_reg[17] |
bwang | 0:941e150e78b6 | 35 | #define _KI_D __float_reg[18] |
bwang | 0:941e150e78b6 | 36 | |
bwang | 0:941e150e78b6 | 37 | #define _KP_Q __float_reg[19] |
bwang | 0:941e150e78b6 | 38 | #define _KI_Q __float_reg[20] |
bwang | 0:941e150e78b6 | 39 | |
bwang | 0:941e150e78b6 | 40 | #define _SLOW_LOOP_COUNTER __float_reg[21] |
bwang | 0:941e150e78b6 | 41 | |
bwang | 0:941e150e78b6 | 42 | /*---motor---*/ |
bwang | 0:941e150e78b6 | 43 | #define _POLE_PAIRS __float_reg[22] |
bwang | 0:941e150e78b6 | 44 | #define _POS_OFFSET __float_reg[23] |
bwang | 0:941e150e78b6 | 45 | #define _RESOLVER_LOBES __float_reg[24] |
bwang | 0:941e150e78b6 | 46 | #define _CPR __int_reg[2] |
bwang | 0:941e150e78b6 | 47 | #define _Ld __float_reg[25] |
bwang | 0:941e150e78b6 | 48 | #define _Lq __float_reg[26] |
bwang | 0:941e150e78b6 | 49 | #define _FLUX_LINKAGE __float_reg[27] |
bwang | 0:941e150e78b6 | 50 | #define _Rs __float_reg[28] |
bwang | 0:941e150e78b6 | 51 | #define _KT __float_reg[29] |
bwang | 0:941e150e78b6 | 52 | #define _W_SAFE __float_reg[30] |
bwang | 0:941e150e78b6 | 53 | #define _W_CRAZY __float_reg[31] |
bwang | 0:941e150e78b6 | 54 | |
bwang | 0:941e150e78b6 | 55 | /*---rc_throttle---*/ |
bwang | 0:941e150e78b6 | 56 | #define _TH_LIMIT_LOW __int_reg[3] |
bwang | 0:941e150e78b6 | 57 | #define _TH_LIMIT_HIGH __int_reg[4] |
bwang | 0:941e150e78b6 | 58 | #define _TH_LIMIT_CRAZY __int_reg[5] |
bwang | 0:941e150e78b6 | 59 | |
bwang | 0:941e150e78b6 | 60 | /*---table---*/ |
bwang | 0:941e150e78b6 | 61 | #define _ROWS __int_reg[6] |
bwang | 0:941e150e78b6 | 62 | #define _COLUMNS __int_reg[7] |
bwang | 0:941e150e78b6 | 63 | #define _W_STEP __float_reg[8] |
bwang | 0:941e150e78b6 | 64 | |
bwang | 0:941e150e78b6 | 65 | /*internal variables and macros*/ |
bwang | 0:941e150e78b6 | 66 | |
bwang | 0:941e150e78b6 | 67 | extern float __float_reg[]; |
bwang | 0:941e150e78b6 | 68 | extern int __int_reg[]; |
bwang | 0:941e150e78b6 | 69 | |
bwang | 0:941e150e78b6 | 70 | #define DEFAULT(a) _##a = a |
bwang | 0:941e150e78b6 | 71 | #define FPRINT(a) pc.printf("%s: %f\n", #a, _##a) |
bwang | 0:941e150e78b6 | 72 | #define DPRINT(a) pc.printf("%s: %d\n", #a, _##a) |
bwang | 0:941e150e78b6 | 73 | |
bwang | 0:941e150e78b6 | 74 | #endif |