-
Notifications
You must be signed in to change notification settings - Fork 692
Expand file tree
/
Copy pathcommands.h
More file actions
63 lines (55 loc) · 2.53 KB
/
commands.h
File metadata and controls
63 lines (55 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef COMMANDS_h
#define COMMANDS_h
// see docs.simplefoc.com for in depth explanation of the commands
// list of commands
#define CMD_C_D_PID 'D' //!< current d PID & LPF
#define CMD_C_Q_PID 'Q' //!< current q PID & LPF
#define CMD_V_PID 'V' //!< velocity PID & LPF
#define CMD_A_PID 'A' //!< angle PID & LPF
#define CMD_STATUS 'E' //!< motor status enable/disable
#define CMD_LIMITS 'L' //!< limits current/voltage/velocity
#define CMD_MOTION_TYPE 'C' //!< motion control type
#define CMD_TORQUE_TYPE 'T' //!< torque control type
#define CMD_SENSOR 'S' //!< sensor offsets
#define CMD_MONITOR 'M' //!< monitoring
#define CMD_RESIST 'R' //!< motor phase resistance
#define CMD_INDUCTANCE 'I' //!< motor phase inductance
#define CMD_KV_RATING 'K' //!< motor kv rating
#define CMD_PWMMOD 'W' //!< pwm modulation
#define CMD_FOC_PARAMS 'F' //!< time parameters
// commander configuration
#define CMD_SCAN '?' //!< command scaning the network - only for commander
#define CMD_VERBOSE '@' //!< command setting output mode - only for commander
#define CMD_DECIMAL '#' //!< command setting decimal places - only for commander
// subcomands
//pid - lpf
#define SCMD_PID_P 'P' //!< PID gain P
#define SCMD_PID_I 'I' //!< PID gain I
#define SCMD_PID_D 'D' //!< PID gain D
#define SCMD_PID_RAMP 'R' //!< PID ramp
#define SCMD_PID_LIM 'L' //!< PID limit
#define SCMD_LPF_TF 'F' //!< LPF time constant
// limits
#define SCMD_LIM_CURR 'C' //!< Limit current
#define SCMD_LIM_VOLT 'U' //!< Limit voltage
#define SCMD_LIM_VEL 'V' //!< Limit velocity
//sensor
#define SCMD_SENS_MECH_OFFSET 'M' //!< Sensor offset
#define SCMD_SENS_ELEC_OFFSET 'E' //!< Sensor electrical zero offset
// monitoring
#define SCMD_DOWNSAMPLE 'D' //!< Monitoring downsample value
#define SCMD_CLEAR 'C' //!< Clear all monitored variables
#define SCMD_GET 'G' //!< Get variable only one value
#define SCMD_SET 'S' //!< Set variables to be monitored
#define SCMD_TIME 'T' //!< Time between executions (filtered)
// pwm modulation
#define SCMD_PWMMOD_TYPE 'T' //!<< Pwm modulation type
#define SCMD_PWMMOD_CENTER 'C' //!<< Pwm modulation center flag
// foc control parameters
#define SCMD_REINIT_FOC 'R' //!< reinitialize FOC
#define SCMD_TUNE_CURR 'C' //!< tune current controller
#define SCMD_MEAS_PARAMS 'P' //!< measure motor parameters (resistance and inductance)
// subcommands for motor parameters measurement
#define SCMD_INDUCT_D 'D' //!< inductance d axis
#define SCMD_INDUCT_Q 'Q' //!< inductance q axis
#endif