asebosage.blogg.se

First robotics labview programming tutorial
First robotics labview programming tutorial









  1. #FIRST ROBOTICS LABVIEW PROGRAMMING TUTORIAL HOW TO#
  2. #FIRST ROBOTICS LABVIEW PROGRAMMING TUTORIAL DRIVER#

All of the objects placed on the front panel will appear on the back panel as terminals. The back panel, which is a block diagram, contains the graphical source code. Indicators are outputs: they indicate, or display, the results based on the inputs given to the VI. Controls are inputs: they allow a user to supply information to the VI. The front panel is built using controls and indicators. The last is used to represent the VI in the block diagrams of other, calling VIs. Each VI has three components: a block diagram, a front panel, and a connector panel. LabVIEW programs-subroutines are termed virtual instruments (VIs). LabVIEW integrates the creation of user interfaces (termed front panels) into the development cycle. Multi-processing and multi-threading hardware is exploited automatically by the built-in scheduler, which multiplexes multiple OS threads over the nodes ready for execution. Since this might be the case for multiple nodes simultaneously, G can execute inherently in parallel. These wires propagate variables and any node can execute as soon as all its input data become available. Execution is determined by the structure of a graphical block diagram (the LabVIEW-source code) on which the programmer connects different function-nodes by drawing wires. The programming language used in LabVIEW, named G, is a dataflow programming language.

first robotics labview programming tutorial

5.4 Parallel execution and race conditions.The second thing to confirm in this VI is that the “Open 2 Motor.vi” has the correct motor controller selected (Talon, Jaguar, Victor, etc.). The first thing to confirm in this VI is that your left and right motors are connected to the same PWM lines in LabVIEW as they are on your PDP (Power Distribution Panel). Next you will want to go back to your “Robot Main.vi” and double click on the “Begin.vi.” You can see the adjustments in LabVIEW in the following image:

first robotics labview programming tutorial

In my setup, I’ve selected index 1 for my left motors Y-axis control and index 5 as the right motors Y-axis control. If you select the X-axis index for each, then you will have to move the joystick left or right (x-axis directions) to get the robot motors to move. This is because it is intuitive to push up on the joystick when you want the motors to go forward, and down when you when them to go in reverse. You will likely want to use the Y-axis index for each joystick. Move the two joysticks to determine which number (index) they are tied to.

#FIRST ROBOTICS LABVIEW PROGRAMMING TUTORIAL DRIVER#

You can determine what the values of each index should be by looking at the USB Devices tab in the FRC Driver Station. You will need to create two numeric constants and wire each into one of the index inputs. This can be found by right clicking on the block diagram > WPI Robotics Library > Robot Drive > and clicking the Tank Drive VI.įind the Index Array function that is after the Get Values.vi. Replace Arcade Drive with the tank drive.vi. It should look like the following image:ĭouble click the “Teleop” vi inside of the Teleop Enabled case structure. In the Project Explorer window, open up the Robot Main.vi.

#FIRST ROBOTICS LABVIEW PROGRAMMING TUTORIAL HOW TO#

You can select another option, however, this tutorial will discuss how to setup tank drive for this project. Give your project a name, add your team number, and select Arcade Drive Robot roboRIO. Open LabVIEW and double click FRC roboRIO Project. The steps below will discuss these ideas in more detail: Lastly, make sure your motor controllers match the motor controllers specified in LabVIEW. Next, you will want to confirm the PWM lines that you are wired into, are the same ones your joysticks will be controlling.

first robotics labview programming tutorial

For example, if you want to make your robot turn right by pushing up on the left joystick and down on the right joystick you will need to set your joystick’s accordingly in LabVIEW (this is shown in more detail below). In tank drive, the left joystick is used to control the left motors and the right joystick is used to control the right motors. The second item to consider is how you want your joysticks to map to the direction you want to drive. The first thing you will want to do is make sure the tank drive.vi is used instead of the arcade drive.vi or whichever drive VI you were utilizing previously. Solution: There are four components to consider when setting up tank drive for your robot. Question: How do I get my robot to drive with two joysticks using tank drive?











First robotics labview programming tutorial