Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DC motor control via ctr1/ctr0 pwm output stops outputting after one loop through.

Working on this project to control an H-bridge controlled motor using pwm output from ctr0/ctr1 for ccw and cw on the motor. A sensor detects where it is at and each cycle goes from black to white. For some reason, the motor only turns on once and then nothing comes out of the ctr outputs after that. Anytime the program is stopped and restarted it works for one cycle. Or if just the program is run at the skipcolor sub-vi. this can be run multiple time to control it properly. During the actual run it doesn't work. Any implementation device would be great. I am using the PCI-MIO-16E controller.

Programs attached for reference.
Download All
0 Kudos
Message 1 of 2
(3,423 Views)
Hey suspencefull,

You are probably going to have to think about re-designing your code. Your pulse train is not continually generating because you do not have it in a loop. When you use the DAQ Assistant to create a continuous pulse train, LabVIEW will prompt you if you want it to automatically add the loop. You must have deleted it or chosen not to add the loop.

There will, however, be problems though when you add the loop back in. The SkipColor sub VI will not finishing executing until the loop is finished and therefore you will never move out of the first frame of your sequence. I would suggest redesigning your code so that these thing can occur in parallel.

Please let me know if you have further questions.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 2 of 2
(3,410 Views)