I’ve only used Labview for about 7 months and I am still confused. Our team is trying to use a PID to control where the arm starts and stops. For example, only rotating 270 degrees. My problem is that I understand the mechanics of a PID and what it means. I’m just not sure how to even begin building it. I was told to connect a PID to a Motor but what else? How do I even define a program for an arm in the Begin.vi? Some help would be great!
Here’s an example of a motor position slaved to the position of a joystick.
You can replace the joystick with pre-defined values for preset positions.
You do need a sensor on the arm to feedback where it currently is.
:yikes: Thank you! This helped so much.
Any other suggestions? Helped but still confused, do I need to make two different programs for the shoulder and forearm. I want the shoulder to move 270 degrees and the forearm 180. How would I do this?
Have you considered doing a timed function? Motor will only run one way for a set amount of time and then stop. Then run the other way for a set time and stop.
I considered this before, but as your battery power decreases, the output you get from your motor also decreases. So even though the time is set, the distance traveled will not be the same. Also the resulting error adds up. I’d go with Mark’s idea.
You can do the two motor controls in the same way. Just copy and paste the code you have for one motor: so, have two PID controls, each wired to one of the motors and one of the sensors. The program will be the same, just different device reference and different setpoints.
Do you have an example of this for Labview? We are trying this with our window motor for our claw and I want to open (reverse) for .5 seconds when button 1 is pressed and when 4 is pressed, motor goes forward .5 seconds and stops but still hold the tube securely. Thanks in advance for your help.
I got it to work! Thanks, anyway.
Just looked here and saw your question and answer. lol. Yeah I do have an example I could’ve shared. Tried to program it myself last year, tried it in the pit at competition. Didn’t work. Programmer from another team did it for me. FIRST can be nice like that, all the GP in the air