Lab 3
Lab 3
Student Name:
Registration No:
Date of Experiment:
Affective Domain Rubric Based Assessment
Levels of Achievement
Unacceptable Just acceptable Basic Good Excellent Marks
(1) (2) (3) (4) (5)
I. Adherence to Safety
Procedures for completing task
II. Attitude and Goal Setting for
completing task
III. Individual & Group Engagement
for completing task
Introduction to TETRIX Prime Robotic Kit for NI my RIO and Lab View Software
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
Main IJP Road, Sector I-12, Islamabad
Telephone: 051-5476768/4576809, Fax: 051-5476769
Website: www.nutech.edu.pk
DEPARTMENT OF ELECTRICAL ENGINEERING
Objectives:
This builder’s guide has been developed to provide students with positive experiences in robotics engineering.
With the assistance of this guide, students will learn to use the TETRIX® PRIME parts to design and construct
three different robots. After using this guide, students should be able to use the TETRIX PRIME parts to construct a
robot of their own design.
Equipment/Components:
This guide includes:
Safety Information
Mechanical
• Keep fingers, hair, and loose articles of clothing clear of gears and moving parts.
• Never pick up the robot while it is moving, or the servo motors are running.
• Remove any burrs caused by cutting the metal beams.
Electrical
• Make sure the power is turned off when the robot is not in operation.
• Do not operate the robot in a wet environment.
• Always power down the robot before making any changes.
• Use caution when working with bare wires to avoid creating a short circuit situation.
• Route wires carefully and secure them if necessary to avoid damage to the wire or its insulation.
• Mount the battery pack and all electronic components securely.
Note:
For complete detail for set components, setup/Hookup Tips, set up control system hardware and software,
building instructions for rover vehicle assembly, balancing arm assembly and self-balancing robot assembly
follow the soft copy of PITSCO TETRIX PRIME Robot Builder’s Guide for NI myRIO.
Introduction to NI myRIO
NI myRIO is an embedded hardware device designed for students and based on technology usedin industry
for controls and robotics. It has all the I/O and processing power you need to control therobots you create using
this kit and more!
2. Refer to the motor board pinout below when you are connecting sensors and actuators tothe
board.
Software Setup
1. Install the software required to program myRIO. You can find this software on the disks provided
with myRIO as well as ni.com/downloads. Disk 1 includes the minimum software required to use
myRIO. Disk 2 includes additional software you can use to expand the func-tionality of myRIO.
The minimum software required to use myRIO is:
1. LabVIEW
2. LabVIEW Real-Time Module
3. LabVIEW myRIO Toolkit
Activate the software using your software serial number.
2. After connecting myRIO to power and to your PC using the included USB cable, the myRIOdevice
monitor will appear and will provide some options. For your first time connect-
ing myRIO to your computer, select “Launch the Getting Started Wizard.” This will lead you
through identifying myRIO, renaming myRIO,
installing software onto myRIO, and testing theonboard
devices.
3. At the end of the Getting Started Wizard, select
“Start my first project now” to be guided through
your first experience in LabVIEW using the locally
hosted web tutorial.
4. After completing the tutorials in the tab named “Your
First NI myRIO Program,” move on to the tutorial in
the tab “Configuring WiFi on the NI myRIO.” Scroll
down to the section named “Creat-ing a Wireless
Network.” Follow the instructions in this section to
use myRIO as an access point to
create wireless networks. Take note of the SSID youchose
and the IPv4 address myRIO was assigned.
You will need this information to wirelessly con-nect to
myRIO from your computer.
5. For more information about getting started with the
myRIO, visit ni.com/myrio/setup/getting-started.
6. Download software to test your system and control the robots described in this guide from
ni.com/tetrix-prime. This code will also be helpful to reference when building your own designs.
7. Install setup.exe. This will place the example code for testing your control system
Step 2: Connect the other end of the extension cables from Step 1 to each of the Digilent DC motorsincluded in the
kit.
Step 6: Set the Motor 1 PWM duty cycle to 0 and confirm Motor 1 stops and the Counter Value stopsincreasing.
Set the Motor 1 PWM duty cycle to -10 and confirm Motor 1 starts to spin in the opposite direction and Counter
Value starts to decrease.
Step 7: Set the Motor 1 PWM frequency to 6000 and take note of any changes in the motor. Set Motor1 PWM duty
cycle to 0 and click on the Reset Counter button two times to reset the encoder Counter Value back to 0.
Step 8: Set the Motor 2 PWM duty cycle to 10and
confirm it starts to spin. Ensure that it is spinning in
the same direction as Motor 1 wasspinning when its
PWM duty cycle value wasset to 10.
Step 9: Set the Motor 2 PWM duty cycle to 0 and
confirm Motor 2 stops spinning. Set the Motor 2
PWM duty cycle to -10 and confirm Motor 2 starts
to spin in the opposite direction.
Step 10: Set the Motor 2 PWM frequency to6000 and
take note of any changes in the motor. Set Motor 2
PWM duty cycle to 0 andthen stop the VI.
Note: You may continue adjusting the duty cycle and
frequency values to see their effects.
Servos
The servos provided offer the full package of a motor, gear box, potentiometer, and comparator circuitry to achieve
position control using PWM signals. The cabling comprises Power, Ground, and thePWM signal line.
Step 1: Testing the servo will be similar to testing the DC motors. We must first connect the servo to the
appropriate port. If the servo is not already connected, refer to the following figures on connectinga servo properly
to one of the available servo ports.
Step 2: (If not already completed from Step 3 of the DC Motors section) Connect the motor board to the myRIO and
plug in the DC connector to power it on. Ensure the myRIO ad hoc network appears onyour computer with the name
you specified from the Software Setup section.
Step 3: Open the “Control System Test Project,” connect the myRIO in the project, open the drop-downof the myRIO,
and navigate to “Testing Your System -> Main_SERVO.”
Step 4: Open and run the VI. Set the dial for Servo 0 to 0.9 and confirm the servo turns and stays at aset position.
Figure 10: Servo Testing VI
Step 5: Set the Servo 0 dial to 2.1 and confirm the servo moves to a new position.
Step 6: Stop the VI. Unplug the servo from Servo Port 0 and reconnect it to Servo Port 1 and thenrerun the VI.
Now, set the Servo 1 dial to 0.9 and confirm the servo moves to a specified position.
Step 7: Set the Servo 1 dial to 2.1 and confirm the servo moves to its new position.
Step 8: Stop the VI. Unplug the servo from Servo Port 1 and reconnect it to Servo Port 2 and thenrerun the VI.
Now, set the Servo 2 dial to 0.9 and confirm the servo moves to a specified position.
Step 9: Set the Servo 2 dial to 2.1 and confirm the servo moves to its new position. Stop and close theVI.
Gyroscope Sensor
The Digilent PModGYRO measures angular velocity and returns data using either the SPI or I2C protocol. The
sensor also includes an onboard temperature sensor. The PmodGYRO pinout includes achip select signal, power
ground, and the data lines for I2C and SPI.
Step 1: The Pitsco motor board includes a connector where the gyroscope sensor can directly connect. Reference the
following figures to properly connect the sensor to the motor board.
Step 2: (If not already completed from Step 2 of the Servos section) Connect the motor board to themyRIO and
plug in the DC connector to power it on. Ensure the myRIO ad hoc network appears on your computer with the
name you specified from the Software Setup section.
Step 3: Open the “Control System Test Project,” connect the myRIO in the project, open the drop-downof the myRIO,
and navigate to “Testing Your System -> Main_Gyro.”
Step 4: Open and run the VI. The data in the Angular Rate graph will show a spike when the sensor isin motion.
After the sensor stops moving, confirm the data goes back to 0.
Step 5: Confirm the Angular Displacement graph holds its value when the sensor stops and does notgo back to 0.
Move the sensor around on all three axes and confirm you see three different signals changing. Stop and close
the VI.
Figure 15: Connecting IR Sensor Cable Figure 16: IR Sensor Cable Connected
Step 2: (If not already completed from Step 3 of the Servos section) Connect the motor board to themyRIO and
plug in the DC connector to power it on. Ensure the myRIO ad hoc network appears on your computer with the
name you specified from the Software Setup section.
Step 3: Open the “Control System Test Project,” connect the myRIO in the project, open the drop-downof the myRIO,
Figure 20: Connecting Ambient Light Figure 21: Ambient Light Sensor Connectedto
Sensor to myRIO Motor Controller Board myRIO Motor Controller Board
Step 2: (If not already completed from Step 2 of the Servos section) Connect the motor board to themyRIO and
plug in the DC connector to power it on. Ensure the myRIO ad hoc network appears on your computer with the
name you specified from the “Software Setup section.”
Step 3: Open the “Control System Test Project”, connect the myRIO in the project, open the dropdownof the myRIO,
and navigate to “Testing Your System -> Main_Ambient Light Sensor.”
Step 4: Open and run the VI. Position the sensor to point toward a light source and confirm the data increases.
Completely cover the sensor and confirm the data decreases (possibly going to 0). Stop and close the VI.
Task-1:
To design and implement the ON/OFF control algorithm of a switch on Lab View using NImyRio.
Task-2:
To design and implement the control algorithm of LED Blinking on Lab View using NImyRio.
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
Main IJP Road, Sector I-12, Islamabad
Telephone: 051-5476768/4576809, Fax: 051-5476769
Website: www.nutech.edu.pk
DEPARTMENT OF ELECTRICAL ENGINEERING
Task-3:
To design and implement the speed control algorithm of dc motor on Lab View using NImyRio.
Task-4:
To design and implement the control algorithm of seven segment display on Lab View using NImyRio.