VEXcode V5 Assignment 4 -
Programming the
V5 Kiwi-Drive
By: Mr. Gravitt
Omni
Wheels
• Have Traction
forward & back
directions, &
• simultaneously
have slip 90
degrees side to
side.
Helpful NOTE!!!
• Kiwi bot is made up of 3
identical sides.
• X-Drive is made up of 4
identical sides.
• So, make a kiwi drive.
Then make another
side, assemble the 4 to
make an X-Drive.
• Or vise versa!
• This will SAVE TIME!!!
Helpful NOTE!!!
• H-Drive is
significantly
different than Kiwi
&/or X-Drive, but
many of the parts
are the same.
• Therefore, doing it
next makes a lot of
sense.
The Kiwi Drive Program
• There are numerous ways/styles this
can be programmed.
• I/we are going to start with a simple
2-joystick tank drive & side to side
with 2-buttons.
• Going to set it up so that it can do
side to side &/or tank drives both
simultaneously.
Kiwi Drive
• Wheels always
slipping!
• Difficult to tell (in the
operators mind)
where the front and
rear of the robot is.
It always moves what
seems like sideways!
• Can be programmed
many ways!
Kiwi Drive – 4 Ways of Moving
1. Spin in place, does this really well!
2. Sideways
3. Forward/backward
4. Concerning around a wheel.
1 Kiwi Drive
st
Program
• Now of course this is
just one of numerous
ways of making this
program!
• This is one version.
2nd Kiwi Drive
Program
• This is another
version of the
program.
• This is the version we
are going to write in
these directions.
PROGRAMS!
IMPORTANT NOTES:
1. You can program a VEX robot
with more than 1 controller.
2. Use Autonomous programs &/or
Remote.
3. Use sensors &/or not.
4. You can program all the different
Joysticks &/or Buttons in many ways.
5. For most robots they can be programmed in so
many different ways that the numbers are just literally
astronomically large!
THEREFORE: I’m going to show you 1 way of programming your robot &
just using one joystick. However, just remember that there is a huge
number of ways that a robot can be programmed!!!
Devices • Controller
• 3 Motors, I
choose to
name them:
1. RFMotor
2. LFMotor
3. BackMotor
• You can name
them as you
like…
The Program
Goes
• Started with a
Sideways
At 120
“Forever Loop,” & a
Degrees “If () Then, Else If,
Else” statement to
Full Speed divide the program
Spin in
Place into 3 parts.
If NO 1. Sliding sideways in
Buttons
Pressed 120 degrees
works like
a2
intervals
Joystick 2
Motor
2. Spin in Place
Tank Drive
3. & a Tank Drive part
The VEXcode V5 Software
• Click on the VEXcode
V5 Software Icon
• This version of the
software is the same
on both MAC & PC.
• This version allows you to program using
Blocks &/or a Blocks/Text Hybrid.
Step 1.1 - Open VEXcode V5 Software
• Either click on the VEXcode V5 ICON on
your desktop or search for “VEX” in the
search bar at the bottom of your Windows
screen.
Step 1.2 - Open VEXcode V5 Software
• This is what the software looks like when
opened.
Step 1.3 - Open VEXcode V5 Software
• There are not any Motion Options? They
will appear once we place a motion item.
Step 2 – Lets Name the Program & Save It
• Click here, select where to save it (Server
&/or Flash Drive), name it, & save it.
Step 3.1 Open Devices
• Click on the Devices Icon located here.
Step 3.2 - Opened Devices
• This blue box opens, this is the devices
section..
Step 3.3 - Add a Device
• We need to tell
the software
what devices
(motors, sensors,
&/or controllers)
that we are
plugging into our
robot, what ports
we are plugging
them into, &
name them.
• Click Add a Device.
Step 3.5 - Select
Controller
• We are going to put
each Motor in
individually &
individually Name each
motor.
Step 3.6 – Click Done
• Just going to use 1
controller.
• We are going to
program the controls
manually in the
program code.
• Click Done – It will label
it “Controller1”
automatically.
Step 4.1 - Select Motors
• The Controller1 should be
there.
• Next step we are going to
put each Motor in
individually & we are
going to individually name
each motor.
• Click On - “Add a Device.”
Step 4.2 - Select Motor
• We are going to put each
Motor in individually &
individually Name each
motor.
• I’m going to put the
motors in Ports 1, 2, & 3.
• However, they can be
put in any port!
• Software asks us Step 4.3 - Select
which PORT we LFMotor
have the LEFT
FRONT Motor
plugged into?
• If you plugged it
into a different port
select that port
now.
• I’m Clicking On
PORT1.
• & Then Clicking
Done.
NOTES:
• The software asks
us what color
Gear Cartridge we
have in the
motor?
• You can see the color of cartridge the motor
has in it through this window.
• Red = 36:1 @ 100RPM (High Speed Low Torque)
• Green = 18:1 @ 200RPM (Middle Speed & Torque)
• Blue = 6:1 @ 600RPM (Low Speed High Torque)
Step 4.4 Add Motor • Name Motor –
LFMotor - keeping it
short!
• Select Forward &
Reverse Directions –
won’t know until
debugging whether
or not in needs to be
forward or reversed.
• Select the Green 18:1
200RPM Gear
Cartridge
• Click Done.
Motion &
Drivetrain
• Motion &
drivetrain code
blocks options
have populated
since we have
installed at least
controller & at
least 1 motor.
Step 5.1
RFMotor
• We are going to add
the RFMotor.
• Click on Add Motor.
• Software asks us Step 5.2 - Select
which PORT we RFMotor
have the RIGHT
FRONT Motor
plugged into?
• If you plugged it
into a different port
select that port
now.
• I’m Clicking On
PORT2.
• & Then Clicking
Done.
• Software asks us Step 5.3 - Select
which PORT we RFMotor
have the RIGHT
FRONT Motor
plugged into?
• If you plugged it
into a different port
select that port
now.
• I’m Clicking On
PORT2.
• & Then Clicking
Done.
Step 6.1 –
BackMotor
• Controller1,
LFMotor, & RFMotor
should be there.
• Click on Add a
Device.
• Now we are going to
add the BackMotor
in Port3.
Step 6.2 Adding BackMotor
• Name Motor –
BackMotor - keeping
it short!
• Select Forward &
Reverse Directions –
won’t know until
debugging whether
or not in needs to be
forward or reversed.
• Select the Green
18:1 200RPM Gear
Cartridge
• Click Done.
Step 6.3 – All
Devices Entered
• All Devices
should be
entered & the
setup should
be done!
7.1 Your Ready to Program
• We are ready to start programming by dragging &
placing blocks!
• The devices should be done, can minimize it.
• I’m starting the program dragging in a Forever
Loop.
Step 7.2 – If () then do () in not do Else()
• We are going to drag in
a “If, () Then do (), Else
do ()” statement into
the forever loop.
• This will divide the
program up into parts.
• One part will run all the
time the “Condition”
isn’t met.
• So, when “Then” does
happen it will stop that
part from running.
Step 7.3 – Math Operation of “OR”
• Drag in Math Operation of “OR” into the
“CONDITION” of the “If () Then”.
• We want to have 3 Conditions not just 1 Condition.
• Going to drag it in 2 times so we have 2 “OR’s.”
Step 7.4 – Controller Sensing Pressed?
• Drag in a Controller Sensing Statement into one
of the OR spots
Step 7.5 – Controller Sensing Pressed?
• Drop down Choose a button, I choose Button B,
but you can choose what you want!
Step 7.6 – Controller Sensing Pressed?
• Drag another in a Controller Sensing Statement
into one of the OR spots.
Step 7.7 – Controller Sensing Pressed?
• Drop down Choose a button, I choose Button A,
but you can choose what you want!
Step 7.8 – Controller Sensing Pressed?
• Drag another in a Controller Sensing Statement
into the last OR spot.
Step 7.9 – Controller Sensing Pressed?
• Drop down Choose a button, I choose Button Y,
but you can choose what you want!
• This If statement is now down, now we’ll enter 3
while statements into it.
Step 8.1 – While Statements
Drag in 3 While Condition Statements:
1. One for While B Button is pressed
2. One for While A Button is pressed
3. One for While Y Button is pressed
Step 8.2 – While Statements
Drag in 3 Controller Sensing Statements:
1. One for While B Button is pressed
2. One for While A Button is pressed
3. One for While Y Button is pressed
Step 8.3 – While Statements
• Drag in a “Set Motor Velocity Statement”
• Set it to RFMotor & 100% Velocity.
Step 8.4 – While Statements
• Drag in a “Spin Motor Direction Statement”
• Set it to RFMotor & Forward.
Step 8.5 – While Statements
• Drag in a “Set Motor Velocity Statement”
• Set it to BackMotor & 100% Velocity.
Step 8.6 – While Statements
• Drag in a “Spin Motor Direction Statement”
• Set it to RFMotor & Forward.
Step 8.7 –
While
Statements
• Do Steps 8.1
through 8.6
for while
Controller A &
for While
Controller Y is
pressed.
Step 8.8
• Controller 1 Button
A set LFMotor
velocity to 100%
Forward &
BackMotor velocity
to 100% in Reverse.
• Controller 1 Button
Y set RFMotor
velocity to 100%
Reverse &
BackMotor velocity
to 100% in Forward.
Step 9.1 – Make it Spin In Place
• We are now going to program the robot to spin in
place.
• You can use whatever buttons you would like? R1
& R2, R1 & L1, or etc. it is up to you.
• Drag in an OR Statement into else if.
Step 9.2
– Make
it Spin
In Place
• Drag in a couple of Controller Sensing Statements
into “else if OR.”
• You can use whatever buttons you would like? R1
& R2, R1 & L1, or etc. it is up to you.
Step 9.3 – Let’s Learn a Shortcut!
• You can build a block of program as I have done
over here.
• Then can RIGHT CLICK IT & make a copy &/or
copies!
Step 9.4 – Let’s Learn a Shortcut!
• I set them all to
100% velocity,
then did each of
the 3 motors in
the forward
direction.
Step 9.5 – Let’s Learn a Shortcut!
• Right click & hit
Duplicate.
Step 9.6 – Let’s Learn a Shortcut!
• Now I have 2 identical
blocks of code.
• Going to the 2nd block &
change it to:
• Button L1
• Motors the other way,
Reverse
Step 9.7 – Let’s Learn a Shortcut!
• Now I can drag these 2
blocks of code into my
program.
Step 9.8 – Let’s Learn a Shortcut!
• This will
make it
spin in
place at
full speed
with all 3
motors
using the
L1 & R1
Buttons.
Step 10.1 – Tank Drive
• In the else loop we
are going to insert a
“Tank Drive”
program.
• I’m putting in a 2
motor 2 joystick tank
drive program, with
one caveat…
• We have a 3rd motor, the BackMotor, & we don’t
want it free-wheeling, that would make it not
drive as well. So, we are going to make it
actively HOLD it’s position.
Step 10.2 – Tank Drive • 2 motor 2
joystick
tank drive
program,
with one
caveat…
• Set the 3rd
motor, the
BackMotor
to Stop &
Hold it’s
position.
The Program
Go at 120°
Program has 3 sections:
• Go at 120°.
• Spin In Place.
• & 2 Joystick Tank Drive.
Spin In
Place
2 Joystick 2
motor tank
drive
Download It To Your Bot
• Make sure & save your
program.
• Then download it to
your robot & take it for
a test drive.
• Debug it & find any
problems.
End of Assignment
By: Mr. Gravitt