Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20680 Discussions

how to generate Variable frequancy pwm

Altera_Forum
Honored Contributor II
1,286 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. 

I do not kown how to deel whit it. please help me ....  

 

Thank you.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
502 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?
0 Kudos
Altera_Forum
Honored Contributor II
502 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 ---  

 

 

thanks for your reply. 

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-profiles-in-real-time 

 

Thanks again!
0 Kudos
Altera_Forum
Honored Contributor II
502 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 ---  

 

 

Thanks for your replying! 

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

 

I want to generate smoothly frequency to drive the step motor rotate.
0 Kudos
Altera_Forum
Honored Contributor II
502 Views

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

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?
0 Kudos
Altera_Forum
Honored Contributor II
502 Views

FvM, 

The quick reply can not include picture.So I reply sub.
0 Kudos
Reply