|
fsp_err_t | RM_MOTOR_CURRENT_Open (motor_current_ctrl_t *const p_ctrl, motor_current_cfg_t const *const p_cfg) |
| Opens and configures the Motor Current Module. Implements motor_current_api_t::open. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_Close (motor_current_ctrl_t *const p_ctrl) |
| Disables specified Motor Current Module. Implements motor_current_api_t::close. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_Reset (motor_current_ctrl_t *const p_ctrl) |
| Reset variables of Motor Current Module. Implements motor_current_api_t::reset. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_Run (motor_current_ctrl_t *const p_ctrl) |
| Run(Start) the Current Control. Implements motor_current_api_t::run. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_ParameterSet (motor_current_ctrl_t *const p_ctrl, motor_current_input_t const *const p_st_input) |
| Set (Input) Parameter Data. Implements motor_current_api_t::parameterSet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_CurrentReferenceSet (motor_current_ctrl_t *const p_ctrl, float const id_reference, float const iq_reference) |
| Set Current Reference Data. Implements motor_current_api_t::currentReferenceSet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_SpeedPhaseSet (motor_current_ctrl_t *const p_ctrl, float const speed, float const phase) |
| Set Current Speed & rotor phase Data. Implements motor_current_api_t::speedPhaseSet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_CurrentSet (motor_current_ctrl_t *const p_ctrl, motor_current_input_current_t const *const p_st_current, motor_current_input_voltage_t const *const p_st_voltage) |
| Set d/q-axis Current & Voltage Data. Implements motor_current_api_t::currentSet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_ParameterGet (motor_current_ctrl_t *const p_ctrl, motor_current_output_t *const p_st_output) |
| Get Output Parameters. Implements motor_current_api_t::parameterGet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_CurrentGet (motor_current_ctrl_t *const p_ctrl, float *const p_id, float *const p_iq) |
| Get d/q-axis Current. Implements motor_current_api_t::currentGet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_PhaseVoltageGet (motor_current_ctrl_t *const p_ctrl, motor_current_get_voltage_t *const p_voltage) |
| Gets the set phase voltage. Implements motor_current_api_t::phaseVoltageGet. More...
|
|
fsp_err_t | RM_MOTOR_CURRENT_ParameterUpdate (motor_current_ctrl_t *const p_ctrl, motor_current_cfg_t const *const p_cfg) |
| Update the parameters of Current Control. Implements motor_current_api_t::parameterUpdate. More...
|
|
void | rm_motor_current_encoder_cyclic (motor_current_instance_t const *p_ctrl) |
|
Calculation process for the motor control on RA MCUs. This module implements the Motor current Interface.
The motor current is used to control the electric current of motor rotation in an appication. This module should be called cyclically after the A/D conversion of electric current of each phase in an application. This module calculates each phase voltage with input current reference, electric current and rotor angle.
The Motor Current Module has below features.
The following build time configurations are defined in fsp_cfg/rm_motor_current_cfg.h:
This module can be added to the Stacks tab via New Stack > Motor > Motor Current Controller (rm_motor_current).
Configuration | Options | Default | Description |
General |
Name | Name must be a valid C symbol | g_motor_current0 | Module name. |
Sensor type |
-
Sensorless
-
Encoder
-
Induction
-
Hall
| Sensorless | Select sensor type |
Shunt type |
| 2 shunt | Select shunt type |
Current control decimation | Must be a valid non-negative value. | 0 | Decimation of current control. |
PWM carrier frequency (kHz) | Must be a valid value | 20.0F | PWM carrier frequency. |
Input voltage (V) | Must be a valid value | 24.0F | Input voltage for limitation of current PI control. |
Sample delay compensation |
| Enable | Select enable/disable sample delay compensation. |
Period magnification value | Must be a valid non-negative value. | 1.5 | Period magnification value for sampling delay compensation. |
Voltage error compensation |
| Enable | Select enable/disable voltage error compensation. |
Voltage error compensation table of voltage 1 | Must be a valid value | 0.672F | Voltage error compensation table of voltage. |
Voltage error compensation table of voltage 2 | Must be a valid value | 0.945F | Voltage error compensation table of voltage. |
Voltage error compensation table of voltage 3 | Must be a valid value | 1.054F | Voltage error compensation table of voltage. |
Voltage error compensation table of voltage 4 | Must be a valid value | 1.109F | Voltage error compensation table of voltage. |
Voltage error compensation table of voltage 5 | Must be a valid value | 1.192F | Voltage error compensation table of voltage. |
Voltage error compensation table of current 1 | Must be a valid value | 0.013F | Voltage error compensation table of current. |
Voltage error compensation table of current 2 | Must be a valid value | 0.049F | Voltage error compensation table of current. |
Voltage error compensation table of current 3 | Must be a valid value | 0.080F | Voltage error compensation table of current. |
Voltage error compensation table of current 4 | Must be a valid value | 0.184F | Voltage error compensation table of current. |
Voltage error compensation table of current 5 | Must be a valid value | 0.751F | Voltage error compensation table of current. |
Interrupts |
Callback | Name must be a valid C symbol | NULL | A user callback function. If this callback function is provided, it is called at A/D conversion finish interrupt. |
Design Parameter |
Current PI loop omega (Hz) | Must be a valid value | 300.0F | Current PI loop omega |
Current PI loop zeta | Must be a valid value | 1.0F | Current PI loop zeta |
Motor Parameter |
Pole pairs | Must be a valid non-negative value. | 2 | Pole pairs |
Resistance (ohm) | Must be a valid value | 8.5F | Resistance |
Inductance of d-axis (H) | Must be a valid value | 0.0045F | Inductance of d-axis |
Inductance of q-axis (H) | Must be a valid value | 0.0045F | Inductance of q-axis |
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 |
This module doesn't depend on clock setting, because this module is a simple calculation process.
This module does not use I/O pins.
This is a basic example of minimal use of the Motor Current in an application.
void motor_current_basic_example (void)
{
assert(FSP_SUCCESS == err);
{
temp_input_current.
iu = 1.0F;
temp_input_current.
iv = 1.0F;
temp_input_current.
iw = 1.0F;
temp_input_voltage.
vdc = 24.0F;
temp_input_voltage.
va_max = 24.0F;
(void) RM_MOTOR_CURRENT_PhaseVolageGet(g_test_motor_current.p_ctrl, &temp_get_voltage);
}
}