Frc Motor Tutorial

Páginas: 7 (1646 palabras) Publicado: 23 de febrero de 2013
Basic Motor Control
Contents
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8

Introduction
Getting Started
Configuring the Network Connection
Connecting the FRC Hardware
Creating the LabVIEW Project
Programming Motor Control in LabVIEW
Adding a Joystick
Conclusion

Introduction
This tutorial demonstrates how to get the cRIO-FRC up and running a motor. It walks through the
hardware setup and the programmingnecessary to control a motor with a joystick, as well as covering
basics such as setting up the FRC Control System, necessary network configuration, and setting up an
FRC Robot Project.
Getting Started
If you haven’t already, go ahead and install the software that came in your kit. This will install a FRC
specific version of LabVIEW along with the WPI Robotics Library. You will also need to have yourcRIO
imaged and your Driver Station firmware up to date. You can refer to the Training Material and
Resources page and the LabVIEW Robotics Programming Guide for the FIRST Robotics Competition for
information and instruction.
The following is a list of the hardware we are going to be using in this tutorial:












FRC2 cRIO and the three included modules
Driver Station/NetbookMotor
Jaguar motor controller
Digital Side Car
12 V battery
SH37 68 pin cable
R/C cable
Two Ethernet Cables
14 gauge wire
Optional: USB Joystick

Configuring the Network Connection
Connect the cRIO to the driver station using an Ethernet cable. This could also be done with a wireless
router without changing any code so that the robot is un-tethered.

Power the driver station and configure it usingyour team number (See the FRC Driver Station Tutorial).
This will set up the IP address of the driver station and the computer.

Connecting the Hardware
Remember to keep the modules in the same slots as they were shipped in or the modules will not work
properly. Connect the Digital Side Car to the NI 9403 digital input output module in slot 2 using the
SH37 cable.

The Digital Side Car is a breakoutboard that provides several signal interfaces, one of which is pulse
width modulation (PWM). This application requires one PWM channel to send commands to our motor.
When connecting the Jaguar motor controller, the controller first needs to be connected to PWM
Channel 1 on the Digital Side Car using an R/C cable. Make sure that the black wire goes to ground (-),
the red wire goes to power (PWR)and the white wire goes to signal (SIG).

Next connect the motor to the M+/M- terminals on the Jaguar controller. Red is positive and black is
negative. Now connect the Jaguar motor controller’s V+/V- terminals to the 12 volt battery through the
power distribution board. The controller fan should also be connected to the V+/V- terminals to prevent
overheating. Before continuing make sure the fanis on and that the motor is secured so that it does
not move while running.
Finally, power the Digital Side Car by connecting it to the 12V battery through the power distribution
board.
Creating the LabVIEW Project
Now that the hardware is configured the next step is to write a software VI to control the motor. Open
up LabVIEW FRC and create a new FRC cRIO Robot Project. Name the project, set thesave path, and
enter the cRIO-FRC’s IP address (10.0.0.2), then click Finish.

In the project window, right-click on RT
CompactRIO Target (10.0.0.2) and select
New»VI.

Save the new VI as Simple Motor Control.
Notice that LabVIEW places the new VI inside
the cRIO target tree, which means the VI will
run on the cRIO.

Programming Motor Control in LabVIEW
Double-click the Simple Motor Control VI toopen it. Next, go to the block diagram by selecting
Window»Show Block Diagram. Now we will begin the actual coding required to get the motor moving.
First create a while loop by right-clicking anywhere in the white space on the block diagram and
selecting Programming»Structures»While Loop. Click, drag, and release on the block diagram to specify
the size of the while loop. The while loop allows...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Tutorial interactivo del motor brushless
  • fiel y FRC
  • Tutoriales
  • tutorial
  • Tutorial
  • Tutorial
  • Tutoriales
  • Tutorial

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS