|
fsp_err_t | RM_MOTOR_ESTIMATE_Open (motor_angle_ctrl_t *const p_ctrl, motor_angle_cfg_t const *const p_cfg) |
| Opens and configures the Angle Estimation module. Implements motor_angle_api_t::open. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_Close (motor_angle_ctrl_t *const p_ctrl) |
| Disables specified Angle Estimation module. Implements motor_angle_api_t::close. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_Reset (motor_angle_ctrl_t *const p_ctrl) |
| Reset variables of Angle Estimation module. Implements motor_angle_api_t::reset. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_CurrentSet (motor_angle_ctrl_t *const p_ctrl, motor_angle_current_t *const p_st_current, motor_angle_voltage_reference_t *const p_st_voltage) |
| Set d/q-axis Current Data & Voltage Reference. Implements motor_angle_api_t::currentSet. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_SpeedSet (motor_angle_ctrl_t *const p_ctrl, float const speed_ctrl, float const damp_speed) |
| Set Speed Information. Implements motor_angle_api_t::speedSet. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_FlagPiCtrlSet (motor_angle_ctrl_t *const p_ctrl, uint32_t const flag_pi) |
| Set the flag of PI Control runs. Implements motor_angle_api_t::flagPiCtrlSet. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_AngleSpeedGet (motor_angle_ctrl_t *const p_ctrl, float *const p_angle, float *const p_speed, float *const p_phase_err) |
| Gets the current rotor's angle and rotation speed. Implements motor_angle_api_t::angleSpeedGet. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_EstimatedComponentGet (motor_angle_ctrl_t *const p_ctrl, float *const p_ed, float *const p_eq) |
| Gets estimated d/q-axis component. Implements motor_angle_api_t::estimatedComponentGet. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_ParameterUpdate (motor_angle_ctrl_t *const p_ctrl, motor_angle_cfg_t const *const p_cfg) |
| Update the parameters of Angle&Speed Estimation. Implements motor_angle_api_t::parameterUpdate. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_InternalCalculate (motor_angle_ctrl_t *const p_ctrl) |
| Calculate internal parameters. Implements motor_angle_api_t::internalCalculate. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_AngleAdjust (motor_angle_ctrl_t *const p_ctrl) |
| Angle Adjustment Process. Implements motor_angle_api_t::angleAdjust. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_EncoderCyclic (motor_angle_ctrl_t *const p_ctrl) |
| Encoder Cyclic Process (Call in cyclic timer). Implements motor_angle_api_t::encoderCyclic. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_InfoGet (motor_angle_ctrl_t *const p_ctrl, motor_angle_encoder_info_t *const p_info) |
| Gets information of Encoder Angle Module. Implements motor_angle_api_t::infoGet. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_CyclicProcess (motor_angle_ctrl_t *const p_ctrl) |
| Perform induction cyclic process. Implements motor_angle_api_t::cyclicProcess. More...
|
|
fsp_err_t | RM_MOTOR_ESTIMATE_SensorDataSet (motor_angle_ctrl_t *const p_ctrl, motor_angle_ad_data_t *const p_ad_data) |
| Set sensor data. Implements motor_angle_api_t::sensorDataSet. More...
|
|
Calculation proccess for the motor control on RA MCUs. This module implements the Motor angle Interface.
Overview
The motor angle and speed estimation module is used to calculate rotor angle and rotational speed in an application. This module should be called cyclically after the A/D conversion of electric current of each phase in an application.
Features
The Motor Angle and Speed Estimation Module has below features.
- Calculate rotor angle [radian].
- Calculate rotational speed [radian/second].
Configuration
Build Time Configurations for rm_motor_estimate
The following build time configurations are defined in fsp_cfg/rm_motor_estimate_cfg.h:
Configuration | Options | Default | Description |
Parameter Checking |
-
Default (BSP)
-
Enabled
-
Disabled
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configurations for Motor > Motor Angle and Speed Estimation (rm_motor_estimate)
This module can be added to the Stacks tab via New Stack > Motor > Motor Angle and Speed Estimation (rm_motor_estimate).
Configuration | Options | Default | Description |
Motor Parameter |
Pole pairs | Must be a valid positive integer. | 2 | Pole pairs |
Motor Parameter > Resistance[ohm] | Must be a valid value | 8.5F | Resistance |
Motor Parameter > Inductance of d-axis[H] | Must be a valid value | 0.0045F | Inductance of d-axis |
Motor Parameter > Inductance of q-axis[H] | Must be a valid value | 0.0045F | Inductance of q-axis |
Motor Parameter > Permanent magnetic flux[Wb] | Must be a valid value | 0.02159F | Permanent magnetic flux |
Motor Parameter > Rotor inertia[kgm^2] | Must be a valid value | 0.0000028F | Rotor inertia |
Motor Parameter > Nominal current[Arms] | Must be a valid value | 1.67 | Nominal current |
Name | Name must be a valid C symbol | g_motor_angle0 | Module name. |
Openloop damping |
| Enable | Openloop damping functionally enable or disable |
Natural frequency of BEMF observer | Must be a valid value | 1000.0F | Natural frequency of BEMF observer |
Damping ratio of BEMF observer | Must be a valid value | 1.0F | Damping ratio of BEMF observer |
Natural frequency of PLL Speed estimate loop | Must be a valid value | 20.0F | Natural frequency of PLL Speed estimate loop |
Damping ratio of PLL Speed estimate loop | Must be a valid value | 1.0F | Damping ratio of PLL Speed estimate loop |
Control period | Must be a valid value | 0.00005F | Control period |
Clock Configuration
This module doesn't depend on clock setting, because this module is a simple calculation process.
Pin Configuration
This module does not use I/O pins.
Usage Notes
Limitations
Developers should be aware of the following limitations when using the Motor Angle and Speed Estimation:
Examples
Basic Example
This is a basic example of minimal use of the Motor Angle and Speed Estimation in an application.
void motor_estimate_basic_example (void)
{
assert(FSP_SUCCESS == err);
while (true)
{
smpl_current.id = 1.0F;
smpl_current.iq = 1.0F;
}
}
◆ RM_MOTOR_ESTIMATE_Open()
Opens and configures the Angle Estimation module. Implements motor_angle_api_t::open.
- Return values
-
FSP_SUCCESS | MTR_ANGL_EST successfully configured. |
FSP_ERR_ASSERTION | Null pointer, or one or more configuration options is invalid. |
FSP_ERR_ALREADY_OPEN | Module is already open. This module can only be opened once. |
FSP_ERR_INVALID_ARGUMENT | Configuration parameter error. |
◆ RM_MOTOR_ESTIMATE_Close()
Disables specified Angle Estimation module. Implements motor_angle_api_t::close.
- Return values
-
FSP_SUCCESS | Successfully closed. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_Reset()
Reset variables of Angle Estimation module. Implements motor_angle_api_t::reset.
- Return values
-
FSP_SUCCESS | Successfully reset. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_CurrentSet()
Set d/q-axis Current Data & Voltage Reference. Implements motor_angle_api_t::currentSet.
- Return values
-
FSP_SUCCESS | Successfully set. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_SpeedSet()
Set Speed Information. Implements motor_angle_api_t::speedSet.
- Return values
-
FSP_SUCCESS | Successfully set. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_FlagPiCtrlSet()
Set the flag of PI Control runs. Implements motor_angle_api_t::flagPiCtrlSet.
- Return values
-
FSP_SUCCESS | Successfully set. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_AngleSpeedGet()
fsp_err_t RM_MOTOR_ESTIMATE_AngleSpeedGet |
( |
motor_angle_ctrl_t *const |
p_ctrl, |
|
|
float *const |
p_angle, |
|
|
float *const |
p_speed, |
|
|
float *const |
p_phase_err |
|
) |
| |
Gets the current rotor's angle and rotation speed. Implements motor_angle_api_t::angleSpeedGet.
- Return values
-
FSP_SUCCESS | Successful data get. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_EstimatedComponentGet()
Gets estimated d/q-axis component. Implements motor_angle_api_t::estimatedComponentGet.
- Return values
-
FSP_SUCCESS | Successfully data gotten. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_ParameterUpdate()
Update the parameters of Angle&Speed Estimation. Implements motor_angle_api_t::parameterUpdate.
- Return values
-
FSP_SUCCESS | Successfully data is update. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_InternalCalculate()
Calculate internal parameters. Implements motor_angle_api_t::internalCalculate.
- Return values
-
FSP_ERR_UNSUPPORTED | Unsupported. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_AngleAdjust()
Angle Adjustment Process. Implements motor_angle_api_t::angleAdjust.
- Return values
-
FSP_ERR_UNSUPPORTED | Unsupported. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_EncoderCyclic()
Encoder Cyclic Process (Call in cyclic timer). Implements motor_angle_api_t::encoderCyclic.
- Return values
-
FSP_ERR_UNSUPPORTED | Unsupported. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_InfoGet()
Gets information of Encoder Angle Module. Implements motor_angle_api_t::infoGet.
- Return values
-
FSP_ERR_UNSUPPORTED | Unsupported. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_ESTIMATE_CyclicProcess()
◆ RM_MOTOR_ESTIMATE_SensorDataSet()