Parameter Description

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.

Motor Command Parameter

Parameter

Code

Description

Motor command

MC

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.

Run-time Parameters

The device transmits a feedback message at 20Hz frequency and a status message at 5Hz.

Parameter

Code

Description

Feedback counter

FC

Feedback status counter. Once the value reaches the max, it starts counting from 0.

Motor Encoder counter

MCC

Encoder counter from the Hall Effect sensors.

Motor RPM Feedback

MRPM

Measured RPM by the motor controller.

Motor operational status

MSTAT

Values:

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

Motor voltage

MVOLT

Supply voltage multplied by 10. e.g. a reading of 254 is 25.4 volts.

MCU temperature

MTEMP

Temperature of the micro-controller * 10.

Motor PID error

MERR

In closed loop speed control is used to output the error between target RPM - Actual RPM.

Configurations Parameters

Configuration parameters are used to configure the operational parameters of the motor controller and are stored within the motor controller

Parameter

Code

Description

Motor operating mode

MM

0 - Open Loop Speed Control

1 - Closed Loop Speed Control

Motor acceleration rate

MAC

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

MDEC

Similar concept to acceleration rate, but it is used for motor deceleration.

Motor Amp limit

MAMP

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

MKP

Sets the proportional gain. A good starting number for most motors is 5 to 50.

PID Integral gain

MKI

Sets the integral gain, A good starting number is 0, change for fine tuning the motor controller.

PID Differential gain

MKD

Sets the differential gain, A good starting number is 0, change for fine tuning the motor controller.

Max RPM value

MMRPM

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

MPP

Number of pole pairs of the motor. This value is used to determine the RPM of the motor.

Stop braking timeout

MBK

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

MWT

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

MPEC

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

Maintenance parameters are used for controller maintenance such as save configuration parameters or request version information.

Name

Code

Description

Reset encoder

MRE

Reset encoder by setting the value to 0.

Reset config. parameters

MRCP

Reset motor configuration parameters to the default value.

Save config.parameters

MSAV

Save motor configuration parameters into FLASH memory.

This will automatically load any updated configurations parameters when the MCU is restarted.

Reset the device

MRESB

Initiate a system reset of the MCU.

Version request

MVER

Returns firmware version (as a string).

Reset operational status

MRESS

Resets operational status in case of Amp limit error or PID error.