VEX IQ Holonomic X-Drive Coding Tutorial
Key Takeaways
Codes a VEX IQ Holonomic X-Drive using tutorial
Full Transcript
all right good day everyone today we're going to go through something that's been requested a lot and that is how to code the uh X drive or holonomic drive on the VEX IQ uh now I've done this tutorial for vex V5 and uh that's where I've been pointing a lot of my uh uh fans who have been asking this question but I'll I'll do it for VEX IQ as well just to make sure that everybody's on the same page now first thing we got to note is that on our um controller uh the x axis for your left stick is uh called the oop sorry excuse me is called the B Direction all right the x axis is the B Direction um and then the y axis is the a direction okay the Y AIS is the a direction uh and then on the right of the controller the X AIS is the C Direction all right uh and that's what we're going to use okay um but if you want to change the way you drive um you're going to have to use um the principles that I'm going to teach today and then modify it for for your uh controller um approach okay but today we're going to use our left stick to uh control the forward back backwards and then strafing on the left and right direction and then we're going to use our right stick uh but only the xaxis to control the turning the your angle the your direction okay so uh that's what we're going to do today uh and um I believe it is similar to Flying an actual drone uh so uh this should be um very familiar for people who have flown a drone um uh but if you want to change the uh controller layout make sure that you use the principles and uh adapt it for your own purposes okay all right so um uh I don't have a robot with me today because I am traveling uh it is the summer holidays but what we need to do is we need to add your four motors for your homic drive for your X Drive um as individual Motors so here we're going to add a motor uh let's say it was p one and we go forward left and then for your forward and reverse you got to make sure that um uh forward the forward Direction so this is the um anticlockwise direction is where uh when when that particular motor spins uh anticlockwise that actually is moving your robot forward okay if it's not if it's for example attached to a gear or something like that you might need to reverse it okay so you triple check the forward direction of the motor but don't worry if you make a mistake if you make a mistake you just have to come back onto the screen uh and then reverse it afterwards so for for today's lesson I'm going to make it so that your left Motors I'm assuming that you don't have a gear ratio you're uh attaching your Motors directly onto the wheel so that on the left side of your motor they are normal but then on the right side they are reversed okay forward left is at Port one rear left is that Port two uh and again the left side I'm going to keep it uh normal so that when the motor is spinning anticlockwise the robot Wheels on the left side are moving forwards uh and then I'm going to go forward right and for forward right because it's on the opposite side I'm going to reverse the motors that means that when I'm spinning the forward right motor clockwise the forward right wheel will be moving forward on the robot and then finally on Port four I'm going to go rear right and then it's also reversed okay so the rear right motor when that's spinning clock clockwise uh then that rear right wheel will be also moving forward done okay so now we have all of our um Motors set now it's very tempting Now to create um you know uh uh a a four motor drivetrain okay if you do that then you won't get the benefits of uh the holonomic drive which lets you strafe from left to right um uh and that's really important so that is why we're setting it up with four Motors okay now uh remember the x axis of the control I sorry the Y AIS of our controller in order to test the robot so that it is moving forwards and backwards we need to know that the um the forward direction of the motor forward uh up and down direction of the left stick is Direction a okay keep that in mind Direction a so we just go done we'll hide this screen then we're going to do a forever Loop uh so this is the homic X Drive code um and for this we're going to spin all four Motors forward okay forward left rear left forward right rear right forward okay but we're going to set the speed to be whatever our a axis is so we set forward left velocity to uh our controller a position you see that controller a position uh forward left oops oops and then we're going to do the same thing for the other three motors forward left rear left for right rear right okay and then um at this point you should be able to save your code and run it on your robot and as long as you have set your motor directions correctly then all four Motors will um make your robot move forward and backwards when you move your left stick up and down okay because we're making it so that all four Motors they're only responding to the controller a position which reminding you it is the Y AIS okay the Y AIS all right if any of the motors are not spinning the correct position correct direction uh you go back onto your devices find the motor that's not spinning in the right direction and then you flip it from normal to reverse or from reverse to normal that's all you have to do and that's step one so pause this video right now and test it do not wait until the end of the video because if you wait until the end of the video video and something goes wrong you won't know which Step uh you actually went wrong in okay now that is just for um uh for moving forwards and backwards but what about um uh left and right okay so the controller B position we got to somehow add the controller B positioning um so for controller B position we need to now add um uh a sum of our controller A and B positions because when for controller B position when it is positive it is moving towards the right and when it is negative it is moving towards the left okay for controller B position or the x axis of your left stick when we are going positive then for the front left motor we need it to also be going positive I just um uh uh because yeah the front left has to also go forward so it means that we just go to operators and then we go add a plus because if I want to go to the right which is when controller B is positive then front left Mo wheel also needs to be going positive or going forward all right so that's why I add it if it was not going forward if it was going negative then I would um make that minus okay what about the rear left rear left will actually need to go backwards in order to go right so it will be a negative uh it would be minus controller a position minus controller B position what about the front right front right will also be going backwards in order to go to the right yeah um some of this I go past really quickly okay um if you don't understand it you might need to like pause the video and then relisten to what I said but uh I know it can be a b bit confusing but it will make sense as long as um your coach is watching this video um so that they understand it as well uh and then uh he or she will probably be able to explain to you some more uh the rear right um uh wheel will need to go forwards when the robot is going to the right okay this is a holonomic drive and remember this all only works if you did that first step and the robot was moving forwards and backwards with the left stick otherwise it will not work okay uh and then we go like this whoops so because for the rear right wheel uh oh it's not minus it is plus it needs to go forwards remember nobody reminded me okay okay there we go so if you pause this video now and you use this code and then you download it to your brain and test it your left stick should now control everything uh going forwards backwards left and right so your robot should be doing this nice crab walk uh if it is not working uh that at this point point but it was working before it may be because um uh these positives and negatives got flipped around now uh which is um which could happen uh if that happens let identify which motor uh was not correctly moving on your robot and then you flipped the positive to a negative or a negative to a positive on that motor but only if it was working before okay that's why it's really important to take this step byep step all right but what about motor um C position I mean controller C controller C is the left and right Axis the the x axis of the right stick um and for the right stick what happens is that when it goes positive so controller C position what happens when controller C position goes positive if controller C position goes positive then you are turning your robot to the right or you want to turn your robot to the right so if you want to turn your robot to the right when this is going positive what happens to a forward left motor it also has to go forward because if you want your robot to turn to the right it's like a tank move the left side will both need to add your controller C position and then the right side Motors will both want to minus control position okay so this is nice and easy all you have to do is go Plus controller C on all of your left side positions on all of your left side um um code see C duplicate so on your left side we are adding controller C but on your right side forward right and rear right we are removing you're decreasing by controller C okay so here decreasing my controll C decreasing my control C and that's it okay I'll also have this code up on GitHub uh and the link will be in the description below um so that you can test out your X Drive remember it is really important to have have this done step by step okay so that uh you always create um all four of your Motors as individual Motors and then what you have to do is uh test it with your forward and back movements first make sure all the motors are going the right direction um and uh yeah if you have any questions make sure you post it in the comments but I'm pretty sure that uh I'm pretty confident that this is going to work for your robot as long as you followed it step by step now what about autonomous autonomous for X drive holonomic drive is so so good because uh if you're able to control um the forward and back and left and right uh and the rotational directions of your robot autonomous is beautiful and uh it makes it really stable and uh really um easy to score high marks but I'm going to create uh the advanced autonomous coding video uh for members only so if you want access to the autonomous code uh for controlling your your holonomic drive or X Drive robot then uh you can join our uh Channel membership by uh clicking on the join button below and then you will get access to the video on how to create autonomous code for a holonomic drive and that's it for us today I hope you enjoyed it and I will see you again next time bye-bye
Original Description
Learn how to code the ultra-mobile holonomic x-drive using VEX IQ.
Watch as I explain the step-by-step process to code this drivebase and learn how to adapt the code for your particular robot and control design.
Code from this tutorial:
https://github.com/CreatorAcademyAu/iqxdrive
Autonomous tutorial:
https://youtu.be/TSIfZv_uGps
To learn advanced tips and tricks for the VX IQ X-Drive including coding for autonomous skills, join our channel membership:
https://www.youtube.com/channel/UC_EJBSPUTFORXV6gbQFdRgA/join
For more in-depth science, building and coding on this subject, visit www.creatoracademy.com.au
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Creator Academy Australia · Creator Academy Australia · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
LEGO Wedo 2.0 Kangaroo and Joey Demonstration
Creator Academy Australia
LEGO Wedo 2.0 Koala Demonstration
Creator Academy Australia
LEGO WeDo 2.0 Eagle vs Rabbit Demonstration
Creator Academy Australia
Animatronic Australia: The Kangaroo
Creator Academy Australia
How Semiconductors Work: 3D Animation
Creator Academy Australia
LEGO Wedo 2.0 Koala
Creator Academy Australia
First impressions and unboxing First Lego League: Into Orbit 2018
Creator Academy Australia
FLL Into Orbit Team Ranking Gears talks about Artificial Gravity
Creator Academy Australia
FLL Into Orbit team Ev3lution discusses isolation in space
Creator Academy Australia
PI3-BOT (Pie Bot) Prototype
Creator Academy Australia
Dynamic display stand for LEGO Bugatti Chiron (preview)
Creator Academy Australia
Creative Kids TV announcement featuring Creator Academy
Creator Academy Australia
LEGO WeDo 2.0 Guided Lesson: Milo
Creator Academy Australia
LEGO SPIKE PRIME: Turtle Prime Demonstration
Creator Academy Australia
LEGO SPIKE PRIME "Wheelchair Prime"
Creator Academy Australia
10 Reasons why EV3 is SUPERIOR to SPIKE Prime
Creator Academy Australia
Your first launch after installing Python: Python for Kids Webinar Highlight
Creator Academy Australia
What is "Sharpening the Saw": Python for Kids Webinar Highlight
Creator Academy Australia
Why We Use Comments: Python for Kids Webinar Highlight
Creator Academy Australia
Build a Scratch Dinosaur Park (Full Lesson)
Creator Academy Australia
Scratch 3.0: Cat and Mouse Game Stream (Krunal)
Creator Academy Australia
Python Tutorial: Make a Toilet Paper Calculator (Full Lesson)
Creator Academy Australia
Scratch 3.0 Tutorial: Making a chatbot that plays 'heads or tails' (Full Lesson)
Creator Academy Australia
Getting Started with MicroPython on SPIKE PRIME (old)
Creator Academy Australia
Easter Egg Game Tutorial in Scratch (Full Lesson)
Creator Academy Australia
Accessing Weather API with Python (Highlights)
Creator Academy Australia
Accessing Translate API with Python (Highlights)
Creator Academy Australia
Scissors, Paper, Rock with Scratch 3.0 (Highlights)
Creator Academy Australia
Making a really scary game with Scratch 3.0 (Highlights)
Creator Academy Australia
Making a Lemmings game with Scratch 3.0 (Highlights)
Creator Academy Australia
Space Navigation Game in Scratch (Highlights)
Creator Academy Australia
Scratch Supercat Game (Full Lesson)
Creator Academy Australia
Introduction to Robots with LEGO Wedo 2.0 (Full Lesson)
Creator Academy Australia
Getting Started With LEGO Spike Prime (Full Lesson)
Creator Academy Australia
Scratch Walk Cycle Animation Tutorial (Full Lesson)
Creator Academy Australia
Building a Scissor Lift with LEGO Simple Machines (Highlights)
Creator Academy Australia
EV3 datalogging RPM challenge (highlights)
Creator Academy Australia
Learning about buses with LEGO (Full Lesson)
Creator Academy Australia
Make "Flappy Bird" in Scratch 3.0 (Highlights)
Creator Academy Australia
"Memory Arrows" game with Scratch 3.0 Lists (Highlights)
Creator Academy Australia
Learning about Gear Ratios with LEGO Simple Machines (Highlights)
Creator Academy Australia
Scratch 3.0 Bouncing Ball with Stretch, Speed and Acceleration (Full Lesson)
Creator Academy Australia
LEGO SPIKE Prime Order Tracking Robot (Highlights)
Creator Academy Australia
Scratch 3.0 Race Guesser (Full Lesson)
Creator Academy Australia
How Banks Work - a quick explanation for kids
Creator Academy Australia
SPIKE Prime Safe + importance of passwords (Highlights)
Creator Academy Australia
Combination Safe Coding Guide with LEGO SPIKE Prime
Creator Academy Australia
LEGO SPIKE Prime Parcel Scanning Robot
Creator Academy Australia
Building "Addy" the Addition Chatbot
Creator Academy Australia
SPIKE 2.x PID Balancer with Scratch for SPIKE Prime / 51515: Gyro Girl
Creator Academy Australia
What is Procedural Programming
Creator Academy Australia
Zombie game in SCRATCH (plus horrifying zombie facts!)
Creator Academy Australia
Swarming Bugs Scratch Game
Creator Academy Australia
LEGO Mindstorms/SPIKE Prime Scanner and Printer
Creator Academy Australia
Fishing Game with SCRATCH (For Fathers Day!)
Creator Academy Australia
Measuring Paper Plane Speed with SPIKE Prime Line Graphs
Creator Academy Australia
Comparing Mindstorms Robot Inventor and SPIKE Prime
Creator Academy Australia
Code a 'Knock Knock Joke' game in Scratch 3.0
Creator Academy Australia
Creator Academy Australia Live Stream
Creator Academy Australia
Discovering LEGO Mindstorms/SPIKE Gyro Pitch Deadzone
Creator Academy Australia
More on: AI Pair Programming
View skill →Related Reads
📰
📰
📰
📰
The 10 Most Expensive Software Failures in History — and the One Thing They Share
Dev.to AI
Top AI Team Knowledge Management Tools for Air-Gapped Environments in 2026
Dev.to AI
How to Create a Skill in Claude: A Practical Guide for PMs
Medium · ChatGPT
Agentic AI for Anomaly Detection — (9) Local Outlier Factor (LOF)
Medium · Python
🎓
Tutor Explanation
DeepCamp AI