FIRST Robotics Competition Discussions

Showing results for 
Search instead for 
Did you mean: 
Reply

LabVIEW Adding a Motor Control for Joystick Trigger

Solved!
Go to Solution
Highlighted

LabVIEW Adding a Motor Control for Joystick Trigger

I am an adult coach helping our rookie High School team with our First Robotics Competition robot. We are using LabVIEW to control the left wheels with the left joystick y-axis, and the right wheels with the right joystick y-axis. We would like to add a third motor control using the right joystick for the rope climber, but I am unsure how to do this in LabVIEW. I assume it would send a PWM signal through the third slot on the roboRIO (PWM 2). Are there tutorials or example code I can view to learn how this?

0 Kudos
Message 1 of 5 (301 Views)
Reply
0 Kudos

Re: LabVIEW Adding a Motor Control for Joystick Trigger

Just to make sure I understand what you area asking,

You guys have the two wheal motors working but want a third motor to climb with. but you don't know how to configure the third motor?

 

Take a look at this example:

From anywhere in LabVIEW Click Help -> Find Examples...

Navigate to the FRC Robotics / RoboRIO / Robot and Motor

double click Motor Control.lvproj

Expand the roboRIO and double click Motor Control.vi

Here is a screen shot of it with some added notes:

motor example.png

To make it work with a Joystick, pull one of the axis and wire it to the same place as the "Speed (-1 to 1)" control. (You can look at the joystick Input.lvproj under the Joystick folder for an example on how to read the axis)

 

Let me know if this helps.

Ryan

 

 

Message 2 of 5 (278 Views)

Re: LabVIEW Adding a Motor Control for Joystick Trigger

Thank you for your helpful reply. I was able to open Motor Control.vi and Joystick Input and wire the axis to Speed. However, I don't understand your notes to 'PUT THIS IN' different vi. How do I put those subVI into the correct Begin.vi, Teleop.vi, and Finish.vi?

0 Kudos
Message 3 of 5 (242 Views)
Reply
0 Kudos
Solution
Accepted by topic author MetalEagles
‎03-13-2017 01:21 PM

Re: LabVIEW Adding a Motor Control for Joystick Trigger

Your Begin.vi , Teleop vi and Finish vi should look something similar to mine

This is my Teleop vi.

teleop.PNGfinish.PNGAbove this line is my Finish vi.

___________________________________________________________________

This is my Begin vi.

 

teleop.PNG

Message 4 of 5 (239 Views)

Re: LabVIEW Adding a Motor Control for Joystick Trigger

Thank you for that second post! The robot is working perfectly now, couldn't have done it without you!

0 Kudos
Message 5 of 5 (231 Views)
Reply
0 Kudos