RA Flexible Software Package Documentation  Release v5.2.0

 
Motor speed Interface

Detailed Description

Interface for motor speed functions.

Summary

The Motor speed interface for getting the current references from electric current and rotational speed

Data Structures

struct  motor_speed_callback_args_t
 
struct  motor_speed_position_data_t
 
struct  motor_speed_cfg_t
 
struct  motor_speed_api_t
 
struct  motor_speed_instance_t
 

Typedefs

typedef void motor_speed_ctrl_t
 

Enumerations

enum  motor_speed_event_t
 
enum  motor_speed_loop_mode_t
 
enum  motor_speed_step_t
 

Data Structure Documentation

◆ motor_speed_callback_args_t

struct motor_speed_callback_args_t

Callback function parameter data

Data Fields
void const * p_context Placeholder for user data.
motor_speed_event_t event

◆ motor_speed_position_data_t

struct motor_speed_position_data_t

Motor speed and position structure

Data Fields
motor_speed_step_t e_step_mode Select step mode.
motor_speed_loop_mode_t e_loop_mode Select control mode.
int16_t position_reference_degree Position reference [degree].

◆ motor_speed_cfg_t

struct motor_speed_cfg_t

Configuration parameters.

Data Fields

motor_speed_input_t * st_input
 Input data structure for automatic set.
 
motor_speed_output_t * st_output
 Output data structure for automatic receive.
 
motor_position_instance_t const * p_position_instance
 Position module instance.
 
void const * p_context
 Placeholder for user data.
 

◆ motor_speed_api_t

struct motor_speed_api_t

Functions implemented at the HAL layer will follow these APIs.

Data Fields

fsp_err_t(* open )(motor_speed_ctrl_t *const p_ctrl, motor_speed_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(motor_speed_ctrl_t *const p_ctrl)
 
fsp_err_t(* reset )(motor_speed_ctrl_t *const p_ctrl)
 
fsp_err_t(* run )(motor_speed_ctrl_t *const p_ctrl)
 
fsp_err_t(* speedReferenceSet )(motor_speed_ctrl_t *const p_ctrl, float const speed_reference_rpm)
 
fsp_err_t(* positionReferenceSet )(motor_speed_ctrl_t *const p_ctrl, motor_speed_position_data_t const *const p_position_data)
 
fsp_err_t(* parameterSet )(motor_speed_ctrl_t *const p_ctrl, motor_speed_input_t const *const p_st_input)
 
fsp_err_t(* speedControl )(motor_speed_ctrl_t *const p_ctrl)
 
fsp_err_t(* parameterGet )(motor_speed_ctrl_t *const p_ctrl, motor_speed_output_t *const p_st_output)
 
fsp_err_t(* parameterUpdate )(motor_speed_ctrl_t *const p_ctrl, motor_speed_cfg_t const *const p_cfg)
 

Field Documentation

◆ open

fsp_err_t(* motor_speed_api_t::open) (motor_speed_ctrl_t *const p_ctrl, motor_speed_cfg_t const *const p_cfg)

Initialize the motor speed module.

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

◆ close

fsp_err_t(* motor_speed_api_t::close) (motor_speed_ctrl_t *const p_ctrl)

Close (Finish) the motor speed module.

Parameters
[in]p_ctrlPointer to control structure.

◆ reset

fsp_err_t(* motor_speed_api_t::reset) (motor_speed_ctrl_t *const p_ctrl)

Reset(Stop) the motor speed module.

Parameters
[in]p_ctrlPointer to control structure.

◆ run

fsp_err_t(* motor_speed_api_t::run) (motor_speed_ctrl_t *const p_ctrl)

Activate the motor speed control.

Parameters
[in]p_ctrlPointer to control structure.

◆ speedReferenceSet

fsp_err_t(* motor_speed_api_t::speedReferenceSet) (motor_speed_ctrl_t *const p_ctrl, float const speed_reference_rpm)

Set (Input) speed reference into the motor speed module.

Parameters
[in]p_ctrlPointer to control structure.
[in]speed_refernce_rpmSpeed reference [rpm]

◆ positionReferenceSet

fsp_err_t(* motor_speed_api_t::positionReferenceSet) (motor_speed_ctrl_t *const p_ctrl, motor_speed_position_data_t const *const p_position_data)

Set (Input) position reference and control mode

Parameters
[in]p_ctrlPointer to control structure.
[in]p_position_dataPointer to structure position data

◆ parameterSet

fsp_err_t(* motor_speed_api_t::parameterSet) (motor_speed_ctrl_t *const p_ctrl, motor_speed_input_t const *const p_st_input)

Set (Input) speed parameters into the motor speed module.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_st_inputPointer to structure to input parameters.

◆ speedControl

fsp_err_t(* motor_speed_api_t::speedControl) (motor_speed_ctrl_t *const p_ctrl)

Calculate current reference

Parameters
[in]p_ctrlPointer to control structure.

◆ parameterGet

fsp_err_t(* motor_speed_api_t::parameterGet) (motor_speed_ctrl_t *const p_ctrl, motor_speed_output_t *const p_st_output)

Get speed control output parameters

Parameters
[in]p_ctrlPointer to control structure.
[out]p_st_outputPointer to get speed control parameters

◆ parameterUpdate

fsp_err_t(* motor_speed_api_t::parameterUpdate) (motor_speed_ctrl_t *const p_ctrl, motor_speed_cfg_t const *const p_cfg)

Update Parameters for the calculation in the motor speed module.

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

◆ motor_speed_instance_t

struct motor_speed_instance_t

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

Data Fields
motor_speed_ctrl_t * p_ctrl Pointer to the control structure for this instance.
motor_speed_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
motor_speed_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ motor_speed_ctrl_t

typedef void motor_speed_ctrl_t

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

Enumeration Type Documentation

◆ motor_speed_event_t

Events that can trigger a callback function

Enumerator
MOTOR_SPEED_EVENT_FORWARD 

Event forward speed control.

MOTOR_SPEED_EVENT_BACKWARD 

Event backward speed control.

MOTOR_SPEED_EVENT_ENCODER_CYCLIC 

Event encoder cyclic.

MOTOR_SPEED_EVENT_ENCODER_ADJUST 

Event encoder adjust.

◆ motor_speed_loop_mode_t

Enumerator
MOTOR_SPEED_LOOP_MODE_SPEED 

Speed control mode.

MOTOR_SPEED_LOOP_MODE_POSITION 

Position control mode.

◆ motor_speed_step_t

Enumerator
MOTOR_SPEED_STEP_DISABLE 

Position control works without step mode.

MOTOR_SPEED_STEP_ENABLE 

Position control works with step mode.