Hi,
I'm using the vesc 75_300 with firmwware 5.3 version with pwm app
In "pid speed no reverse" mode (helicopter application), when the servo reach 0, I have a strong brake of the motor.
In "current mode no reverse", there is not his problem, current and duty seems always positive and I can stop more quickly without active braking.
Here is the graph screenshot with a pwm down ramp of 17s to avoid to break all my mechanic (no free wheel, so active breaking is prohibited)
Thanks in advance
For most propeller applications current control is the best choice. Is there a reason for PID choosing speed control? The motor will try to reach the dialed speed as quickly as possible when you cahnge a speed command. That includes braking the rotor to achieve that speed.
Hi,
Thanks for answering.
Yes for first integration I need the vesc internal pid since I used it on the castle creation controler I used before.
My helicopter autopilot fly with constant consign but you're right, in the futur, I probably change the way to do (but current) it but I need first to have CAN bus support to have all the data with good bandwidth to do it correctly.
Regarding the pid no reverse, In the code there is already a limitation when "allow brake" is disable to avoid putting negative output if abs(rpm) > 20
file mcpwm_foc.c : function run_pid_control_speed
// Optionally disable braking
if (!conf_now->s_pid_allow_braking) {
if (rpm > 20.0 && output < 0.0) {
output = 0.0;
}
if (rpm < -20.0 && output > 0.0) {
output = 0.0;
}
}
I will try to let a minimum of output instead 0.0 by adding something like this block just before the line : utils_truncate_number_abs(&output, 1.0);
#ifdef PID_FOC_TRUE_NO_BRAKE
if (!conf_now->s_pid_allow_braking)
{
//memorize the sign of output if possible
static int last_speed_pid_set_rpm_sign = 0;
if (motor->m_speed_pid_set_rpm > FLT_EPSILON)
last_speed_pid_set_rpm_sign = 1;
else if (motor->m_speed_pid_set_rpm < -FLT_EPSILON)
last_speed_pid_set_rpm_sign = -1;
else
{
if (fabsf(rpm) > 20)
{
//m_speed_pid_set_rpm is near zero [-FLT_EPSILON ; FLT_EPSILON]
if (last_speed_pid_set_rpm_sign > 0)
output = 0.001;
else if (last_speed_pid_set_rpm_sign < 0)
output = -0.001;
}
else
{
//current rpm is enough low, we can set output at 0
output = 0.0; motor->m_speed_i_term = 0.0;
}
}
}
else
#endif //PID_FOC_TRUE_NO_BRAKE
utils_truncate_number_abs(&output, 1.0);