LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Software Feedback-based PWM Motor Control

Hi all, I'm trying to design a software based feedback controlled motor using the USB 6009 (which does not have hardware pwm capability).  I will be actively detecting the rotational speed of the motor and adjusting the software PWM in response, so the PWM does not have to be very acurate.  The user will input a desired RPM value - this value will be compared with the detected RPM and the software will adjust the PWM.  There doesn't need to be any PID control, just a linear stepping of PWM until the detected RPM of the motor is within a certain range of the desired RPM.

 

The output of the 6009 controls the motor digitally using an H-bridge and I will need to be able to reverse the rotation of the motor.  1 line on the digital output goes to 1 "side" of the H bridge and the other line goes to the other "side."  Only a single side should be active at a time and the other side should be kept at LOW.  I figure this should be easy to implement once I get the PWM-feedback figured out. 

 

I am currently hung up on a good method of how to implement PWM using manual software methods and construct the actual feedback mechanism.

 

Here is the VI I have so far (crude PWM using mod-n of the output loop iteration counter (which isn't a linear stepping)).

 

Thanks 

 

 

Message Edited by gastro54 on 04-14-2009 06:07 PM
0 Kudos
Message 1 of 3
(3,153 Views)
0 Kudos
Message 2 of 3
(3,152 Views)

I stumbled across this yesterday, it might be of assistance, I really did not look over the code though:

 

http://decibel.ni.com/content/docs/DOC-3731

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 3 of 3
(3,107 Views)