RA Flexible Software Package Documentation  Release v5.2.0

 
Motor current Interface

Detailed Description

Interface for motor current functions.

Summary

The Motor current interface for getting the PWM modulation duty from electric current and speed

Data Structures

struct  motor_current_output_t
 
struct  motor_current_input_current_t
 
struct  motor_current_input_voltage_t
 
struct  motor_current_get_voltage_t
 
struct  motor_current_cfg_t
 
struct  motor_current_api_t
 
struct  motor_current_instance_t
 

Typedefs

typedef void motor_current_ctrl_t
 

Enumerations

enum  motor_current_event_t
 

Data Structure Documentation

◆ motor_current_output_t

struct motor_current_output_t

Structure of interface to speed control Output parameters

Data Fields
float f_id D-axis current [A].
float f_iq Q-axis current [A].
float f_vamax
float f_speed_rad Speed value [rad/s].
float f_speed_rpm Speed value [rpm].
float f_rotor_angle Motor rotor angle [rad].
float f_position_rad Motor rotor position [rad].
float f_ed Estimated d-axis component[V] of flux due to the permanent magnet.
float f_eq Estimated q-axis component[V] of flux due to the permanent magnet.
float f_phase_err_rad Phase error [rad].
uint8_t u1_flag_get_iref Flag to set d/q-axis current reference.
uint8_t u1_adjust_status Angle adjustment satatus.
uint8_t u1_adjust_count_full Angle adjustment count full.
uint8_t u1_openloop_status Openloop status.
float f_openloop_speed Openloop speed.
float f_openloop_id_ref Openloop d-axis current.

◆ motor_current_input_current_t

struct motor_current_input_current_t

Three-phase input current

Data Fields
float iu U phase current[A].
float iv V phase current[A].
float iw W phase current[A].

◆ motor_current_input_voltage_t

struct motor_current_input_voltage_t

Input voltage

Data Fields
float vdc Main line voltage[V].
float va_max Maximum magnitude of voltage vector[V].

◆ motor_current_get_voltage_t

struct motor_current_get_voltage_t

Struct to get motor current

Data Fields
float u_voltage U phase voltage[V].
float v_voltage V phase voltage[V].
float w_voltage W phase voltage[V].
float vd_reference d-axis voltage reference
float vq_reference q-axis voltage reference

◆ motor_current_cfg_t

struct motor_current_cfg_t

Configuration parameters.

◆ motor_current_api_t

struct motor_current_api_t

Functions implemented at the Motor Current Module will follow these APIs.

Data Fields

fsp_err_t(* open )(motor_current_ctrl_t *const p_ctrl, motor_current_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(motor_current_ctrl_t *const p_ctrl)
 
fsp_err_t(* reset )(motor_current_ctrl_t *const p_ctrl)
 
fsp_err_t(* run )(motor_current_ctrl_t *const p_ctrl)
 
fsp_err_t(* parameterSet )(motor_current_ctrl_t *const p_ctrl, motor_current_input_t const *const p_st_input)
 
fsp_err_t(* currentReferenceSet )(motor_current_ctrl_t *const p_ctrl, float const id_reference, float const iq_reference)
 
fsp_err_t(* speedPhaseSet )(motor_current_ctrl_t *const p_ctrl, float const speed_rad, float const phase_rad)
 
fsp_err_t(* 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)
 
fsp_err_t(* parameterGet )(motor_current_ctrl_t *const p_ctrl, motor_current_output_t *const p_st_output)
 
fsp_err_t(* currentGet )(motor_current_ctrl_t *const p_ctrl, float *const p_id, float *const p_iq)
 
fsp_err_t(* phaseVoltageGet )(motor_current_ctrl_t *const p_ctrl, motor_current_get_voltage_t *const p_voltage)
 
fsp_err_t(* parameterUpdate )(motor_current_ctrl_t *const p_ctrl, motor_current_cfg_t const *const p_cfg)
 

Field Documentation

◆ open

fsp_err_t(* motor_current_api_t::open) (motor_current_ctrl_t *const p_ctrl, motor_current_cfg_t const *const p_cfg)

Initialize the motor current module.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to configuration structure.

◆ close

fsp_err_t(* motor_current_api_t::close) (motor_current_ctrl_t *const p_ctrl)

Close (Finish) the motor current module.

Parameters
[in]p_ctrlPointer to control structure.

◆ reset

fsp_err_t(* motor_current_api_t::reset) (motor_current_ctrl_t *const p_ctrl)

Reset variables for the motor current module.

Parameters
[in]p_ctrlPointer to control structure.

◆ run

fsp_err_t(* motor_current_api_t::run) (motor_current_ctrl_t *const p_ctrl)

Activate the motor current control.

Parameters
[in]p_ctrlPointer to control structure.

◆ parameterSet

fsp_err_t(* motor_current_api_t::parameterSet) (motor_current_ctrl_t *const p_ctrl, motor_current_input_t const *const p_st_input)

Set (Input) parameters into the motor current module.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_st_inputPointer to input data structure(speed control output data)

◆ currentReferenceSet

fsp_err_t(* motor_current_api_t::currentReferenceSet) (motor_current_ctrl_t *const p_ctrl, float const id_reference, float const iq_reference)

Set (Input) Current reference into the motor current module.

Parameters
[in]p_ctrlPointer to control structure.
[in]id_referenceD-axis current reference [A]
[in]iq_referenceQ-axis current reference [A]

◆ speedPhaseSet

fsp_err_t(* motor_current_api_t::speedPhaseSet) (motor_current_ctrl_t *const p_ctrl, float const speed_rad, float const phase_rad)

Set (Input) Speed & Phase data into the motor current module.

Parameters
[in]p_ctrlPointer to control structure.
[in]speed_radRotational speed [rad/s]
[in]phase_radRotor phase [rad]

◆ currentSet

fsp_err_t(* motor_current_api_t::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 (Input) Current data into the motor current module.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_st_currentPointer to input current structure
[in]p_st_voltagePointer to input voltage structure

◆ parameterGet

fsp_err_t(* motor_current_api_t::parameterGet) (motor_current_ctrl_t *const p_ctrl, motor_current_output_t *const p_st_output)

Get (output) parameters from the motor current module

Parameters
[in]p_ctrlPointer to control structure.
[out]p_st_outputPointer to output data structure(speed control input data)

◆ currentGet

fsp_err_t(* motor_current_api_t::currentGet) (motor_current_ctrl_t *const p_ctrl, float *const p_id, float *const p_iq)

Get d/q-axis current

Parameters
[in]p_ctrlPointer to control structure.
[out]p_idPointer to get d-axis current [A]
[out]p_iqPointer to get q-axis current [A]

◆ phaseVoltageGet

fsp_err_t(* motor_current_api_t::phaseVoltageGet) (motor_current_ctrl_t *const p_ctrl, motor_current_get_voltage_t *const p_voltage)

Get phase output voltage

Parameters
[in]p_ctrlPointer to control structure.
[out]p_voltagePointer to get voltages

◆ parameterUpdate

fsp_err_t(* motor_current_api_t::parameterUpdate) (motor_current_ctrl_t *const p_ctrl, motor_current_cfg_t const *const p_cfg)

Update parameters for the calculation in the motor current control.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to configuration structure include update parameters.

◆ motor_current_instance_t

struct motor_current_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
motor_current_ctrl_t * p_ctrl Pointer to the control structure for this instance.
motor_current_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
motor_current_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ motor_current_ctrl_t

typedef void motor_current_ctrl_t

Control block. Allocate an instance specific control block to pass into the API calls.

Enumeration Type Documentation

◆ motor_current_event_t

Events that can trigger a callback function

Enumerator
MOTOR_CURRENT_EVENT_FORWARD 

Event forward current control.

MOTOR_CURRENT_EVENT_DATA_SET 

Event set speed control output data.

MOTOR_CURRENT_EVENT_BACKWARD 

Event backward current control.