SimpleFOClibrary  2.1
defaults.h
Go to the documentation of this file.
1 // default configuration values
2 // change this file to optimal values for your application
3 
4 #define DEF_POWER_SUPPLY 12.0
5 // velocity PI controller params
6 #define DEF_PID_VEL_P 0.5
7 #define DEF_PID_VEL_I 10.0
8 #define DEF_PID_VEL_D 0.0
9 #define DEF_PID_VEL_RAMP 1000.0
10 #define DEF_PID_VEL_LIMIT (DEF_POWER_SUPPLY)
11 
12 // current sensing PID values
13 #if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega328PB__) || defined(__AVR_ATmega2560__)
14 // for 16Mhz controllers like Arduino uno and mega
15 #define DEF_PID_CURR_P 2
16 #define DEF_PID_CURR_I 100
17 #define DEF_PID_CURR_D 0.0
18 #define DEF_PID_CURR_RAMP 1000.0
19 #define DEF_PID_CURR_LIMIT (DEF_POWER_SUPPLY)
20 #define DEF_CURR_FILTER_Tf 0.01
21 #else
22 // for stm32, due, teensy, esp32 and similar
23 #define DEF_PID_CURR_P 3
24 #define DEF_PID_CURR_I 300.0
25 #define DEF_PID_CURR_D 0.0
26 #define DEF_PID_CURR_RAMP 1e11
27 #define DEF_PID_CURR_LIMIT (DEF_POWER_SUPPLY)
28 #define DEF_CURR_FILTER_Tf 0.005
29 #endif
30 // default current limit values
31 #define DEF_CURRENT_LIM 0.2
32 
33 // default monitor downsample
34 #define DEF_MON_DOWNSMAPLE 100
35 #define DEF_MOTION_DOWNSMAPLE 0
36 
37 // angle P params
38 #define DEF_P_ANGLE_P 20.0
39 #define DEF_VEL_LIM 20.0
40 
41 // index search
42 #define DEF_INDEX_SEARCH_TARGET_VELOCITY 1.0
43 // align voltage
44 #define DEF_VOLTAGE_SENSOR_ALIGN 3.0
45 // low pass filter velocity
46 #define DEF_VEL_FILTER_Tf 0.005 //!< default velocity filter time constant