Go to the source code of this file.
Data Structures | |
| struct | mcl_encoder_uvw_level_t |
| uvw level 0 or 1 More... | |
| struct | mcl_encoder_callback |
| callback function More... | |
| struct | mcl_encoder_cal_speed_t_function_t |
| struct | mcl_encoder_cal_speed_m_function_t |
| struct | mcl_encoder_cal_speed_m_t_function_t |
| struct | mcl_encoder_cal_speed_pll_cfg_t |
| pll filter configuration More... | |
| struct | mcl_encoder_cal_speed_pll_function_t |
| Running data for the pll method of calculating speed. More... | |
| struct | mcl_encoer_cfg_t |
| Encoder Configuration. More... | |
| struct | mcl_encoder_t |
| Encoder operation data. More... | |
Macros | |
| #define | MCL_ENCODER_CAL_STRUCT_MAX_MEMMORY (16) |
| Maximum memory required for computational speed, word. More... | |
Typedefs | |
| typedef struct mcl_encoder_callback | mcl_encoder_callback_t |
| callback function More... | |
Enumerations | |
| enum | { mcl_encoder_start_sample_error = MAKE_STATUS(mcl_group_encoder, 0) , mcl_encoder_get_tick_error = MAKE_STATUS(mcl_group_encoder, 1) , mcl_encoder_update_tick_error = MAKE_STATUS(mcl_group_encoder, 2) , mcl_encoder_get_theta_error = MAKE_STATUS(mcl_group_encoder, 3) , mcl_encoder_not_ready = MAKE_STATUS(mcl_group_encoder, 4) , mcl_encoder_get_uvw_error = MAKE_STATUS(mcl_group_encoder, 5) } |
| enum | mcl_encoder_status_t { encoder_status_null = 0 , encoder_status_init = 1 , encoder_status_run = 2 , encoder_status_fail = 3 } |
| enum | mcl_encoder_cal_speed_function_t { encoder_method_t , encoder_method_m , encoder_method_m_t , encoder_method_pll , encoder_method_user } |
| Method of calculating speed. More... | |
Functions | |
| hpm_mcl_stat_t | hpm_mcl_encoder_init (mcl_encoder_t *encoder, mcl_cfg_t *mcl_cfg, mcl_encoer_cfg_t *encoder_cfg, mcl_filter_iir_df1_t *iir) |
| Initialize encoder data. More... | |
| hpm_mcl_stat_t | hpm_mcl_encoder_start_sample (mcl_encoder_t *encoder) |
| Encoder starts sampling. More... | |
| hpm_mcl_stat_t | hpm_mcl_encoder_set_initial_theta (mcl_encoder_t *encoder, float theta) |
| Sets the initial value of the angle. Normally, the programme does the initial value setting automatically, but if you are not satisfied with the result, you can set the initial value. The initial value determines the zero point of the electrical angle. This means that the angle read by the sensor is calibrated to zero by the initial value. More... | |
| hpm_mcl_stat_t | hpm_mcl_encoder_process (mcl_encoder_t *encoder, uint32_t tick_deta) |
| Encoder processing, cycle call. More... | |
| hpm_mcl_stat_t | hpm_mcl_encoder_set_status (mcl_encoder_t *encoder, mcl_encoder_status_t status) |
| Force update of encoder status. More... | |
| float | hpm_mcl_encoder_get_theta (mcl_encoder_t *encoder) |
| Get the encoder angle value. More... | |
| float | hpm_mcl_encoder_get_speed (mcl_encoder_t *encoder) |
| Get speed. More... | |
| float | hpm_mcl_encoder_get_forecast_theta (mcl_encoder_t *encoder) |
| Get the angle predicted from the speed. More... | |
| float | hpm_mcl_encoder_get_raw_theta (mcl_encoder_t *encoder) |
| Getting the raw angle data of the encoder. More... | |
| void | hpm_mcl_encoder_force_theta (mcl_encoder_t *encoder, float theta, bool enable) |
| Force setting of the output angle of the encoder function. More... | |
| hpm_mcl_stat_t | hpm_mcl_encoder_get_absolute_theta (mcl_encoder_t *encoder, float *theta) |
| Get the absolute position of the angle. More... | |
| hpm_mcl_stat_t | hpm_mcl_encoder_get_uvw_status (mcl_encoder_t *encoder, mcl_encoder_uvw_level_t *level) |
| Get level status of uvw. More... | |
| float | hpm_mcl_encoder_get_sensorless_theta (mcl_encoder_t *encoder) |
| Get sensorless theta. More... | |
| #define MCL_ENCODER_CAL_STRUCT_MAX_MEMMORY (16) |
Maximum memory required for computational speed, word.
| typedef struct mcl_encoder_callback mcl_encoder_callback_t |
callback function
| anonymous enum |
| enum mcl_encoder_status_t |
| void hpm_mcl_encoder_force_theta | ( | mcl_encoder_t * | encoder, |
| float | theta, | ||
| bool | enable | ||
| ) |
Force setting of the output angle of the encoder function.
| encoder | mcl_encoder_t |
| theta | rad |
| enable | Enable or disable the forced output function |
| hpm_mcl_stat_t hpm_mcl_encoder_get_absolute_theta | ( | mcl_encoder_t * | encoder, |
| float * | theta | ||
| ) |
Get the absolute position of the angle.
| encoder | mcl_encoder_t |
| theta | rad |
| float hpm_mcl_encoder_get_forecast_theta | ( | mcl_encoder_t * | encoder | ) |
| float hpm_mcl_encoder_get_raw_theta | ( | mcl_encoder_t * | encoder | ) |
| float hpm_mcl_encoder_get_sensorless_theta | ( | mcl_encoder_t * | encoder | ) |
| float hpm_mcl_encoder_get_speed | ( | mcl_encoder_t * | encoder | ) |
| float hpm_mcl_encoder_get_theta | ( | mcl_encoder_t * | encoder | ) |
| hpm_mcl_stat_t hpm_mcl_encoder_get_uvw_status | ( | mcl_encoder_t * | encoder, |
| mcl_encoder_uvw_level_t * | level | ||
| ) |
Get level status of uvw.
| encoder | mcl_encoder_t |
| level | 0: low , 1: high |
| hpm_mcl_stat_t hpm_mcl_encoder_init | ( | mcl_encoder_t * | encoder, |
| mcl_cfg_t * | mcl_cfg, | ||
| mcl_encoer_cfg_t * | encoder_cfg, | ||
| mcl_filter_iir_df1_t * | iir | ||
| ) |
Initialize encoder data.
| encoder | mcl_encoder_t |
| mcl_cfg | mcl_cfg_t |
| encoder_cfg | mcl_encoer_cfg_t |
| iir | mcl_filter_iir_df1_t |
parameter check
null function initialisation
parameter initial
| hpm_mcl_stat_t hpm_mcl_encoder_process | ( | mcl_encoder_t * | encoder, |
| uint32_t | tick_deta | ||
| ) |
Encoder processing, cycle call.
| encoder | mcl_encoder_t |
| tick_deta | Difference in the number of cycles between two calls |
iir filter
| hpm_mcl_stat_t hpm_mcl_encoder_set_initial_theta | ( | mcl_encoder_t * | encoder, |
| float | theta | ||
| ) |
Sets the initial value of the angle. Normally, the programme does the initial value setting automatically, but if you are not satisfied with the result, you can set the initial value. The initial value determines the zero point of the electrical angle. This means that the angle read by the sensor is calibrated to zero by the initial value.
| encoder | mcl_encoder_t |
| theta | Used to calibrate electrical angle to zero |
| hpm_mcl_stat_t hpm_mcl_encoder_set_status | ( | mcl_encoder_t * | encoder, |
| mcl_encoder_status_t | status | ||
| ) |
Force update of encoder status.
| encoder | mcl_encoder_t |
| status | mcl_encoder_status_t |
| hpm_mcl_stat_t hpm_mcl_encoder_start_sample | ( | mcl_encoder_t * | encoder | ) |