Building Robots at School

September 18, 2008

The VEX Control System

Filed under: teaching,VEX — dtengineering @ 9:16 pm

Now that the students have some robots running about on the floor, they have suddenly become much more interested in the VEX control system.  The default program that comes built-in to the VEX control system is pretty good for getting a basic robot up and running, but you will soon want to start doing a bit more.  To do that, you need to program your robot.

A Bored of Notes

A Bored of Notes

Before talking too much about programming, however, it is important to notice a few things about the VEX transmitter.  The VEX inventors guide (the big white binder that comes with your VEX kit… you have at least looked at it, I hope) has a great section on how to use the transmitter.  Specifically it tells you how to set the “trims”.  It even tells you what a “trim” is, and why you have to set them.  It also tells you how to reverse the direction of one of the joystick axes.  This is a REALLY useful thing to do when you have, after programming your robot, realized that it turns when you try to go straight… or goes forward when you try to go in reverse.  It is definitely worth taking a few minutes to learn how to set up the controller properly.

The Inventors guide also talks about how to set the antenna up properly.  VEX has a good RC (radio control) system, but if you leave your antenna on the transmitter down, and the antenna on your receiver all coiled up in a little roll, you will have probably less than three metres of range.  Note that when you go to a competition that you will be required to remove YOUR crystals from the back of the transmitter and top of the receiver, and replace them with COMPETITION crystals that will be supplied by the event organizers.  This is to prevent teams RC units from interfering with each other.  To practice with your robot at a competition you will need to have a telephone cable to connect your transmitter directly to your CPU.  Take the time to find a good one that works well BEFORE you go to a competition.  You should also note that, should the need arise, you can attach two VEX receivers (operating on different frequencies) to the CPU so that you can use two controllers to run the robot.  You could, for instance, have one person drive the robot base while another controls the arm and end effectors.

Now, back to that programming thing.  As I mentioned, the default program is pretty good and is really well explained in the Inventors Guide (you haven’t read that YET?  Sheesh…) But you will soon want to start doing more, and that means programming.  Forunately for beginners there are three common languages that can be used to program a VEX CPU, and at least one of them is really about as easy as programming is ever going to get.  I guess that is why they call it EasyC.

The programming kit includes EasyC and a programming cable that will allow you to hook the VEX CPU up to your (preferably laptop so you can take it to tournaments) computer, as well as one seat of the EasyC software.  Both the cable and software can be purchased seperately (or you can buy a lab pack of EasyC) but typically a ratio of one seat of EasyC to one programming cable to one robot seems to work okay.  If you are running many teams, you could probably share a programming cable between two robots, however.

Rather than go into detail on how EasyC works, I will refer you… once again… to the manual.  I will note that on page 16, when it discusses identifying the correct COM port to talk to your robot with that you can usually save yourself the hassle of going through the whole list by looking under “Control Panel->System->Device Manager->Ports (COM and LPT)”.  Aside from that the manual is pretty comprehensive, and written far more clearly than anything I’m likely to write here.  EasyC is what I use with my students as well as with my own VEX kit at home.

If I need more flexibility, however, or am just feeling sufficiently masochistic to delve into the world of hand coding C, the VEX CPU can be programmed with the Microchip C compiler.  I am not going to offer any suggestions on that topic here, however, because if you are considering that option you are either sufficiently skilled to figure it out on your own, or just blissfully unaware of how much happier you will be with EasyC.  It isn’t like Microchip C is hard, per se… we use it with our FRC robots and it works great.  Our lead programmer for the “BIG” robot was in grade 10 last year and did a fine job with Microchip C… it is just that EasyC is so… well…. easy.

The third, “intermediate” option is RobotC, however I haven’t used it and can’t comment on what it can do.

So good luck, have fun, and try to get some kind of autonomous code (when the robot runs all by itself without any help from you) figured out before your first competition.  If you don’t have it figured out by then, then make sure when you get there that you ask around until you find someone who can help you.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: