1
General Mach Discussion / Re: coordinate accuracy in position and time
« on: January 18, 2012, 12:31:58 PM »
In my experience, when using the Mach Parallel Port driver, you can not capture position information any faster than about 12Hz (don't recall the exact number). Mach is operating much faster than that, but AFAIK for motion it queues up move/trajectory commands in the PP driver and then checks it that ~12Hz rate, at which time the DROs are updated. The only way to get Mach's position is to read the DROs, so that's the limiting factor. When writing plugins you can give trajectory commands to the engine faster, but you can't read the trajectory data out of the engine.
In my project where I needed to sync graphics to the position I worked on this for a very long time and finally gave up on getting faster data. What I did is oversample Mach's DROs (say 50Hz) then I could reasonably calculate the exact update interval that Mach was using, then I used interpolation to calculate where the machine PROBABLY was in between DRO updates. This gave me a decently smooth graphical system @ 24Hz. It has the occasional jump when the interpolation is wrong, but generally is good. Interpolation is making up data, so it won't be perfect. It is fairly CPU intensive to poll Mach at a high rate through the Mach4 Scripter interface, so that is a consideration, too.
If anyone has a solution I'd love to hear it, too!
In my project where I needed to sync graphics to the position I worked on this for a very long time and finally gave up on getting faster data. What I did is oversample Mach's DROs (say 50Hz) then I could reasonably calculate the exact update interval that Mach was using, then I used interpolation to calculate where the machine PROBABLY was in between DRO updates. This gave me a decently smooth graphical system @ 24Hz. It has the occasional jump when the interpolation is wrong, but generally is good. Interpolation is making up data, so it won't be perfect. It is fairly CPU intensive to poll Mach at a high rate through the Mach4 Scripter interface, so that is a consideration, too.
If anyone has a solution I'd love to hear it, too!