PID2 is exactly like the PID service except it support many (N) number of seperately running pid cacluations. All the methods are exactly the same as PID but on each a "key" is used in the first parameter to identify which pid cacluation is being utilized.
For example :
Tracking with x and y with a single PID2 service would be like this:
pid = Runtime.start("pid","PID2")
pid.setPID("x", 5.0, 5.0, 0.1)
pid.setPID("y", 15.0, 10.0, 0.1)pid.setTargetPoint("x", p.x)
pid.setTargetPoint("y", p.y)pid.compute("x")
newX = pid.getOutput("x")pid.compute("y")
newY = pid.getOutput("y")