|
Re: Custom PI Loop not working
I believe at least part of your problem is the else clause (lines 100-106) in your teleop code. When no buttons are pressed, it zeroes out your flywheels, overriding the values set based on the PI processing.
Why a PI loop? While I have heard of PIDs occasionally working out to have a zero or near-zero value for D based on mechanical friction, I don't see any advantage to having a special class for PI.
Also, while this does not appear to be related to your observed problem, your PI class is not structured in a regular object-oriented fashion. Normally, you would only have one copy of the code in your "loop" class, and it would not know anything about any of the individual motors. Then, the subsystem classes (e.g. shooter) would each create its own instance of the calculator using its appropriate values. Much cleaner and easier to maintain.
__________________
If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
|