examples/foc: change the velocity ramp parameters scale to x1
controlling the ramp with greather accuracy makes no practical sense
This commit is contained in:
parent
8568439b80
commit
292b0cbc28
@ -568,15 +568,15 @@ config EXAMPLES_FOC_IDQ_KI
|
|||||||
endif #EXAMPLES_FOC_CONTROL_PI
|
endif #EXAMPLES_FOC_CONTROL_PI
|
||||||
|
|
||||||
config EXAMPLES_FOC_RAMP_THR
|
config EXAMPLES_FOC_RAMP_THR
|
||||||
int "FOC velocity ramp threshold [x1000]"
|
int "FOC velocity ramp threshold [x1]"
|
||||||
default 0
|
default 0
|
||||||
|
|
||||||
config EXAMPLES_FOC_RAMP_ACC
|
config EXAMPLES_FOC_RAMP_ACC
|
||||||
int "FOC velocity ramp acc [x1000]"
|
int "FOC velocity ramp acc [x1]"
|
||||||
default 0
|
default 0
|
||||||
|
|
||||||
config EXAMPLES_FOC_RAMP_DEC
|
config EXAMPLES_FOC_RAMP_DEC
|
||||||
int "FOC velocity ramp dec [x1000]"
|
int "FOC velocity ramp dec [x1]"
|
||||||
default 0
|
default 0
|
||||||
|
|
||||||
config EXAMPLES_FOC_HAVE_ALIGN
|
config EXAMPLES_FOC_HAVE_ALIGN
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
/* Velocity ramp configuration */
|
/* Velocity ramp configuration */
|
||||||
|
|
||||||
#define RAMP_CFG_THR (CONFIG_EXAMPLES_FOC_RAMP_THR / 1000.0f)
|
#define RAMP_CFG_THR (CONFIG_EXAMPLES_FOC_RAMP_THR / 1.0f)
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_FOC_STATE_USE_MODEL_PMSM
|
#ifdef CONFIG_EXAMPLES_FOC_STATE_USE_MODEL_PMSM
|
||||||
|
|
||||||
@ -237,8 +237,8 @@ struct foc_thr_cfg_s
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_EXAMPLES_FOC_HAVE_VEL
|
#ifdef CONFIG_EXAMPLES_FOC_HAVE_VEL
|
||||||
uint32_t velmax; /* Velocity max (x1000) */
|
uint32_t velmax; /* Velocity max (x1000) */
|
||||||
uint32_t acc; /* Acceleration (x1000) */
|
uint32_t acc; /* Acceleration (x1) */
|
||||||
uint32_t dec; /* Deceleration (x1000) */
|
uint32_t dec; /* Deceleration (x1) */
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_EXAMPLES_FOC_HAVE_POS
|
#ifdef CONFIG_EXAMPLES_FOC_HAVE_POS
|
||||||
uint32_t posmax; /* Position max (x1000) */
|
uint32_t posmax; /* Position max (x1000) */
|
||||||
|
@ -307,8 +307,8 @@ static int foc_motor_configure(FAR struct foc_motor_b16_s *motor)
|
|||||||
ret = foc_ramp_init_b16(&motor->ramp,
|
ret = foc_ramp_init_b16(&motor->ramp,
|
||||||
motor->per,
|
motor->per,
|
||||||
ftob16(RAMP_CFG_THR),
|
ftob16(RAMP_CFG_THR),
|
||||||
ftob16((motor->envp->cfg->acc / 1000.0f)),
|
ftob16((motor->envp->cfg->acc / 1.0f)),
|
||||||
ftob16((motor->envp->cfg->dec / 1000.0f)));
|
ftob16((motor->envp->cfg->dec / 1.0f)));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
PRINTF("ERROR: foc_ramp_init failed %d\n", ret);
|
PRINTF("ERROR: foc_ramp_init failed %d\n", ret);
|
||||||
|
@ -307,8 +307,8 @@ static int foc_motor_configure(FAR struct foc_motor_f32_s *motor)
|
|||||||
ret = foc_ramp_init_f32(&motor->ramp,
|
ret = foc_ramp_init_f32(&motor->ramp,
|
||||||
motor->per,
|
motor->per,
|
||||||
RAMP_CFG_THR,
|
RAMP_CFG_THR,
|
||||||
(motor->envp->cfg->acc / 1000.0f),
|
(motor->envp->cfg->acc / 1.0f),
|
||||||
(motor->envp->cfg->dec / 1000.0f));
|
(motor->envp->cfg->dec / 1.0f));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
PRINTF("ERROR: foc_ramp_init failed %d\n", ret);
|
PRINTF("ERROR: foc_ramp_init failed %d\n", ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user