The motor controller has four types of parameters 1) motor command parameter, 2) run-time parameters, 3) configuration parameters and 4) maintenance parameters. Motor command parameter is used to control the motor speed. Run-time parameters reset each time the motor controller is restarted and is used to store information related to the current behavior of the motor, e.g. (rpm, encoder counter). Configuration parameters are used to configure the operational parameters of the motor controller, e.g. (max_rpm, PID constants, etc) and are stored within the motor controller. Maintenance parameters are used for controller maintenance such as save configuration parameters or request version information.
This is used to set the motor command. In open loop, this is used to control the PWM value of the motor, where 1000 represents operating the motor at the full applied battery voltage. Negative is used to reverse the direction.
In closed loop this represent the actual RPM value using the following formula: Motor_Speed_Command/1000 * MAX_RPM.
The device transmits a feedback message at 20Hz frequency and a status message at 5Hz.
Feedback status counter. Once the value reaches the max, it starts counting from 0.
Motor Encoder counter
Encoder counter from the Hall Effect sensors.
Motor RPM Feedback
Measured RPM by the motor controller.
Motor operational status
0: Motor is currently stopped.
1: Motor is running
2: Motor Amp Limit is crossed. 3: Motor PID Error 4: Motor is in standby mode
Supply voltage multplied by 10. e.g. a reading of 254 is 25.4 volts.
Temperature of the micro-controller * 10.
Motor PID error
In closed loop speed control is used to output the error between target RPM - Actual RPM.
Configuration parameters are used to configure the operational parameters of the motor controller and are stored within the motor controller
Motor operating mode
0 - Open Loop Speed Control
1 - Closed Loop Speed Control
Motor acceleration rate
For open loop speed control: The accelerations rate (in 1/seconds) of the motor command. For example, if the motor command is 500, and the acceleration rate is 100, the motor controller will reach the max motor command value in 5 seconds.
For closed loop speed control: Acceleration value is in RPM per second. For example at a value of 100 RMP/s, it will take the motor controller 5 seconds to reach send an RMP value of 500. The actual value of the RPM is also impacted by the PID values.
Motor deceleration rate
Similar concept to acceleration rate, but it is used for motor deceleration.
Motor Amp limit
The motor controller board hardware can disable the motor based on the following AMP limits:
0: Sets the motor controller to Standby mode. Disables power to the motor.
1: Amp limit is 2 AMPS
2: Amp limit is 18 AMPS (Default)
3: Amp limit is 45 AMPS
4: Disable Amp limit check, however hardware control still limits the controller to exceed 45 AMPS, but the software will no enter the Amp Limit Sate if the disable option is selected.
PID Proportional gain
Sets the proportional gain. A good starting number for most motors is 5 to 50.
PID Integral gain
Sets the integral gain, A good starting number is 0, change for fine tuning the motor controller.
PID Differential gain
Sets the differential gain, A good starting number is 0, change for fine tuning the motor controller.
Max RPM value
Max RPM sets the actual speed in closed loop where the motor command varies from -1000 to 1000, which is equivalent to a speed of -MAX RPM to MAX RPM.
Motor pole pairs
Number of pole pairs of the motor. This value is used to determine the RPM of the motor.
Stop braking timeout
Braking timeout in milliseconds. Once a motor command of 0 is sent, the motor will enter into electromagnetic braking mode after the time specified.
During electromagnetic braking all low switches are opened and the windings are connected with each other. This force limits the motor movement.
To disable braking timeout, set this value to 0.
Motor watchdog timeout, ms
Time in millisecond the motor controller expects a motor speed command (MC), otherwise the motor power will be set to 0.
To disable the motor watchdog, set this value to 0.
Enable PID error checking
When enabled a basic PID error check is performed. If the PID error differs by 50% of the target RPM value for 2 seconds, the motor will be disabled. This check is only performed when the RPM is greater than 50.
Maintenance parameters are used for controller maintenance such as save configuration parameters or request version information.
Reset encoder by setting the value to 0.
Reset config. parameters
Reset motor configuration parameters to the default value.
Save motor configuration parameters into FLASH memory.
This will automatically load any updated configurations parameters when the MCU is restarted.
Reset the device
Initiate a system reset of the MCU.
Returns firmware version (as a string).
Reset operational status
Resets operational status in case of Amp limit error or PID error.