Maximum frequency generated by square wave node. i want to drive stepper motor with driver. driver has puls/sign input.
I use the square wave generator to supply pulses to a stepper motor driver board.
For “T” I use 0.5
For Duty I use .0000015625.
You want the pulses going to the stepper motor driver board to be as short as possible.
If T Is 0.5 then frequency is 1 hz ? but i want frequency maximum 100khz.
Most likely, you have a lot more knowledge with stepper motors and driver boards than I do and what I am about to share might be useless.
My background is RF (radio frequency) so I always worked with frequency.
Understanding stepper motors required me to develop a different method of reasoning. Use pulses instead of frequency. Stepper motors move in discrete steps. Typically 1.8 degrees per step (in full step mode). One pulse applied to the driver board moves the rotor 1 step or 1.8 degrees.
To make one revolution, requires 200 steps. (200 steps x 1.8 degrees = 360 degrees of shaft movement). 200 pulses applied to the driver board ‘steps’ the motor one revolution.
Since stepper motors are typically used for slow precision movements, not speed, I’m not sure it would respond to 100,000 pulses (‘cycles or Hertz’), per second.
For experiments, I have a 24vdc power supply (12v will also work okay) connected to an inexpensive driver board and NEMA17 size stepper motor. All this mounted on a board (real wood board) along with Arduino.
The XOD is ‘Out’ of Square Wave node connected to ‘Sig’ of the digital output. This simple setup allows me to tinker with stepper motors.
Just make sure your square wave duty cycle is very, very low (short) and keep reducing ‘T’. The shorter the ‘T’ the faster the motor.
Thank you very much for your reply. I understand your point and it is good .
T value is how much shorter can be , this is my question.
Stepper motors have a so-called PPS characteristic. PPS stands for Pulses Per Second. Depending on the model it can be few hundreds or thousands. So, to rotate a stepper at its maximum you have to provide a (hardware) pulse train with a frequency of 100-1000 Hz in magnitude.
square-wave is a low-frequency oscillator which can provide such frequencies if no one disturbs it. It will omit steps in more complex programs. Accurate stepper control should either be synchronous (block the rest of the program) or employ hardware timer interrupts, which is not trivially achievable right now.
Finally, I would recommend to start with the
square-wave and see if its performance is enough for your project. If not, try to implement a synchronous rotation node. A comprehensive solution will be implemented in future versions of XOD.
I haven’t put a scope on the output…but…
There seems to be a ‘do not go below’ duty cycle limit to the square wave generator. In other words, if I have T at 10 and Duty at 1 everything is okay. But, if I keep T at 10 and change Duty to .1, the duty cycle seems to stay at 1.
Is this due to Arduino, or XOD or am I missing something?
I seem to be stuck here too. I am trying to get an A4988 + NEMA17 running, and the best I can achieve is a slow turn.
From everything I have experienced in XOD so far it seems it is missing the ability to use delayMicroseconds and delayMilliseconds type speeds.
Once I go below 0.01 things dont work.
Is there any news on this update?
If you’re looking for a way to drive a step/dir interface motor, see Stepper step/dir drive node