Continue to Site

# How to generate a certain number of pulses with a fixed frequency but with soft start and stop.

Status
Not open for further replies.

#### H2M

##### Junior Member level 3
Hi,
I want to generate a certain number of pulses with a fixed frequency, but I want to start from a low frequency and increase it linearly until I rich to the target frequency (soft starting). the same procedure must be done for soft stopping. I am working on a 4-axis motion controller to drive stepper motors very soft at stop and start. please help me and suggest a good solution.

#### betwixt

##### Super Moderator
Staff member
Easily done if the pulses are created in software.
All you need is two targets, the start speed (which could be zero) and the maximum speed. The software simply increases or decreases the pulse rate in steps at a fixed rate until the target is reached. Setting the low target starts the count down and setting maximum target starts the count up.

Brian.

#### KlausST

##### Super Moderator
Staff member
Hi,

Why that vague informations?
"Certain number" means what? Give a range.

"Fixed frequency" and "soft start" is contradicting. What is the maximum traget frequency? Is it some Hz or some GHz?

What is your hardware? Discrete transistors, logic ICs, microcontroller, PLD...? Since you are posting in the microcontroller section, I guess microcontroller, what type?

There is ready to buy stepper controller hardware. Software even free. Like for arduino.

Klaus

#### FvM

##### Super Moderator
Staff member
You may start with a simple mathematical description of the ramped motion in terms of start/stop frequency, acceleration/deceleration rate and maximum frequency. It can be directly translated to a step frequency calculation algorithm.

If you are coding with fixed start/stop frequency and acceleration, a precalculated sequence table of step intervals is probably the most simple implementation.

Is the N pulses include freq ramp pulses or is ramp separate from the issue
of bursting N pulses ?

Bursting waveforms easy in HW, this is sine burst but trivial to do with pulses, a single chip approach -

Here is an approach for folks not code writers, this generates pusle trains of varying width and inter
pulse delay, but could be modified to N pulse generation. Not quite as flexible as above example
but maybe could be modified.

Regards, Dana.

#### ZASto

Take a look in SpeedyStepper or FlexyStepper libraries for Arduino platform.
Everything what you need is there or source code for GRBL (CNC controller), also on Arduino platform.

BTW, there is a fork for GRBL capable of dtiving 5 axes runnung on Mega2560 and a fork for the same "firmware" running on STM32F103 - BluePill

Status
Not open for further replies.