Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements

Search our FPGA Knowledge Articles here.
19208 Discussions

## how to generate Variable frequancy pwm

Honored Contributor II
894 Views

Hi,

I am trying to write Verilog code to generate pwm signal for step motor controler;

The pwm signal frequancy should range from 1Hz to 1MHz,and the frequancy stepper need to be 1Hz.

Thank you.
5 Replies
Honored Contributor II
110 Views

Although this can be surely done in FPGA, it's not clear what you want to achieve. Are you actually talking about pwm used with stepper motor, e.g for constant phase current? But why should it use variable frequency?

Why step frequency fixed to 1 Hz?
Honored Contributor II
110 Views

--- Quote Start ---

Although this can be surely done in FPGA, it's not clear what you want to achieve. Are you actually talking about pwm used with stepper motor, e.g for constant phase current? But why should it use variable frequency?

Why step frequency fixed to 1 Hz?

--- Quote End ---

I have a step motor and a step motor controler,when the FPGA or MCU give a plus to the step motor controler,the step motor will rotate a small angle.

so,I want to genrate plus to make the step motor controler work.The %50 Duty cycle pwm is suit for this.

why step frequancy need variable frequency:

if FPGA give one plus to the step motor controler in one second,the step motor will rotate one small angle,FPGA give two plus to the step motor controler in one second,the step motor will rotate two small angle in one second.......so on.

The pwm frequency is relation whit the step motor's rotation speed.

When the step motor work ,it's rotation speed should increase from zero to a high speed.That is to say,the pwm frequancy should increase from zero to high data.

So,I need variable frequency pwm.

And,Why step frequency fixed to 1Hz?

When the pwm frequency increase,the step motor's rotation speed will increase too.But,if want the step motor's speed increase smoothly ,the pwm frequency can not increase too fast.

So,I want the step frequency fixed to 1Hz.

Here is a blog about step motor's motion characteristic.

https://www.embedded.com/design/mcus-processors-and-socs/4006438/generate-stepper-motor-speed-profil...

Thanks again!
Honored Contributor II
110 Views

--- Quote Start ---

Although this can be surely done in FPGA, it's not clear what you want to achieve. Are you actually talking about pwm used with stepper motor, e.g for constant phase current? But why should it use variable frequency?

Why step frequency fixed to 1 Hz?

--- Quote End ---

Like this https://www.embedded.com/design/mcus-processors-and-socs/4006438/generate-stepper-motor-speed-profil...

I want to generate smoothly frequency to drive the step motor rotate.
Honored Contributor II
110 Views

Like this,the FPGA generate pwm to the stepper controler,and the stepper controler will make the stepper motor rotate,

the frequency of pwm more faster,the stepper motor rotate more faster.I want to the stepper motor run in variable speed,So,I need the variable frequency pwm.

But why the stepper frequency should fixed 1Hz?

https://alteraforum.com/forum/attachment.php?attachmentid=14953&stc=1

The increase of the pwm frequency means the stepper motor's rotation speed increase.someone call this acceleration.

The acceleration should be stable.And,if the stepper frequency more smaller,the noise will be lower when stepper motor increasing its speed.

Do I express clear about why I want to achieve?
Honored Contributor II
110 Views

FvM,