examples/foc: get velocity from observer if sensored mode
This commit is contained in:
parent
c5314b54a4
commit
eeacbdde3a
examples/foc
@ -1230,7 +1230,7 @@ static int foc_motor_vel_get(FAR struct foc_motor_b16_s *motor)
|
||||
UNUSED(vout);
|
||||
|
||||
motor->vel_el = motor->vel.set;
|
||||
#elif defined(CONFIG_EXAMPLES_FOC_VELOBS)
|
||||
#elif defined(CONFIG_EXAMPLES_FOC_VELOBS) && defined(CONFIG_EXAMPLES_FOC_SENSORLESS)
|
||||
if (motor->openloop_now == FOC_OPENLOOP_DISABLED)
|
||||
{
|
||||
/* Get electrical velocity from observer if we are in closed-loop */
|
||||
@ -1243,6 +1243,10 @@ static int foc_motor_vel_get(FAR struct foc_motor_b16_s *motor)
|
||||
|
||||
motor->vel_el = motor->vel.set;
|
||||
}
|
||||
#elif defined(CONFIG_EXAMPLES_FOC_VELOBS) && defined(CONFIG_EXAMPLES_FOC_SENSORED)
|
||||
/* Get electrical velocity from observer in sensored mode */
|
||||
|
||||
motor->vel_el = motor->vel_obs;
|
||||
#else
|
||||
/* Need electrical velocity source here - raise assertion */
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ static int foc_motor_vel_get(FAR struct foc_motor_f32_s *motor)
|
||||
UNUSED(vout);
|
||||
|
||||
motor->vel_el = motor->vel.set;
|
||||
#elif defined(CONFIG_EXAMPLES_FOC_VELOBS)
|
||||
#elif defined(CONFIG_EXAMPLES_FOC_VELOBS) && defined(CONFIG_EXAMPLES_FOC_SENSORLESS)
|
||||
if (motor->openloop_now == FOC_OPENLOOP_DISABLED)
|
||||
{
|
||||
/* Get electrical velocity from observer if we are in closed-loop */
|
||||
@ -1230,6 +1230,10 @@ static int foc_motor_vel_get(FAR struct foc_motor_f32_s *motor)
|
||||
|
||||
motor->vel_el = motor->vel.set;
|
||||
}
|
||||
#elif defined(CONFIG_EXAMPLES_FOC_VELOBS) && defined(CONFIG_EXAMPLES_FOC_SENSORED)
|
||||
/* Get electrical velocity from observer in sensored mode */
|
||||
|
||||
motor->vel_el = motor->vel_obs;
|
||||
#else
|
||||
/* Need electrical velocity source here - raise assertion */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user