Control Loop Time

My control loop time is 500us. When I compile my code I get the following

Program Times: Loop Time Allocated: 210.0 usec, Loop Time Used: 152.6 usec ( 47.1 usec PreScan + 4 tasks x 26.4 usec ) Image Successfully Created (uses 2.5% of capacity)
How do the step programs work in this control loop time? If I have a program that has 5 steps and it goes from one step to the next without delays does it take 5 control loops (5 * 500us = 2.5s) to do this? If I have the same program running in 2 task will one slow the other down? Will it still take 2.5s for both task? Why is 500us the min time when you have extra speed?

A step take one scan time or 0.5 millisecond so to get through all 5 steps would take the 2.5 MILLISECONDS not seconds.

NO! Compiler assume that all tasks will be executing the slowest ( longest task ). If it passes the compile time then all tasks will execute at the same time in the time allotted. The trick right now is to minimize the time it takes to execute the longest step because the compiler assumes all task will be executing the longest step at the same time as the worst case. This is very conservative.

No! Both tasks wil execute in 2.5 MILLISECONDS not seconds. Each task will execute one step each 0.5 millisecond scan.

There are two reasons.

  1. We are being conservative with our timing.
  2. The MDT feed back only updates every 500us with a 50 inch rod. The MDT rod must be less than 25 inches in length to go faster. Do you really need 250us? Let us know.

Sorry I was thinking ms but typing s.

I understand. The problem I am having is not motion related. I am getting the peak reading on an analog input. This works fine upto a speed but they always want to go faster. I have the peak capture in one step with the link going back to itself (looping back) until I see the actual go less than a value. I wanted to make sure that I was not building in any delays in my program. My real problem is I don’t know the duration of the spike on the input. I need to get some trends to see how long it is so I can tell if I have enough speed.

No matter what you do they marketing guys always want more. :slight_smile: :frowning:
You are using pressure transducers aren’t you? Is the response of the pressure transducers fast enough where a faster scan time will help?
Load cells tend to respond faster than pressure transducers but they don’t last long in many industrial environments.

That will go as fast as our scan.

This really looks like a job for an oscilloscope connected to a very fast pressure transducer.