industry/foc: rename dir to sensor_dir to be clear that it relates to the direction of the sensor, no movement direction

This commit is contained in:
raiden00pl 2022-02-19 17:36:40 +01:00 committed by Xiang Xiao
parent 34e4da2304
commit d6cdc5a423
5 changed files with 18 additions and 18 deletions

View File

@ -50,7 +50,7 @@ struct foc_observer_f32_s
{
struct foc_observer_cfg_f32_s cfg;
struct motor_aobserver_f32_s data;
float dir;
float sensor_dir;
};
/****************************************************************************
@ -198,7 +198,7 @@ static int foc_angle_onfo_cfg_f32(FAR foc_angle_f32_t *h, FAR void *cfg)
/* Initialize with CW direction */
ob->dir = DIR_CW;
ob->sensor_dir = DIR_CW;
return OK;
errout:
@ -264,7 +264,7 @@ static int foc_angle_onfo_dir_f32(FAR foc_angle_f32_t *h, float dir)
/* Configure direction */
ob->dir = dir;
ob->sensor_dir = dir;
return OK;
}

View File

@ -41,7 +41,7 @@ struct foc_observer_f32_s
{
struct foc_observer_cfg_f32_s cfg;
struct motor_aobserver_f32_s data;
float dir;
float sensor_dir;
};
/****************************************************************************
@ -188,7 +188,7 @@ static int foc_angle_osmo_cfg_f32(FAR foc_angle_f32_t *h, FAR void *cfg)
/* Initialize with CW direction */
ob->dir = DIR_CW;
ob->sensor_dir = DIR_CW;
return OK;
errout:
@ -254,7 +254,7 @@ static int foc_angle_osmo_dir_f32(FAR foc_angle_f32_t *h, float dir)
/* Configure direction */
ob->dir = dir;
ob->sensor_dir = dir;
return OK;
}

View File

@ -48,7 +48,7 @@ struct foc_qenco_f32_s
int32_t pos;
int32_t offset;
float one_by_posmax;
float dir;
float sensor_dir;
float angle;
struct foc_qenco_cfg_f32_s cfg;
};
@ -226,7 +226,7 @@ static int foc_angle_qe_cfg_f32(FAR foc_angle_f32_t *h, FAR void *cfg)
/* Initialize with CW direction */
qe->dir = DIR_CW;
qe->sensor_dir = DIR_CW;
/* Reset offset */
@ -303,7 +303,7 @@ static int foc_angle_qe_dir_f32(FAR foc_angle_f32_t *h, float dir)
/* Configure direction */
qe->dir = dir;
qe->sensor_dir = dir;
return OK;
}
@ -346,7 +346,7 @@ static int foc_angle_qe_run_f32(FAR foc_angle_f32_t *h,
/* Get mechanical angle */
qe->angle = (qe->dir * (qe->pos - qe->offset) *
qe->angle = (qe->sensor_dir * (qe->pos - qe->offset) *
qe->one_by_posmax * MOTOR_ANGLE_M_MAX);
/* Normalize angle */

View File

@ -49,7 +49,7 @@ struct foc_div_f32_s
struct foc_vel_div_f32_cfg_s cfg;
struct motor_sobserver_div_f32_s data;
struct motor_sobserver_f32_s o;
float dir;
float sensor_dir;
};
/****************************************************************************
@ -176,7 +176,7 @@ static int foc_velocity_div_cfg_f32(FAR foc_velocity_f32_t *h, FAR void *cfg)
/* Initialize with CW direction */
div->dir = DIR_CW;
div->sensor_dir = DIR_CW;
return ret;
}
@ -237,7 +237,7 @@ static int foc_velocity_div_dir_f32(FAR foc_velocity_f32_t *h, float dir)
/* Set direction */
div->dir = dir;
div->sensor_dir = dir;
return OK;
}
@ -273,7 +273,7 @@ static int foc_velocity_div_run_f32(FAR foc_velocity_f32_t *h,
/* Copy data */
out->velocity = div->dir * motor_sobserver_speed_get(&div->o);
out->velocity = div->sensor_dir * motor_sobserver_speed_get(&div->o);
return OK;
}

View File

@ -49,7 +49,7 @@ struct foc_pll_f32_s
struct foc_vel_pll_f32_cfg_s cfg;
struct motor_sobserver_pll_f32_s data;
struct motor_sobserver_f32_s o;
float dir;
float sensor_dir;
};
/****************************************************************************
@ -175,7 +175,7 @@ static int foc_velocity_pll_cfg_f32(FAR foc_velocity_f32_t *h, FAR void *cfg)
/* Initialize with CW direction */
pll->dir = DIR_CW;
pll->sensor_dir = DIR_CW;
return ret;
}
@ -235,7 +235,7 @@ static int foc_velocity_pll_dir_f32(FAR foc_velocity_f32_t *h, float dir)
/* Set direction */
pll->dir = dir;
pll->sensor_dir = dir;
return OK;
}
@ -271,7 +271,7 @@ static int foc_velocity_pll_run_f32(FAR foc_velocity_f32_t *h,
/* Copy data */
out->velocity = pll->dir * motor_sobserver_speed_get(&pll->o);
out->velocity = pll->sensor_dir * motor_sobserver_speed_get(&pll->o);
return OK;
}