I tried to correct the name of this post as well as clarify, but I noticed it was removed from more than one place so I have just deleted and made a new post in hopes that I can make more sense this time otherwise I’m not going to bother with this theory I’ll just simulate what I’m thinking then post the simulation link here later. On to my thoughts:
PID uses a relative setpoint and uses a graph similar to sin(X) after reaching the setpoint + someOffset. After that the equation becomes +/- offset and appears similar to the graph of sin(X) where the height is equivalent to the offset + setpoint. Theoretically, there are no issues with this AT ALL. Upon seeing tests between teams and competition matches where teams have had issues with shooting into the high goal. Here’s the programming side:
Everything has a delay, hopefully in milliseconds, but that’s typically known as “latency” and happens to be the reason why gamers tend to use keyboard + mouse over an Xbox controller.
Latency baselines: Xbox 360 Controller: 66ms Xbox One Controller: 33ms RoboRIO: update period -> 20ms Network latency: <5ms (it varies) Driver Station software latency: depends on CPU, anything made after 2013 has at least a baseline of <15ms to capture the Xbox Controller and send it back via network tables to the roborio. Celeron/Pentium CPUs: <15ms, i3 (3rd gen or later) or AMD equivalent: <11ms, i5 (4th gen or later) or AMD equivalent: <10ms, i7 (4th gen or later) or AMD equivalent: <9ms.
Making all of this into a calculation, Xbox Controller + RoboRIO + network latency + DS (+ encoder latency, which we will say it manages to acquire the data instanuously) = overallLatency
In this case we’ll be measuring with an Xbox 360 controller: 66 + 20 + 5 + 15 = 106ms = 0.106 seconds.
On with the Xbox One Controller: 33 + 20 + 5 + 15 = 73ms = 0.073 seconds
Despite the Xbox One controller being noticeably faster (during calculation), the latency on the Xbox 360 Controller is roughly 212ms to receive as well as send a packet to/from the controller where the Xbox one controller is 146ms. Let’s look at this latency as part of the PID; start by giving a setpoint of 4600/6000 (rpm) = ~76.7% motor speed. Here’s what the PIDController looks like while attached to a motor: http://www.globalspec.com/ImageRepository/LearnMore/20127/Derivative%20Controlf33d02a7a8b14c83bea54ae58d67cc19.png
The next step in this process is to find out the length of time it takes for this given data. I don’t really have a lot of access to this type of information right this second, but I certainly can update the post when I figure out how to handle the data correctly in a simulation or I can get feedback from team(s).
Either way, the latency plus the speed of the motor are highly likely to cause issues while shooting unless you compensate on the roborio for that. Using a PID-based system where the shooter uses PID to control the mechanism that applies the most acceleration could cause issues with the speed of the ball being shot is actually under powered if designed ‘properly’.
For reference, I found his link from awhile ago to assist my point that PID never seems very consistent: http://www.chiefdelphi.com/forums/showthread.php?t=114366
While I’m certainly noting that it shouldn’t be “more word versus yours and therefore it weighs more”, teams should be aware of this consistency issue which was introduce back in 2013. Bang-bang is certainly an overly simplistic matter of a PID, but there also hasn’t been a lot of talk on the subject since. Consider this post a “let’s get to theorizing” thread. At the very least, we might help some teams who are falling behind right now due to missed shots or latency extensions.
CERTAINLY SHOULD BE NOTED: the PIDController and latency are two separate things ENTIRELY, but they are related depending on your control system setup. If anybody has a way to simulate the PID system.
TL;DR:
Objective: Determine if using a PIDController as a major source for velocity on your shooter is reliable.
Theory: Utilizing a PIDController as a major souce for velocity on a team’s shooter is fairly unreliable due to unpredictable inconsistencies within latency during the teleoperation period.