A question for a guru who has in depth knowledge of the HAL scheduling mechanism:
I'm developing a driver for a my servo motor controller. The interface is via a PC parallel port. Only one RT thread is used that processes the position feedback from the controller, and calculates the speed signal for the controller. The thread runs every 1 ms and does also contain the PID and motion controllers. I've written the HAL file so that all components are listed in order of the data flowing through. Expecting this to give the best results. Thus the thread starts with a call on the driver for feedback values and ends with another call setting the output. Due to some interference, the actual duration of the input and output calls varies a lot (e.g. +100us). If my assumptions are correct, this generates variation (jitter) on the exact moment that the motion controller gets called and this may be undesired behavior. Assumption 1. The components get processed on the RT thread in the order these are added to the thread (I think I read that somewhere and it seems logical). Assumption 2. The thread is scheduled with a fixed interval, so the first components starts with the least jitter regarding the thread frequency. Assumption 3. If one components has been processed, the processing of the next starts immediately and so on, until all components are done. If all these assumptions are correct, the moment that the motion controller gets called will thus vary, depending on variations in processing time of the individual components. As mentioned above, in my situation there is a huge variation in duration of the driver call and I'm wondering if this is either bad, very bad, or not bad at all (because it's somehow compensated for). Do I need to work on the driver, so that it uses a fixed period of time (probably increasing the CPU load), or is this not an issue? -- Bas ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
