Open topic with navigation
What can you do if your GPL program is running too slowly?
Most people find that the Guidance Controllers provide a great deal more computational power than their application requires. However, if you do find that your GPL programs are executing more slowly than you desire, the following are some of the more common causes and the corrective actions.
- Some user threads may be consuming time in busy loops.
If your application executes multiple threads, it is very important that each thread relinquishes control of the processor whenever it has completed execution or is waiting for the completion of an operation. The following are some suggestions:
- Try to use SendEvent and WaitEvent methods to coordinate the execution of multiple threads instead of Sleep loops with explicit tests. When a thread is stopped due to a WaitEvent, the thread consumes no execution time until the event is signaled.
- If you must poll, execute a Thread.Sleep between each test and ensure that you make the sleep duration as long as possible.
- Servo processing may be consuming too much of the available CPU time.
Servo processes consume a rather fixed amount of execution time even if an axis is not moving. If you are running many local servos (especially in 6-axis controllers such as the Guidance G2600C) or if you have many networked servos, a significant amount of available CPU can be consumed on the master controller. To reduce this load, try any of the following:
- Increase the "Trajectory Generator update period in sec" (DataID 600) to 0.004 or longer. This is especially important on Servo Network systems.
- Increase the "Servo update period in sec" (DataID 603) from the default of 0.000125 to 0.000250.
- Increase the "Position loop update rate, second" (DataID 10021) from 0.0005 to 0.001.
End of statement