Disable motor control max ramp rate

master
Tom Wilson 4 years ago
parent 84402a1614
commit 7143f1a5a8

@ -69,11 +69,11 @@ static void motor_control_task(void *pvParameters) {
(m_param.kd * d_error) + m_param.op_offset; (m_param.kd * d_error) + m_param.op_offset;
// Clip duty correction to the maximum allowed ramp // Clip duty correction to the maximum allowed ramp
if ((m_status[m_id].duty - old_motor_duty) > (MAX_DUTY_RAMP * MC_ITERATION_TIME)) { //if ((m_status[m_id].duty - old_motor_duty) > (MAX_DUTY_RAMP * MC_ITERATION_TIME)) {
m_status[m_id].duty = old_motor_duty + (MAX_DUTY_RAMP * MC_ITERATION_TIME); // m_status[m_id].duty = old_motor_duty + (MAX_DUTY_RAMP * MC_ITERATION_TIME);
} else if ((m_status[m_id].duty - old_motor_duty) < (MAX_DUTY_RAMP * MC_ITERATION_TIME)) { //} else if ((m_status[m_id].duty - old_motor_duty) < (MAX_DUTY_RAMP * MC_ITERATION_TIME)) {
m_status[m_id].duty = old_motor_duty - (MAX_DUTY_RAMP * MC_ITERATION_TIME); // m_status[m_id].duty = old_motor_duty - (MAX_DUTY_RAMP * MC_ITERATION_TIME);
} //}
// Clip motor duty output if it's saturated // Clip motor duty output if it's saturated
// Only add to the integrated error accumulator if we're not saturated (anti-windup), or the change // Only add to the integrated error accumulator if we're not saturated (anti-windup), or the change

Loading…
Cancel
Save