04-15-2021 12:41 AM
Hello
I am going to use linx to program a stepper motor control VI. The stepper motor driver I use is A4988 and TB6600. The stepper's rotating speed depends on the frequency of pulse input to the driver, so I use a digital square wave generator in linx to attain this request.
But now the output frequency 60Hz(which is shown in an oscilloscope) is not identical with the frequency 1Hz I input in my VI. I do not have any idea about this problem.
Appreciate all of you helping me.
04-16-2021 01:43 AM
Hi Luca,
May i know if the duration(ms) and channel match with your input when you run your Vi?
04-19-2021 12:11 AM
Thanks for your reply~
As in the picture I put above, the channel is 7 and the duration is 1000ms. I tried to change the channel and frequency, but I cannot get the square as I expect.
04-19-2021 04:16 AM
Is there are need for you to update the frequency all the time?
Try to only set the frequency one time and see what happens
04-19-2021 07:34 AM
Thanks, dkfire
After I delete the while loop, the frequency is still about 60Hz as before. And there is a new problem. The duration I set is 40000ms, which means it might output a 40-second square wave. However, the square wave I get is more than 10 minutes. If the duration set 30000ms, the actual output time is about 1s(I record it by my smartphone's slow motion). The result is pretty inconsistent. I doubt the timer or clock in Arduino or Linx goes wrong. But I do not know how to check that.
Appreciate your help~
04-19-2021 09:48 PM
Hi Luca,
I helped to ask your question under Linx discussion forum, and I get a reply from a person and I think this might help you. You can go ahead and read through what's in the link
Linx+Arduino Wrong frequency output
Hope this helps
Fiona, NI