DC Link converted to fixed-point

This commit is contained in:
EmanuelFeru
2019-10-12 19:51:31 +02:00
parent d87e9d68c6
commit f6fc825e5f
3 changed files with 13 additions and 14 deletions

View File

@@ -123,15 +123,13 @@
#define DELAY_TIM_FREQUENCY_US 1000000
#define MOTOR_AMP_CONV_DC_AMP 0.02f // A per bit (12) on ADC.
#define MILLI_R (R * 1000)
#define MILLI_PSI (PSI * 1000)
#define MILLI_V (V * 1000)
#define NO 0
#define YES 1
#define ABS(a) (((a) < 0.0f) ? -(a) : (a))
#define ABS(a) (((a) < 0) ? -(a) : (a))
#define LIMIT(x, lowhigh) (((x) > (lowhigh)) ? (lowhigh) : (((x) < (-lowhigh)) ? (-lowhigh) : (x)))
#define SAT(x, lowhigh) (((x) > (lowhigh)) ? (1.0f) : (((x) < (-lowhigh)) ? (-1.0f) : (0.0f)))
#define SAT2(x, low, high) (((x) > (high)) ? (1.0f) : (((x) < (low)) ? (-1.0f) : (0.0f)))