cRIO low execution rate

My programmers have asked me to post the following question, since they don’t have their own CD account:

Right now as we run the cRIO we have 3 diffrent tasks one for Autonomous one for Teleop and one for the camera information, the camera information is put on to global variable so that the other 2 tasks can read the information. We noticed while running the cRIO that the input between the joysticks and the movement was laging some, so we found out the Hz that the cRIO was running at was around 13 per sec. We fixed up and cleaned up the code so that we only had the three tasks mentioned above and we increased the Hz to around 130. However when we run our turret and move and attemt to track the target we fall back down to around 30. when we delete the camera task from running the cRIO speed is still at around 300-500Hz. We are at a loss on what to do, testing on blank code it runs at 150KHz. And then with that blank code we put our camera task and camera stuff in, then it still ran at 55KHz. We cannot figure out what is causing these masive slowing in our code.

Maybe I don’t understand the results being posted, but ideally the rates of each task would be limited to a known rate rather than running all out.

As an example, since motors updates for victors have a 10ms window, it really doesn’t make sense to update them faster, I believe servos are 20ms, and jags are 5ms. The camera task can be limited to whatever you want, but doesn’t need to be less than 33ms per frame.

If you do this for even some of the tasks, it seems like the variability will go way down. Having three tasks all expecting to run as fast as possible just seems to be asking the magic eight ball of OS scheduling for way too much.

Greg McKaskle