Jump to content
OMRON Forums

Storing lifetime distance traveled per axis?


jackvoxel8.com
 Share

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

If you poll the velocity in a background script PLC, PMAC will guarantee that the polling will not affect servo/phase/RTI performance. It literally only polls "in the background" (i.e. when the CPU has completed all performance-critical tasks and has time to do other things). This will not be quite as accurate as polling at a set frequency, but for the purposes of tracking lifetime distance traveled (we're talking big numbers probably), it should be OK. Make sense?
Link to comment
Share on other sites

Ok so here is some pseudocode to accomplish what I think you all are telling me:

 

oldTime = currentTime

currentTime = GetTime()

timeDelta = currentTime - oldTime

velocity = GetAxisVelocity()

distance = velocity * timeDelta

totalDistance += distance

 

I would then run that loop in a PLC as fast as possible and it should have no effect on performance? Let me know if I am missing something.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...