|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_Open (motor_angle_ctrl_t *const p_ctrl, motor_angle_cfg_t const *const p_cfg) |
| Opens and configures the Angle module. Implements motor_angle_api_t::open. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_Close (motor_angle_ctrl_t *const p_ctrl) |
| Disables specified Angle module. Implements motor_angle_api_t::close. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_Reset (motor_angle_ctrl_t *const p_ctrl) |
| Reset variables of Angle module. Implements motor_angle_api_t::reset. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_InternalCalculate (motor_angle_ctrl_t *const p_ctrl) |
| Calculate internal parameters. Implements motor_angle_api_t::internalCalculate. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_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_SENSE_INDUCTION_AngleAdjust (motor_angle_ctrl_t *const p_ctrl) |
| Angle Adjustment Process. Implements motor_angle_api_t::angleAdjust. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_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_SENSE_INDUCTION_CyclicProcess (motor_angle_ctrl_t *const p_ctrl) |
| Induction sensor Cyclic Process (Call in cyclic timer). Implements motor_angle_api_t::cyclicProcess. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_InfoGet (motor_angle_ctrl_t *const p_ctrl, motor_angle_encoder_info_t *const p_info) |
| Gets information of Angle Module. Implements motor_angle_api_t::infoGet. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_CorrectReset (motor_angle_ctrl_t *const p_ctrl) |
| Reset to restart calibration Angle module. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_ErrorGet (motor_angle_ctrl_t *const p_ctrl, motor_angle_error_t *const p_error) |
| Gets the error information about induction correction. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_ParameterUpdate (motor_angle_ctrl_t *const p_ctrl, motor_angle_cfg_t const *const p_cfg) |
| Update the parameters of angle & speed calculation. Implements motor_angle_api_t::parameterUpdate. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_SensorDataSet (motor_angle_ctrl_t *const p_ctrl, motor_angle_ad_data_t *const p_ad_data) |
| Set A/D Converted Data. Implements motor_angle_api_t::sensorDataSet. More...
|
|
fsp_err_t | RM_MOTOR_SENSE_INDUCTION_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_SENSE_INDUCTION_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_SENSE_INDUCTION_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_SENSE_INDUCTION_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...
|
|
Calculation proccess for the motor control on RA MCUs. This module implements the Motor angle Interface.
Overview
The motor angle and speed calculation with induction sensor module is used to calculate rotor angle and rotational speed in an application. This module is designed to be used with the motor current module (rm_motor_current).
Features
The motor angle and speed calculation with induction sensor module has the features listed below.
- Calculate rotor angle [radian].
- Calculate rotational speed [radian/second].
Configuration
Build Time Configurations for rm_motor_sense_induction
The following build time configurations are defined in fsp_cfg/rm_motor_sense_induction_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 Calculation with induction sensor (rm_motor_sense_induction)
This module can be added to the Stacks tab via New Stack > Motor > Motor Angle and Speed Calculation with induction sensor (rm_motor_sense_induction).
Configuration | Options | Default | Description |
General |
Name | Name must be a valid C symbol | g_motor_angle0 | Module name. |
Control type |
| Position | Select control Type |
Frequency of current control (kHz) | Must be a valid non-negative value. | 20.0 | Frequency of current control |
Decimation of Interrupt | Must be a valid integer. | 1 | Decimation of Interrupt |
Counts to get signal | Must be a valid integer. | 10 | Counts to get analog input signal |
Limit of signal error | Must be a valid integer. | 100 | Limit of signal error |
Coefficent of speed LPF | Must be a valid value | 0.07 | Coefficient of speed LPF |
A/D reference voltage | Must be a valid non-negative value. | 3.3 | Reference voltage of A/D converter |
A/D conversion scale | Must be a valid non-negative value. | 4095.0 | Conversion scale of A/D converter |
Openloop speed (rpm) | Must be a valid non-negative value. | 6.0 | Rotation speed at calibration openloop (rpm) |
D-axis current at openloop (A) | Must be a valid non-negative value. | 1.0 | D-axis current at calibration openloop (A) |
Angle adjustment times | Must be a valid integer. | 512 | Times to get signal at angle adjustment |
Calibration enable |
| Enable | Select enable/disable of signal calibration |
Induction sensor pole pairs | Must be a valid integer. | 4 | Induction sensor pole pairs |
Motor pole pairs | Must be a valid integer. | 4 | Motor pole pairs |
Clock Configuration
Pin Configuration
Usage Notes
Limitations
Developers should be aware of the following limitations when using the motor angle and speed calculation with induction sensor: all configurations should be set as positive values.
Examples
Basic Example
This is a basic example of minimal use of the motor angle and speed calculation with induction sensor in an application.
void motor_sense_encoder_basic_example (void)
{
assert(FSP_SUCCESS == err);
{
}
}
◆ motor_sense_induction_loop_t
Enumerator |
---|
MOTOR_SENSE_INDUCTION_LOOP_SPEED | Speed control mode.
|
MOTOR_SENSE_INDUCTION_LOOP_POSITION | Position control mode.
|
◆ motor_sense_induction_calibration_t
Enumerator |
---|
MOTOR_SENSE_INDUCTION_CALIBRATION_DISABLE | Disable calibration.
|
MOTOR_SENSE_INDUCTION_CALIBRATION_ENABLE | Enable calibration.
|
◆ motor_sense_induction_mode_t
Enumerator |
---|
MOTOR_SENSE_INDUCTION_MODE_INIT | Initialize mode (Start status)
|
MOTOR_SENSE_INDUCTION_MODE_BOOT | Boot mode (Angle adjustment status)
|
MOTOR_SENSE_INDUCTION_MODE_DRIVE | Drive mode (Normal work status)
|
◆ RM_MOTOR_SENSE_INDUCTION_Open()
Opens and configures the Angle module. Implements motor_angle_api_t::open.
- Return values
-
FSP_SUCCESS | Angle Induction module 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_SENSE_INDUCTION_Close()
Disables specified Angle 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_SENSE_INDUCTION_Reset()
Reset variables of Angle module. Implements motor_angle_api_t::reset.
- Return values
-
FSP_SUCCESS | Successfully closed. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_InternalCalculate()
Calculate internal parameters. Implements motor_angle_api_t::internalCalculate.
- Return values
-
FSP_SUCCESS | Successfully closed. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_AngleSpeedGet()
fsp_err_t RM_MOTOR_SENSE_INDUCTION_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 | Successfully data calculated. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_AngleAdjust()
Angle Adjustment Process. Implements motor_angle_api_t::angleAdjust.
- Return values
-
FSP_SUCCESS | Successfully data calculated. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_EncoderCyclic()
Encoder Cyclic Process (Call in cyclic timer). Implements motor_angle_api_t::encoderCyclic.
- Return values
-
FSP_ERR_UNSUPPORTED | Motor sense induction software encoderCyclic is not supported. |
◆ RM_MOTOR_SENSE_INDUCTION_CyclicProcess()
Induction sensor Cyclic Process (Call in cyclic timer). Implements motor_angle_api_t::cyclicProcess.
- Return values
-
FSP_SUCCESS | Successfully data calculated. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_InfoGet()
Gets information of Angle Module. Implements motor_angle_api_t::infoGet.
- Return values
-
FSP_SUCCESS | Successfully data calculated. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_CorrectReset()
Reset to restart calibration Angle module.
- Return values
-
FSP_SUCCESS | Successfully closed. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_ErrorGet()
Gets the error information about induction correction.
- Return values
-
FSP_SUCCESS | Successfully data calculated. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_ParameterUpdate()
Update the parameters of angle & speed calculation. 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_SENSE_INDUCTION_SensorDataSet()
Set A/D Converted Data. Implements motor_angle_api_t::sensorDataSet.
- Return values
-
FSP_SUCCESS | Successfully data is update. |
FSP_ERR_ASSERTION | Null pointer. |
FSP_ERR_NOT_OPEN | Module is not open. |
◆ RM_MOTOR_SENSE_INDUCTION_CurrentSet()
Set d/q-axis Current Data & Voltage Reference. Implements motor_angle_api_t::currentSet.
- Return values
-
FSP_ERR_UNSUPPORTED | Motor sense induction software currentSet is not supported. |
◆ RM_MOTOR_SENSE_INDUCTION_SpeedSet()
Set Speed Information. Implements motor_angle_api_t::speedSet.
- Return values
-
FSP_ERR_UNSUPPORTED | Motor sense induction software speedSet is not supported. |
◆ RM_MOTOR_SENSE_INDUCTION_FlagPiCtrlSet()
Set the flag of PI Control runs. Implements motor_angle_api_t::flagPiCtrlSet.
- Return values
-
FSP_ERR_UNSUPPORTED | Motor sense induction software flagPiCtrlSet is not supported. |
◆ RM_MOTOR_SENSE_INDUCTION_EstimatedComponentGet()