Home › Forums › TinyG › TinyG Support › What is maximum PWM frequency ($p1frq)?
Tagged: $p1frq p1frq PWM frequency
- This topic has 4 replies, 3 voices, and was last updated 6 years, 4 months ago by cmcgrath5035.
-
AuthorPosts
-
August 17, 2018 at 11:26 am #11083RichLMember
I would like to use the PWM output from a tinyG to control the speed of a stepper motor (as the STEP frequency). What is the maximum frequency that can be specified for $p1frq=? I haven’t been able to find this on the wiki pages…
RichL
August 18, 2018 at 11:31 pm #11084ZootalawsMemberI know you can go up to 50khz, but not whether that’s a limit.
Maybe there’s no limit, other than 8bits, but a point at which there is no effective effect?
It’s unusual to control a stepper using pwm… what’s your use case (speed, application, etc8?
Conventional wisdom says using pwm with a stepper removes the key feature of a stepper – stepping – and just makes it into a bipolar dc motor.
August 19, 2018 at 3:36 pm #11092cmcgrath5035ModeratorPerhaps I am reading this differently, Zootalaws.
@richl, are you wanting to connect the TinyG Spindle PWM output to the input of a Stepper Driver device as the step input?
The stepper driver device converts a step pulse (probably the rising edge) into properly phased drives for the two windings so that proper rotation is achieved and manages the max current in the windings.The number of pulses per full rotation is a function of the winding design of the motor.
The driver takes inputs to decide if microstepping is to be implemented, which changes the winding phases.You don’t really need tinyG for that…….
August 20, 2018 at 9:41 am #11099RichLMemberThanks Zootalaws for the response, that is very helpful.
cmcgrath5035: The only reason I’m considering using the PWM to drive the step input of a stepper driver is that I have one axis on our instrument that I want to control at a precise speed, and the A, B or C axes don’t really allow that. I already have motors connected to X, Y and Z. I could switch to a DC motor and use PWM to control it, but the speed would not be as accurate.
Thanks for your answers,
RichLAugust 20, 2018 at 1:02 pm #11101cmcgrath5035ModeratorHmmm, OK, understand
I suppose you could try it, either with an external stepper driver or by connecting the SpnPWM lead to the unused onboard motor driver. A typical stepper would rotate once every 200 pulses (with zero microstepping).
You’ll have to do some math to see if the speed you need is achievable.I am just curious – tinyG, being CNC oriented (jerk calcs, etc) does not seem to be the right fit for you application. Did you consider a more generic approach, such as a RasPi? There are stepper shields for those too.
Just wondering. -
AuthorPosts
- You must be logged in to reply to this topic.