As many of you know, our robot runs on brecoflex belts. We have always been fine in the past, but this year we are experiencing some problems with stretching the steel fibers that hold the belts together. We have broken 2 belts already, and at $150 a pop, are trying to do everything possible to not break any more.
We have watched videos of the belts breaking and have traced the problem back to accelerating to full speed from a stop. We are running an open loop control system, so if the driver mashes the joystick to its maximum, the motor is going to go from a dead stop to full voltage in a very short amount of time. When this happens, we believe an excess amount of torque is being applied to the belt, and causing it to break.
We have also decided the easiest way to save our belts (and our battery too!) is to have our motor’s PWM output ramp up and down when joystick input values are changing rapidly. So far, I have thought of 2 plausible ideas on how to solve this problem, and would like to see which one would work better, or if other teams have solved the problem in a different way.
Choice 1: Velocity based PI Control
Intuition tells me I can accomplish what I want by setting the proportional gain very small and setting the integral gain somewhat high. As the error between the input (joystick) and output (wheel speed) changes, the low p term will cause the output signal to change slowly. As time elapses, the Integral stage will pick up on the accumulated error due to the low P gain, and increase the output signal exponentially. I tried simulating in LabVIEW, but I didn’t get the results I expected. Can someone tell me why?
Here is an image explaining what I want compared to what LabVIEW spit back at me.
Choice 2: Write a custom function
I would need to look at the difference in input values across program loops (delta input). If this value is small, leave motor outputs directly mapped to that input. If the change in input values over time is higher than a pre defined limit, keep the old output value and add or subtract a certain amount of values until the wanted output speed is achieved. It may look something like this…
static int capture_value, output, mode, oldInput;
//rate of change in joystick values.
delta = input - oldInput;
//is joystick being moved too fast?
if(delta >= DELTA_LIMIT) {
mode=RAMPING_UP;
capture_value = input;
}else if(delta <= -DELTA_LIMIT) {
mode=RAMPING_DOWN;
capture_value = input;
}
//output integration
switch(mode){
case RAMPING_UP:
output+= RAMP_UP_CONSTANT;
if(output >= capture_value) { mode = NORMAL; }
break;
case RAMPING_DOWN:
output-= RAMP_DOWN_CONSTANT;
if(output <= capture_value) { mode = NORMAL; }
break;
case NORMAL:
output = input;
break;
case default: break;
}
Motor = output;
//Keep values for next loop
oldInput = input;
What do you think? Which one of these solutions is better fit for my cause? Do you have something that will work better, or that you have used in the past?