FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Adding a Motor Control for Joystick Trigger

Solved!
Go to solution

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
(4,670 Views)

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
(4,647 Views)

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
(4,611 Views)
Solution
Accepted by topic author MetalEagles

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
(4,608 Views)

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
(4,600 Views)