Driving a motor
-
High timer experts,:omg: I have a problem very similar to the "Help clock generate" thread. I want to control a stepper motor of an electrophoresis unit. The Motor should be driven with (only) 250 hz. The low precicion timers using the message que (windows.froms.timers) are not usefull for this purpose (Instantly I wandered why the motor does not perform all steps with the timer set to 50 Hz, but meassuring the intervals using the system performancecounter revealed, that about every 10th interval is only 203 ticks long -- for what ever reason) Looking for a solution, I came accross -Queue timers- which should be able to deal with this problem. Unfortunately, I am not familiar with C programming language and all the examples were written in C (e.g. here). Is there a possibility to run such a timer from VB.net? Thanks in advance Armin
-
High timer experts,:omg: I have a problem very similar to the "Help clock generate" thread. I want to control a stepper motor of an electrophoresis unit. The Motor should be driven with (only) 250 hz. The low precicion timers using the message que (windows.froms.timers) are not usefull for this purpose (Instantly I wandered why the motor does not perform all steps with the timer set to 50 Hz, but meassuring the intervals using the system performancecounter revealed, that about every 10th interval is only 203 ticks long -- for what ever reason) Looking for a solution, I came accross -Queue timers- which should be able to deal with this problem. Unfortunately, I am not familiar with C programming language and all the examples were written in C (e.g. here). Is there a possibility to run such a timer from VB.net? Thanks in advance Armin
If my math is right, at 250Hz, you need to fire the event every 4 milliseconds. The timers that your finding all have 1 millisecond resolution. At that low an interval, the millisecond timers are not really that accurate. They can be off by as much as a millisecond when your app receives the notification. I think that part of the problem is the priority that your process is running under. You might want to consider running your app and then, before you start the timer test, go into the Task Manager, click on the Processes tab, right-click on your app and bump the priority up to High or RealTime to see if the interval stabilizes for you. RageInTheMachine9532