07-28-2015 07:03 PM
My intent is to gain hardware interfacing and general Labview experience. I am using a myRIO to control a Pittman 8222 34V Brushed DC motor (Motor Specs).
I recently created a code to control the angle of this motor using PID, which was visually implemented using the black disc with a white tick mark on it (see attached picture: "IMG_2523").
I now want to control the speed of this motor againg using PID, but I am not sure how to properly convert the encoder counts to RPM of this motor. I have attached 2 screen shots of my block diagram and my front panel for reference ("Capture" and "Capture2"). In the front panel picture, you can see my "actual" speed of the motor is a very choppy signal when it should theoretically be a flat line. To get the RPM, I currently use a shift register to store the current count value (which I converted to deg, then to radians), and then subtract the previous run's value, then divide by the while loop sampling time (10 ms). This would give me rad/s, which I then wrote a subVI to convert it to rpm.
Any help would be greatly appreciated, thanks.
07-29-2015 04:44 PM
Hello aaarmst2,
Are you using the NI LabVIEW PID and Fuzzy Logic Toolkit for windows?
If so, the issue you are experiencing is related on why your PID is not controlling in a good way the motor's speed??
Regards,
07-29-2015 05:05 PM
Hello, yes. I am using the NI Labview PID block. I am not using Fuzzy Logic Toolkit (to my knowledge).
My issue is that I am not calculating the motor speed properly. When I manually rotate the disc, my code is outputting insanely high rpm values that are not accurate.
07-30-2015 02:44 PM
Hi,
One thing you could try doing is verifying that the conversion from rad/s to rpm is working correctly.
This tutorial might also be helpful. It's not using the same hardware that you are, but goes through the general steps using PID control.
CompactRIO Motor Control Basics Tutorial: http://www.ni.com/pdf/labview/us/compactrio_motor_control_basics.pdf