We need to program an extra Jaguar to run the motor for our manipulator using LabVIEW. Are there any .VI’s that are good to use/edit for this? Are there any tutorials? If you have a solution please reply.
Thank you.
-Team 3556
We need to program an extra Jaguar to run the motor for our manipulator using LabVIEW. Are there any .VI’s that are good to use/edit for this? Are there any tutorials? If you have a solution please reply.
Thank you.
-Team 3556
Isn’t “simple motor control” one of the provided examples? I don’t have LabVIEW for FRC handy, so I can’t walk you through it, sorry.
Hmm, I’ll try that and let you know.
I can confirm this. In fact there are multiple of ways that you can control a Jag with. You can either use the Drive Motors VI or the Motor Set Output VI. The latter would be the most useful to your purpose if I understand it correctly - that is you just want to control only one Jag. These are located in the RobotDrive sub tools panel in the Advanced section. Just follow the context help and it should set you straight.
we copy+pasted all the drive motor code and set it up where it would control the manipulator motor as the left drive motor.
We’re basically just trying to control 1 motor with 1 jaguar and 1 joystick, using only the X-axis. Both axes are alright if we need to use them.
We’re still stuck, any help at all will be appreciated!
Look at the Motor Control Example in LabVIEW. Things to the left of the loop correspond to the Begin of a robot project. Things inside the loop correspond to Teleop. Things to the right of the loop correspond to Finish.
Put a Motor Open vi in Begin and wire constants to its DIO Module and PWM Channel inputs to define which Digital Sidecar output you want to connect the motor controller to. Use the selector below it to tell it whether you’re using a Jaguar or a Victor. Wire the resulting MotorControlDeviceRef output to a Motor Refnum Set and give it a name that represents what it does.
In Teleop, put a Motor Refnum Get with that same name and wire its output to a Motor Set Output vi. The Output input (yeah, weird name, but whatever) should be wired to whatever you want to use to control the speed of that motor.
In Finish, put another Motor Refnum Get and a Motor Close. You’ll see where to place them by looking at everything else in Finish.
Does that help?
Thanks for all your help, we’ve got it working now.