Quote:
Originally Posted by Mike Copioli
Ok, so does that mean you can not call it in the fast loop? If this is the case, is there an advantage to using PWM's 13-16?
|
Yes, you could call it in the fast loop to control your Victors at a higher rate for applications like position control (which generally works better at rates greater than 38 Hz). You'll need to synchronize the updates to a timer or some sensor like a gyro.
I've already enumerated some other advantages above.
Quote:
Originally Posted by Mike Copioli
If the outputs can only be updated every 26.2 ms (38Hz) For example if I wanted to use 13 and 14 for camera servo control, to move 200 steps would take over 5 seconds if it moved in one step increments (200 * .0262s). I really would like to see the camera "snap" to a position. It seems that nasty little 26.2ms loop time keeps getting in the way.
|
Your searching algorithm needs tuning. The camera has a fairly wide field of view, so I think you could use a much larger step. I would step in 30 degree increments, wait a bit for the camera to send a t-packet (or two) and then either start tracking, or step another 30 degrees... If you're using my code, these are built-in parameters you can tweak.
For grins, I used digital servos (not FRC legal) with my code and after modifying tracking.c a bit, I can find a green light and start tracking in somewhere between one and two seconds, without the software having any a priori knowledge of where the light is located. I suspect nearly the same level of performance can be had with the HS322HD servos.
-Kevin