I was thinking about how to get the best of both worlds from TBH control and bang bang. I wrote down a couple of ideas to try out.
Then, I realized that the ratchet on the robot may be making the deceleration on our flywheel respond slower, which might have been the cause of the first ball to always overshoot.
Does a ratchet affect the effectiveness of velocity control?
And if I were to remove the ratchet, would I have to decelerate slowly or would it be fine to just put in a zero to stop the flywheel?
What is your gear ratio? Single flywheel or dual?
On my dual flywheel, I found that ratchets did have a bad effect on my PID loop. I don’t know how the TBH algorithm works, but any program that reads the velocity from an IME would be affected by the ratchet because when you fire, the motors stop spinning.
We have never used a ratchet, I don’t really see an advantage from them and it seems like they definitely would be a disadvantage as far as control goes. I would suggest removing them and trying it out.
I am guessing you can mod your PID loop and make fw either accelerate or decelerate by spinning at a constant lower power and let the ratchet do the deceleration job. Like, when the overall gain is smaller than a threshold, just apply a constant value to the motors.
IDK, maybe something to try. I knew this would come up when people were talking about ratchets – there’s a bad side to anything.
So a ratchet will definitely mess up TBH control loop. A properly tuned velocity PID loop on the other hand should not be effected by the ratchet but tuning it might be difficult. TBH relies on overshooting the target and slowing back down which the ratchet would delay, this delay would cause the flywheel to lose which natural speed maintains the goal velocity.
With a ratchet, the flywheel’s rotational velocity is not necessarily synced with the motors’. This is guaranteed to cause problems when using IMEs for it, but if you absolutely need a ratchet (you probably don’t), you can move the ratchet down in the system, closer to the motors, and put a big red encoder on any shaft past the ratchet (not the flywheel axle, that would probably break either the encoder or your motors because of friction). Also, the deceleration of the flywheel will be really weird. If the flywheel happens to overshoot the target velocity, the motors lose a significant amount of inertia due to the ratchet disengaging the motors, so they quickly return to the target velocity, but the flywheel doesn’t. Now the robot doesn’t know how fast the flywheel is spinning, and thinks it’s spinning at the correct velocity. I personally don’t see a need for a ratchet in a flywheel, unless you have a dual launcher with a passive transmission.
As far as stopping the flywheel without a ratchet, I would recommend just setting the target velocity to 0. However, you need to make sure you sign lock the motor power, so you don’t switch the direction on the motor. This achieves basically the same effect as shutting off the motors (that’s what you’re doing), except you don’t need to override your velocity control, so you can turn the flywheel on and off during a match without playing with tasks or functions or anything like that.
we use PID control loop and we have a ratchet. we have not had any problems, as to tabors comment that the PID might be harder to tune. it was a big pain to tune the loop but I cannot say if it is more difficult to tune than a wheel without a ratchet, because I’ve never tried to tune a ratchetless flywheel
This question is for all teams using ratchets. Did you guys have issues with motor or external gears breaking, or was there another reason for using a ratchet? I think they do have their uses, but my team hasn’t seen a need for one, and I was curious as to where our designs diverged.
Sorry for hijacking the thread, but I don’t think this question needs a new thread (yet).
yes, we had problems with sudden acceleration of the wheels breaking internal motor gears, both speeding up and slowing down. the ratchet helps with the slowing down part