ROBOTC.net Blog  

ROBOTC News

Archive for the ‘VEX IQ’ tag

A Teacher’s POV: Using the Gyro Sensor

with one comment

Programming your robot to make precise turns can be a source of frustration for some students as they begin to learn ROBOTC. Oftentimes, when students are just learning programming, all of the movements of their robots are based on timing. When programming a robot to move forward or backwards, a small error or a small amount of inconsistency can usually be overcome. With turning, however, inconsistencies and small errors can lead to larger errors and the frustration I mentioned earlier.

gyro sensor

At this point, students learn that sensors can be used to improve the movement of their robots. With the VEX IQ, a Gyro Sensor is provided that eliminates any guesswork when it comes to programming your robot to turn.

The Gyro Sensor measures the rotational angle of the robot. If you look at the Gyro Sensor, you will see an arrow that points in a counter-clockwise direction. That is the default positive direction. Therefore, as long as the sensor is mounted flat on the robot it picks up the parallel angle to the ground. The sensor then registers the current position as a zero point. If the robot turns counter-clockwise, it registers as a positive value. If it turns clockwise, the sensor registers a negative value. We can see this applied with the following illustration:

 

Gyro_Sensor--Display

 

We can program the Gyro Sensor using Natural Language or full ROBOTC. To use Natural Language, you just need to make sure that the Gyro Sensor is plugged into port 4. Let’s take a look at some ways to program the Gyro Sensor with Natural Language.

 

measure turnsleft gyro

 

With this program, getGyroDegrees returns the current rotational value of the sensor in units of degrees. When making gyro-based turns, it is best to reset the gyro sensor before each turn, so the resetGyro command is utilized. With the example, we want the robot to turn until the getGyroDegrees command returns a value (from the Gyro Sensor) of 90 degrees. Therefore, we use the repeatUntil command. When we run this program, our robot should make a 90 degree left turn. Note that the robot may turn more than 90 degrees due to drift, which is caused by momentum. If this occurs, just slow down the speed of the motors. That should eliminate the drift.

We can apply the same commands to program our robot to make a right turn.

 

measure turnsright gyro

 

What I did when first showing the students the Gyro Sensor was to have them see the sensor work with the debugger screen. I used a sample program utilizing full ROBOTC with this activity. The sample program we used was in the Gyro Sensor Folder, and it is called Gyro Display Values. The students compiled and downloaded the program. They kept the USB cables plugged into their robots so they could see the values of the Gyro Sensor on the debugger screen. To access the debugger windows, go to the Robot menu, click on Debugger Windows, and then select Sensors.

The students can now run their program, physically move their robot, and see how the values of the Gyro Sensor change via the debugger screen.

The VEX IQ Gyro Sensor is extremely useful and easy to program, and the students have a lot of fun using this sensor.

- Jason McKenna

 
 

Robomatter Blog Ad VEX IQ

 

Written by Cara Friez

February 24th, 2014 at 1:16 pm

ROBOTC Graphical Programming Preview Available!

without comments

clickanddragAfter months of work, the ROBOTC Development Team is excited to announce the availability of the first preview release of ROBOTC Graphical Language for the VEX IQ platform. This new interface will allow you to program robots from inside ROBOTC with easy-to-use graphical blocks that can be drag-and-dropped to form a program. Each block represents an individual command from the “text-based” ROBOTC and Natural Language. The new click and drag interface along with the simplified commands of Natural Language will allow any robotics user to get up and running with programming their robots as soon as possible.

The first release of ROBOTC Graphical Language is available for the VEX IQ platform for use with the standard VEX IQ Clawbot and Autopilot Robots. All ROBOTC 4.0 users will receive access to the new Graphical Language interface at no additional cost! Our plans over the next few months are to extend the Graphical Language interface to all of ROBOTC’s support platforms, including the Robot Virtual Worlds technology. You can download the preview version today at http://www.robotc.net/graphical/.

———————————————————————————————————————————————————-

The new ROBOTC Graphical programming environment adds a number of new features we’d like to highlight:

Graphical Language Command List (Drag and Drop)

GraphicalFunctionBar
With the new ROBOTC Graphical Mode, we’ve updated our “Functions Library” to match the style of the Graphical interface. This new mode will allow you to drag and drop blocks of code from the “Graphical Functions” menu into your program to get your program created even faster!

New Language Commands for Easier Programs

NewLanguageCommands
We also added some new language extensions to both ROBOTC and Natural Language; such as the simplistic “Repeat” command. Prior to the Repeat command, users would need to copy and paste large sections of code or use a looping structure (like a ‘for’ or ‘while’ loop) in order to have a set of actions repeat a number of times. With the new “Repeat” command, however, users can simply specify how many times they would like the code to run, with no complex coding required. And users who wish to make an “infinite loop” can use the “repeat forever” command to accomplish this task quickly!

Commenting Blocks of Code!

CommentingOut
Another awesome tool that we’ve implemented in ROBOTC Graphical is the “comment out” feature. You can now comment out an entire line of code just by clicking on the block’s line number. The robot ignores lines of code that are “commented out” when the program runs, which makes this feature very useful when testing or debugging code. This new tool is unique to ROBOTC’s Graphical interface.

Updated and Simplified Toolbar

Toolbar
Sometimes navigating menus as a new user can be a little overwhelming – so many options to choose from and lots of questions about what each option is used for. To help with this, we’ve redesigned ROBOTC’s toolbar to make getting up and running easier. We put the most used commands on a larger toolbar so new users have an area to easily click to download firmware, send their code to their robot, and run their programs without having to use the standard menu interface.

Convert to Text-Based Natural Language

ConvertToText ConvertToText2
Because each Graphical Natural Language block corresponds to a real ROBOTC or Natural Language function, users will be able to graduate from Graphical Programming to full text-based programming with the press of a single button. This allows users to naturally transition from Graphical Natural Language to the text based Natural Language (or ROBOTC), without having to worry about manually converting the code line-by-line!

Teacher’s Guide and Sample Programs

UsersGuide
The new graphical interface includes over 50 new sample programs to help you get up and running with working examples and demo code. In addition, we’ve also developed a 30+page guide to walk new (and existing) users through the new Graphical Programming interface and getting started with the VEX IQ platform. You can find a link to the programming guide here and also on the ROBOTC Graphical page.

———————————————————————————————————————————————————-

This initial release is only the beginning and we’re planning on improving the software with more features and flexibility over the coming months.

Future Support/Features:

  • Copy and Paste
  • Undo/Redo Support
  • Support for custom robots/configurations via an updated “Motors and Sensor Setup” interface.
  • Dynamic Loop and Command Parameters (based on Motors and Sensor Setup / Robot Configuration)
  • Tooltips, Contextual Help, and more!

Click here to download the installer!

Let us know what you think! If you have any feedback or questions, please send them along via the ROBOTC’s VEX IQ forums.

 
 

Robomatter Blog Ad VEX IQ

 

A Teacher’s POV: Fun With VEX IQ Remote Controls

without comments

Whether they are in elementary school, middle school, or high school, students really enjoy programming their robots with remote controls. Luckily, the VEX IQ wireless controller allows you to do just that. ROBOTC allows you to create your own remote control programs to customize each joystick axis and button controls. Moreover, you can use both Natural Language and full ROBOTC with the remote controls.

Both the VEX IQ brain and the remote control require a radio controller for communication. The radio controller has to be in each in order to use the remote control. Additionally, a battery needs to be placed into the remote control for the wireless communication. Just like the battery for the VEX IQ brain, the battery for the remote control is rechargeable.

Vex Remote 1In order for the VEX IQ brain and the controller to communicate, they must be paired together. With both devices turned off, connect the two devices together with the tether cable that is included with the VEX IQ Starter Kit with Controller. The tether cable is just a standard Ethernet cable. Turn on the VEX IQ brain by pressing the check button. The controller will automatically link and pair with the VEX IQ brain.

Once your connection has been established, the green light will blink on both the remote control and the VEX IQ brain. You will not have to link the tether cable with the remote control the next time you turn on the VEX IQ brain or the remote control. In the classroom, you can assign each robot to a remote control by giving each a number. That way, you never have to link the remote control with the VEX IQ brain. Or, you can just have the students do a quick set up at the beginning of class. Either way will work.

ROBOTC can access all of the data from the VEX IQ remote control by referencing the button and axes by their described names. Joystick buttons return values of..

• 1 – Pressed
• 0 – Not Pressed/Released

Joystick Axis return values of…
• -100 to +100 (0 when centered)

Vex Remote 2 Vex Remote 3

When using the VEX IQ remote control, make sure you switch to your “Controller Mode” to Tele-Op.

Vex Remote 4

Alright, now you can begin programming (either in Natural Language or full ROBOTC) and have some fun.

Remote controlAs teachers, we all know to expect the unexpected. I recently had the students on a Friday, with a long weekend in front of them. Therefore, I did not want to start a new concept, for I would have to re-teach it after the long weekend. So, I decided to set up a quick in-class competition with the VEX IQ Challenge Field and some Bucky Balls and rings.

I allowed the students to make up the parameters for the game, gave them some time to devise some strategy, downloaded some sample programs to run the remote controls, and let the fun begin. The students had a great time and the activity will serve as a springboard for future investigation into how to customize the remote control programs.

- Jason McKenna

 
 

Robomatter Blog Ad VEX IQ

 

Written by Cara Friez

February 4th, 2014 at 9:55 am

ROBOTC Graphical Natural Language

without comments

We know that text based languages (such as ROBOTC) have advantages in terms of customizability with functions, complexity with algorithms and calculations, and typically smaller sized programs over graphical languages; however, it is difficult to overcome the simplicity and ease of use that “Drop and Drag” programming languages offer to new users just getting started with programming.

TextBasedNaturalLanguage

A few years ago (with ROBOTC 3.X), we announced our “Natural Language” feature – a simplified library of commands that used “natural” commands to control your robot, such as Forward, Reverse, and LineTrackForTime. The Natural Language feature was designed to help ‘bridge the gap’ between a graphical language and the text-based ROBOTC. Teachers have praised ROBOTC’s Natural Language for making it easier to get their students up and running faster than ever before. Currently, ROBOTC supports Natural Language on the VEX Cortex, VEX IQ, and LEGO MINDSTORMS NXT platforms for both “Real” and “Virtual” robots.

GraphicalProgrammingOverview1

Today we’re proud to give you a sneak peek to a new feature we’re calling “Graphical Natural Language”. This new interface will allow you to program robots from inside ROBOTC with easy-to-use graphical blocks that can be drag-and-dropped to form a program. Each block represents an individual command from the “text-based” ROBOTC and Natural Language.

 


 

Each block is custom designed to fit the needs for that specific function and parameters. Using text boxes and drop-down menus, users can customize each values of each function to solve various challenge and activities using the same commands as ROBOTC’s Text-Based Natural Language.

FunctionsParameters
We have also added some new language extensions to both ROBOTC and Natural Language, such as the simplistic “Repeat” command. Prior to the Repeat command, users would need to copy and paste large sections of code or use a looping structure (like a ‘for’ or ‘while loop) in order to have a set of actions repeat a certain number of times. With the new “Repeat” command, however, users can simply specify how many times they would like for the code to run, with no complex coding required.

RepeatCommand
Another awesome tool that we’ve implemented in ROBOTC 4.0 is the “comment out” feature. You can now comment out an entire line of code just by clicking on the block’s line number. Lines of code that are “commented out” are ignored by the robot when the program is run, which makes this feature very useful when testing or debugging a program. This new tool is unique to Graphical Natural Language.

CommentingOut
Because each Graphical Natural Language block corresponds to a real ROBOTC or Natural Language function, users will be able to graduate from Graphical Natural Language to full text-based Natural Language with the press of a single button. This will allow you to naturally transition from Graphical Natural Language to the text based Natural Language (or ROBOTC), without having to worry about manually converting the code line-by-line!

NaturalLanguageWithCode
We have many other features and enhancements planned for Graphical Natural Language – Be on the lookout for a preview version sometime in January!

Please Note: The screenshots and interface in this post are not the finalized version of the ROBOTC Graphical Natural Language – the names, interface, look and feel of the system may change between now and official release.

A Teacher’s POV: Programming the VEX IQ Robots

without comments

VEX-IS-DS4In the previous entry, I shared some of the features of the VEX IQ robots. Also discussed were some ideas on how to get a classroom organized. Now that we have those things established, we can move on to a discussion of how to begin programming the VEX IQ robots.

ROBOTC for VEX IQ has Natural Language commands that will help beginning programmers of the VEX IQ by supplying a set of commands that use “natural” words. For example, the “forward” command will make your robot move forwards for a specified amount of time or distance. The robot will come to a stop after the movement. Here are some examples of the command:

——————————————————————-
Move the robot forward for 2.5 rotations:
• forward(2.5);

Move the robot forward to 180 degrees:
• forward(180, degrees);

Move the robot forward for 1.5 rotations at 30% speed:
• forward(1.5, rotations, 30);

Move the robot forward for 10 seconds:
• forward(10, seconds);
• forward(10000, milliseconds);
——————————————————————-
Natural Language also contains other helpful commands; such as, “backward”, “turnLeft”, “turnRight”, and “repeat”. Below is an example of a Natural Language sample program that is located within the Natural Language sample program folder in ROBOTC:
——————————————————————-
/*
VEX IQ Natural Language – Port Names and Numbers
leftMotor – Port #1
rightMotor – Port #6
armMotor – Port #10
clawMotor – Port #11
touchLEDSensor – Port #3
gyroSensor – Port #4
distanceSensor – Port #7
bumperSensor – Port #8
colorSensor – Port #9
*/

task main()
{
//Configure the Natural Language to use the VEX IQ Clawbot
setRobotType(VexIQClawbot);

//Move the robot forward for 1.5 rotations (rotations are the default unit) at 50% speed (default speed)
forward(1.5);

//Turn the robot right for 1.25 rotations at 50% speed (default speed)
turnRight(180, degrees);

//Move the robot backwards for 720 degrees at 25% speed.
backward(720, degrees, 25);

//Turn the robot left for 2.5 rotations at 50% speed (default speed)
turnLeft(2.5, rotations);
}
——————————————————————-

As you can see, there are a couple things that we have to do in order to use the Natural Language functionality. To enable Natural Language, go to “Robot Menu -> Platform Type -> Natural Language”.

The easiest way to get started programming is to open a sample program or to use a template. To open a sample program in ROBOTC, go to File Menu -> Open Sample Program.

To use a Natural Language template in ROBOTC, go to File Menu -> New… -> Natural Language Template.

To make programming easier, Natural Language makes assumptions about the type of robot you are using. To configure your Natural Language program to use our VEX IQ Clawbot, use the following line of code:
——————————————————————-
setRobotType(VexIQClawbot);
More robot models will be supported in future releases.
——————————————————————-

VEX-IQ-DSFinally, you will notice in the sample program that port names and numbers are given specific names and ports. Make sure that your VEX IQ Clawbot’s motors and sensors are configured this way in order to work with the Natural Language commands.

Ok. We are ready to go with programming! What should we do? My suggestion would be to start with the Labyrinth Challenge.

The Labyrinth challenge gives the students an opportunity to engage with the VEX IQ robots and ROBOTC. The students are immediately engaged because they can see and test their robot’s movement as it makes its way through the course. Since this may be the first program that some students write, there are a couple of things worth remembering. First, makes sure the students create a flowchart before they begin programming. For more information on flowcharts, you can look here: VEX Teacher – Engineering.

VEX-IQ-DS2Second, it is important that the students describe what is going on in their programs with comments. For more information on how to utilize comments, please see here: http://www.robotc.net/vex_full/reference/hp_comment.pdf

Now you are ready to go! Good luck and have fun! Remember, if you have any questions as you are working, please visit the ROBOTC forums.

- Jason McKenna

 
 

Robomatter Blog Ad VEX IQ

 

Written by Cara Friez

December 13th, 2013 at 6:41 am

A Teacher’s POV: Getting Started with the VEX IQ

without comments

VEX-IQ-Carly-and-KarriThe VEX IQ robot is a great, new option for middle and high school robotics teachers. With anything new in the classroom, it’s important to have some ideas on how to best implement the new tools in the classroom.

There are some features of the VEX IQ system that teachers will notice initially. The VEX IQ brain has 12 identical ports. This means that any device (either a sensor or a motor) can be plugged into one of the ports. Also, the VEX IQ motors are smart motors; therefore, the motors can hold a position and resist external movements. Some of the sensors for the VEX IQ include a Bumper sensor, a Touch LED sensor, a Gyro Sensor, a Color sensor, and a Sonar sensor. One nice asset of the motors and sensors is the fact that they each have their own upgradeable firmware. As a result, if new features are added, the firmware for the device can be upgraded, as opposed to buying a new sensor and/or motor.

With the VEX IQ Starter Kit, there are over 850 structural and motion components. That many parts allow teachers and students lots of flexibility when it comes to building a robot. But, that’s only if they can find the parts they need. One of the first things that teachers need to do is get their kits organized. The Starter Kit comes with a storage bin and tray that help, but the amount of parts means that different pieces will need to be stored together in the storage bin. If the students know what pieces are located in each section of the storage bin, it will make the building process much easier.

VEX-IQ-JacobThe base robot for the VEX IQ is the Clawbot. The Clawbot include a gripper and a lifter arm. These features immediately grab the attention of most students; they love the idea of being able to lift and grab an object. For teachers, it is a good idea to build the Clawbot before allowing the students the opportunity to do the same. This gives teachers an idea of what problems the students may have as they begin building, and it also allows the teachers to help those students that run into problems. You can’t start anything until all the students have their robot built. Having some groups finish their robot, while other groups lag behind can be an issue. Building a robot first, puts the teacher in the best position to get everyone started off on the right foot.

When it comes time to start building, students can work on different parts of the VEX IQ Clawbot. You can divide the Clawbot into these sections: the Base, the Claw, the Tower, and the Ball Holder. One suggestion to organize a class would be to have two students work on the Base, while one student each works on the Claw, the Tower and the Ball Holder. Or, you could have one student work on each section. It’s important to note that however the class is organized for the building of the Clawbot, there should be a uniform way that the students attach the motors and sensors.

 


 

The battery for the VEX IQ robot brain comes charged, so a teacher does not need to worry about doing that preliminarily. So, once the Clawbot is built, the next thing that needs to be done is install the ROBOTC firmware and update the VEX IQ brain, motors, and any sensors that may be on the robot. Click here for directions on how to install the ROBOTC Firmware.

To update the VEX IQ brain, motors, and sensors, the VEX IQ Firmware Update Utility needs to be downloaded to your computer. The Firmware Update Utility and directions on how to utilize it can be found here.

With the next installment, we will take a look at how to set up your first programming lesson. In the meantime, teachers can take advantage of a few readily available resources at Carnegie Mellon’s Robotics Academy VEX Teacher Site and the ROBOTC Wiki to help with questions concerning programming the VEX IQ with ROBOTC.

-Jason McKenna

 
 

Robomatter Blog Ad VEX IQ

 

Written by Cara Friez

December 5th, 2013 at 4:43 pm

Setting Up Robots – VEX Edition

without comments

SettingUpVexNow that the physical robot kits are in the classroom and ROBOTC is installed and activated, you should be ready to build the physical robots for your classroom. One of the best features of a VEX Robotics kit is that they allow students to create a nearly limitless range of robots; the downside of this, however, is maintaining student-created robots in a classroom. To help with this, ROBOTC and the Video Trainer Curriculum support several standard models to help keep a baseline in the classroom.

Squarebot 4.0The first of such robots we will look at is the VEX Squarebot (using the VEX Cortex), one of the standard Cortex models that are used in the VEX Cortex Video Trainer for ROBOTC. The Squarebot utilizes three VEX motors (two for driving, one for the arm), and a wide variety of sensors. These sensors include Quadrature Shaft Encoders, a Sonar Sensor, and a Potentiometer (among others; in total, there are 8 separate sensors on the Squarebot). This model allows for a variety of tasks to be completed and is designed to work with all of the challenges in the ROBOTC Curriculum.

swerve

A smaller, different alternative Cortex standard robot is the Swervebot. Like the Squarebot, the Swervebot utilizes the VEX Cortex as its main processor and uses two VEX motors for driving. However, the Swervebot’s small chassis does not utilize an arm. Instead, the Swervebot makes clever use of an Omniwheel in the rear for turning and boasts three Line Follower sensors and a Gyroscope (as well as 6 other sensors, for a total of 10) and is perfect for smaller classroom environments.

VEXiq-047-300x230

Finally, the new VEX IQ platform can be quickly assembled and ready to use in a classroom thanks to the IQ Clawbot standard model. Using 4 motors total (two for driving, one for the arm movement, and one for gripper control), the VEX IQ Clawbot can be controlled either autonomously using the VEX IQ sensors (such as the Bumper Switch and Color Sensors), remotely using the IQ Controller, or a pleasant mix of both, depending on which kit is being used.

Visit CMU’s Robotics Academy VEX site for more information on the different kits available and to find build instructions.

 
 

Robomatter Blog Ad VEX

 

Written by Cara Friez

September 10th, 2013 at 2:40 pm

Which Robotics Kit Should I Use? VEX Edition

without comments

VEXiq-109Now more than ever, robotics educators are faced with the important question of which kit they should purchase and use. This key question has been made even more intricate in the 2013-2014 school year due to the addition of the new robotics kits, VEX IQ kits. This article will help break down each VEX kit, their capabilities and target audiences, and allow you, the educator, to make an informed decision on which kit is best for your particular classroom.

The VEX IQ system is the brand-new robotics system from Innovation First International (IFI for short, makers of the VEX Robotics Design System). The VEX IQ can be used with any of the all-new hardware and sensors, including a unique plastic snap-fit structural system.

  • Sensors include a gyroscope, color sensor, potentiometer, touch LED, and ultrasonic sensor.
  • The base kits (either Sensor or Controller kits) are provided with over 650 structural components, 4 plug-and-play ‘smart motors’, at least 2 touch sensors (or more, depending on kit), and the VEX IQ microcontroller (more information on all available kits can be found here).
  • The IQ contains 12 smart ports that can be used to control either analog sensors, digital sensors, or servos/motors; the ports are non-typed and can be used to control any piece of VEX IQ compatible hardware that is plugged into it.
  • It also includes a micro-USB port for IQ-to-computer communication and a ‘tether’ port for direct connections to an VEX IQ Controller.
  • Debugging and programming information can be displayed on the backlit LCD information to increase ease-of-use in real time.
  • Wireless communication between the VEX IQ microcontroller and a VEX IQ controller is provided via a set of 900 MHz radio adapters.
  • The VEX IQ system will be fully legal in the new VEX IQ Challenge (designed specifically for the VEX IQ system), for students ages 8-14.
  • Recommended use: Middle School.

cortex-robotOne of the mainstays of the educational robotics world is the VEX Cortex platform. Originally released in 2010 by IFI, the Cortex can be used with the VEX Robotics Design System’s hardware and sensors.

  • Includes over 300 metal structural parts, 4 powerful DC motors, the VEX Cortex microcontroller, and a wide variety of fasteners, gears, and other miscellaneous hardware.
  • Sensors include touch sensors, an ultrasonic sensor, integrated motor encoders, line following sensors, and a potentiometer; additional sensors are available outside of the base kits.
  • Wireless communication between a VEX Cortex and a VEXNet Joystick Controller is possible by using the 802.11b/g VEXNet USB Adapter Keys.
  • The VEX Cortex system can be used in the VEX Robotics Challenge (Middle, High School, and College divisions).
  • Recommended use: advanced Middle School, High School or College.

We understand that choosing a robotics kit is a tough decision. The number one factor in determining which kit is right for you is the students; depending on the skill level of the students, it may be better to challenge them with a more advanced kit (VEX Cortex) or they may prefer to learn with a beginner kit to get them started (VEX IQ.) No matter which kit you decide to use, though, you can rest easy knowing ROBOTC will fully support all of these platforms.

 

Written by John Watson

August 27th, 2013 at 5:13 pm