So I have been working a lot with both PID and TBH programming controllers for my flywheel design. However, there is one problem that I just can’t fix. Every time we shoot a ball, the power of the flywheels keeps getting greater and greater until it overshoots it’s target and has to drop its powers again. The reason why this occurs in my code is because, in a PID controller, when the ball is shot, speed is below target value so power goes up. When the speed reaches target value, another ball is shot which then causes speed to go back down and power to continue going up until the power gets way out of hand. The same thing occurs in a TBH controller except with the TBH variable escalating as well as the flywheel power. I have tried limiting this build-up by resetting the TBH/ flywheel power (depending on which program you use) to a default value every time a ball is shot. The trouble with this method is that the default value is not consistent with all battery powers. How do other teams avoid this problem in either PID or TBH? Any suggestions?
My team is having this problem exactly, and sadly i do not have any suggestions… We are in the same boat, and i cannot seem to figure out a solution. I have tried both PID and TBH also, so im looking forward to some community imput here
EDIT: I found them, I was just looking for the menu before I actually checked the PID box. Is this really as simple as it appears then? All the PID is programed for me? I just need to tune?
If your referring to RobotC’s inbuilt PID, there is an active thread at the moment about whether this could be used. Normally it is used to solve the issue of going straight when driving forward in natural language, but it might be able to be used as a velocity controller.
So in your code are you only waiting until the speed gets close enough to your target before firing another ball? What you might need to do is try waiting longer for your speed to settle before firing. So maybe start a timer when the speed is close enough to your target speed, and then once the speed has settled (been “close enough” for, say, a second), fire. This will obviously decrease your fire rate, which is a problem, but it’s something you could play around with. I don’t know if this is a good solution, just a suggestion.