Facebook Twitter Gplus YouTube RSS
formats

When you let robots do PR (they take over the world)

Published on July 12, 2014 by in EV3 News, Writing

EV3 robots aren’t quite ready yet to assist in the household, but they can make themselves useful in other ways. I asked LAVA R3X to narrate my latest video for the LEGO MINDSTORMS EV3 Discovery Book. I think he did quite well.

After I uploaded it, I realized that he’s actually asking people (you, dear reader) to duplicate him on your end of the globe. Maybe it’s a secret plan to take over the world…

Leave a comment below if you build LAVA R3X. If we keep track of all the clones, we may be able to contain this situation before it’s too late.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
5 Comments  comments 
formats

Tutorial: Self-Balancing EV3 Robot

Published on July 1, 2014 by in EV3 Programming
BALANC3R (left) and Gyro Boy (right)

BALANC3R (left) and Gyro Boy (right)

This tutorial will show you how to build and program a self-balancing LEGO MINDSTORMS EV3 robot that can drive around a room. You can build and program BALANC3R (left) or Gyro Boy (right). Once your robot is up and running, you’ll be challenged to customize the construction and program to invent your own self-balancing robot.

 

Step 1: Building a robot

To begin, choose the robot you want to build, and follow the respective step-by-step building instructions.

Requirements for BALANC3R:

Click to go to the building instructions

Click to build BALANC3R

Requirements for Gyro Boy:

Step 2: Installing the EV3 Gyro Sensor block

If you’re using the LEGO MINDSTORMS EV3 Home Edition Software, you’ll need to install the EV3 Gyro Sensor block before you can program your robot.

  • Follow the steps in this article to install the block.
  • If you’re using the LEGO MINDSTORMS EV3 Student Edition, this block is already installed.
Intalling the Gyro Sensor block

Installing new Sensor blocks

Step 3: Download the balancing robot project

  • Right-click this link, click “Save Link As,” and save the project file to your computer.
  • Launch the EV3 programming software, and open the downloaded project file.

Before you run the programs, let’s briefly examine how they work. The project includes four example programs, two for each robot:

  • BALANC3R-Basics: Balance in place, turn right, and turn left
  • BALANC3R-RemoteControl: Control the robot with the infrared remote
  • GyroBoy-Basics: Balance in place, turn right, and turn left
  • GyroBoy-AvoidObstacles: Drive around while avoiding obstacles

Each program consists of two configuration blocks, a balance loop, and a drive control loop, as shown in the figure below.

The balancing program consists of a Balance Loop, a Drive Control Loop and configuration blocks.

The balancing program consists of a balance loop, a drive control loop, and configuration blocks.

  • The configuration blocks let you specify what the robot looks like, so that the robot knows how to balance. For example, the second setting of the first setting specifies the diameter of the robot’s wheels. The example programs come preconfigured with the correct settings for BALANC3R and Gyro Boy if you use the LEGO EV3 Gyro Sensor. If you use the NXT HiTechnic Gyro, change the Choose Sensor setting on the Initialize My Block to 1.
  • The balance loop keeps the robot balanced. It measures and calculates the position and speed of the motors, and it determines the robot’s angular velocity (how fast it’s falling), as well as the robot’s angle relative to the ground. In turn, it uses this sensor information to calculate how to drive the motors in order to keep the robot up right. You won’t need to change any setting of the blocks in this loop.
  • The drive control loop controls the speed and steering of the robot as it drives around a room using a simplified move block. This is the part of the program that you can easily customize to create your own program.

Step 4: Running the basic example program

You are now ready to download the example program to your robot.

  • If you’ve built BALANC3R, begin with BALANC3R-Basics.
  • If you’ve built Gyro Boy, begin with GyroBoy-Basics.

To start the program:

  • Hold the robot upright with its wheels on the ground. Do not hold it tightly, but hold it loosely so that it’s just between falling forward and falling backward.
  • Select the program and start it with the center button on the EV3 brick.
  • You’ll first hear one beep. Keep holding the robot in place.
  • You’ll then hear a double beep. Now release the robot and let it balance.

Your robot should now repeatedly balance in place for 7 seconds, turn right for 7 seconds, and turn left for 7 seconds.

Follow these steps if the robot doesn’t balance:

  • If it doesn’t work on the first try, repeat the steps above a few times. After a while, you’ll know which is the correct “upright” starting position.
  • Do not try to “help” the robot balance. Of course you should catch the robot before it falls, but trying to keep it upright with your hands is counter-effective.
  • Verify that the cables have been plugged correctly according to the building instructions:
    • The two Large motors should be connected to ports A and D. (If you’ve accidentally interchanged them, that’s fine. The robot will confuse left and right turns, but balancing is unaffected.)
    • The Gyro Sensor should be connected to input port 2, regardless of which sensor you use.
  • Verify that you’ve mounted the Gyro Sensor correctly according to the building instructions.
  • Verify that the batteries are fresh.
  • Verify that you are using the latest EV3 firmware (1.06H or 1.06E as of this writing).

Step 5: Running the second example program

If you’ve successfully programmed your robot in the previous step, it’s easy to try out the other example program for your robot. The robot balances in exactly the same way, but the robot’s movements are a little more interesting:

  • BALANC3R-RemoteControl lets you control BALANC3R with the infrared remote, as shown in the video above. Just press the buttons on the remote to make the robot drive forward, backward, and turn. (You’ll figure out the controls quickly.) If you don’t press any buttons, the robot just balances in the same place.
  • GyroBoy-AvoidObstacles makes Gyro Boy drive around a room while backing up from obstacles, as shown in the video above. Before you run the program, make sure that the white beams of both the robot’s arms point downward. The program relies on this starting position to make sure the Ultrasonic Sensor doesn’t detect the floor as an ‘obstacle’ when the robot’s left arm points downward.

Step 6: Customizing the program

As you’ve learned earlier, the balance loop keeps the robot balanced while the drive control loop controls the robot’s speed and steering. The two loops run simultaneously, or at the same time. In the drive control loop, you use the Move My Block to specify the robot’s speed and steering, as shown below.

movemyblock-ref

The Move block makes the robot drive and steer. In this configuration, the robot drives forward (30) while turning to the left (-15).

The robot keeps driving or turning at the specified rate until you run the block again with different values for speed and steering. The figure below shows the Move My Block in action in the basic example program you ran in step 4. The first Move block sets both steering and speed to 0, which makes the robot balance in place without turning. Next, a Wait block pauses the loop for 7 seconds, keeping the robot in the same place. Then, a second Move block sets the steering value to 20, making the robot turn to the right. After another 7 second wait, the robot starts tuning left by setting the steering value to -20.

Controlling the robot with Move My Blocks in the drive control loop.

Controlling the robot with Move My Blocks in the drive control loop

Now that you’ve learned how to control the robot, it’s time to put your skills to the test with programming challenges. To solve these challenges, you can use the techniques from the LEGO MINDSTORMS EV3 Discovery Book, presented throughout chapters 1-9. Instead of using Move Steering blocks in On mode as in the example programs, you use Move My Blocks as shown above.

Challenges for BALANC3R:

  • Make your robot drive around a room while avoiding obstacles with the Infrared Sensor in Proximity mode.
  • Make your robot follow the Infrared Beacon. As you move the beacon around, the robot should follow you.
  • Attach the Color Sensor in front of the robot’s wheels, and make the robot follow a line. You can print line following tracks for your robot from here.

Challenges for Gyro Boy:

  • Make your robot drive in different directions based on the color it detects with the Color Sensor. To accomplish this, make the robot wait for the sensor to see either a yellow, red, green, or blue object. Then, make it drive in a certain direction for 3 seconds based on the detected color, before waiting for a new color signal.
  • Make your robot show different types of faces/eyes on the screen as you interact with its sensors. Show an angry face if you press the Touch Sensor, show a happy face when you trigger the Color Sensor, and so on.

Step 7: Making your own balancing robot

In the previous steps, you’ve made BALANC3R or Gyro Boy balance on two wheels, and you learned to control it with the Move My Block. Now that you’ve got the essential components working, you’re ready to customize both your robot and your program. For example, you can turn BALANC3R into a life-like humanoid with arms, and make it talk to you. Or, go crazy and make any EV3 vehicle balance on its rear wheels. What about a self-balancing F1 style race car? Whatever you make, let others know in the comments below. Happy building!

Step 8: Further reading

In order to make this tutorial accessible for everyone with an EV3 set, I didn’t cover the details of the balancing algorithm. Rather, the design of this program makes it possible to control the robot even if you don’t know exactly how the balancing mechanism works.

However, many papers have been written about self-balancing robots, and I encourage you to read more on the subject as you explore the details of the EV3 program provided on this page. The balancing algorithm in this program is based on a Bachelor thesis written by Steven Witzand, which provides a good overview of the subject, along with Java source code that implements the balancing algorithm. In turn, this paper relies on the design and algorithm used in the NXTway-GS by Yorihisa Yamamoto, which you can study for further detail.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
17 Comments  comments 
formats

Tutorial: Installing Gyro and Ultrasonic Sensor blocks in EV3 Home Edition

gyro-ultrasonic

You can use the Ultrasonic Sensor and the Gyro Sensor with the EV3 Home Edition Programming Software.

When you buy a LEGO MINDSTORMS EV3 Set, you can choose between the LEGO MINDSTORMS EV3 Home Edition and the EV3 Education Core Set (learn more about the differences here). The selection of sensors you get with each kit is slightly different. For example, the Home Edition set includes an Infrared Sensor and an Infrared Beacon, while the Education Core set comes with an Ultrasonic Sensor and a Gyroscopic sensor.

The EV3 brick in both sets is the same, making it possible to use any of these sensors regardless of which base set you have. However, the free LEGO MINDSTORMS EV3 Home Edition software does not come with programming blocks to control the Ultrasonic Sensor and the Gyroscopic sensor by default. Fortunately, LEGO offers these blocks as a free download from their website. These steps demonstrate how you can install these programming blocks in order to add full support for all your sensors.

In this example, I’ll demonstrate how you can install the Gyro Sensor block. Repeat the procedure to install additional Sensor blocks, such as the Ultrasonic Sensor block, the Temperature Sensor block, and the Sound Sensor block. You can follow the same steps to install blocks from third party sensor manufacturers, such as HiTechnic, Mindsensors, and Dexter Industries.

(more…)

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 
formats

Tutorial: Building BALANC3R

Published on June 23, 2014 by in EV3 Building

BALANC3R_small

This tutorial provides step-by-step instructions to build BALANC3R, a self-balancing LEGO MINDSTORMS EV3 robot.

Requirements

LEGO MINDSTORMS EV3 Home Edition

1x LEGO MINDSTORMS EV3 Home Edition

  • 1x Gyroscopic Sensor. Use one of the following sensors:
  • Both sensors work great in this project, but here are some considerations before you buy:
    • The EV3 Gyro is cheaper. It can measure the angular rate and estimate the accumulated angle. The accumulated angle is not used in this project, but it may be helpful for other projects, such as making accurate turns.
    • The HiTechnic Gyro is more accurate for this application because of the increased resolution. It can only measure angular rate.
LEGO MINDSTORMS EV3 Gyroscope

1x LEGO MINDSTORMS EV3 Gyroscope

Building Steps

Build the robot by following the steps in order. Click on the pictures for a bigger image. Be sure to connect the motors and sensors to appropriate port on the EV3 brick as indicated by the port icons.

BALANC3R_01

(more…)

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
2 Comments  comments 
formats

EV3 Robot Takes Selfie: Caught Red-Handed

Published on June 16, 2014 by in Programming

ev3-selfie

LAVA R3X is a pretty busy robot. He got himself featured on the front cover of a book that just got published, and now he’s taking the spotlight to show that robots are keeping up with the times too

I caught him red-handed taking a selfie with a rare, framed EV3 box signed by the LEGO MINDSTORMS EV3 design team. I don’t blame him though — not many robots get the chance to take that picture!selfie_action

LAVA R3X took the picture all by itself using a Logitech C270 USB webcam. Both the webcam and a Netgear WNA 1100 Wifi Dongle are connected to the brick via a USB hub, which is just visible under the robot’s right arm. With ev3dev, this setup worked right out of the box. (Anyone need more reasons to see why ev3dev is cool?)

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
4 Comments  comments 
formats

EV3 & Linux

Published on June 12, 2014 by in Programming

One of the great things about the EV3 is that it is actually a very powerful computer. The graphical programming language developed by LEGO and National Instruments is excellent to get started with programming, but the EV3 can do much more. In fact, The LEGO Group encourages the community to unleash the full potential of the EV3 system by releasing the firmware source code and hardware schematics. Several community based projects such as LeJos are already starting to take shape. Another project that recently got my attention is ev3dev.

The ev3dev project is still under heavy development, and a lot of features and functionalities of the EV3 brick are still being implemented. I don’t think it’s quite ready for the beginning programmer at the moment, but it certainly looks promising. I’ll likely blog more about this project in the future. Meanwhile, check out their wiki.

The video above is a demonstration of a basic obstacle-avoidance Python program I created for the EXPLOR3R robot. With this setup, it is possible to write the program directly in a browser, which means that you can even program the EV3 from a tablet. Check out the source code here. In the rest of this post, I’ll give an overview of some of the essential components at work here. Note that this isn’t a tutorial, but rather some background information for those who are just getting started exploring all the possibilities of the EV3.

Much of it actually comes down to learning to play with Linux. (We’ll get to what Linux is in a moment.) I didn’t know anything about Linux until about one and a half years ago, when I started working on a university project for which I used the Beaglebone controller. As it turned out, it was a lot of fun to learn how to work with Linux, and it was actually not hard at all. On the other hand, once you master some basic skills, the possibilities are endless.

As with many technical topics, it can be difficult to get started if you’re completely new to the subject and its terminology. This post won’t cover all the basics, but my aim is to provide a starting point for further reading and discovery.

(more…)

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
3 Comments  comments 
formats

EV3 Discovery Book now in stock on Amazon

formulaev3

The LEGO MINDSTORMS EV3 Discovery Book is now in stock on Amazon! You can now also check out pictures of some of the robots, including the SNATCH3R, the Formula EV3 race car, and ANTY. Which robot will you build first?

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
19 Comments  comments 
formats

Hot off the press: the first copy!

Published on June 3, 2014 by in Writing

No Starch Press sent me a few pictures of the first copy from the printer. Everything is looking great, which means that the books should be on their way to your doorstep soon, and online retailers such as Amazon should have it in stock soon within a few weeks. Be sure to leave a comment when your pre-ordered copy arrives!

EV3Discovery_front

EV3Discovery_building

EV3Discovery_programming

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
14 Comments  comments 
formats

Coming Soon: The LEGO MINDSTORMS EV3 Discovery Book

Published on May 2, 2014 by in EV3 News, Writing

After many months of hard work, I’m excited to announce that The LEGO MINDSTORMS EV3 Discovery Book will soon be released. I’ve been working on this project in silence since 2012 using the very first EV3 prototypes, and I’ve been building, programming, and writing ever since. The fine folks at No Starch Press have been working with me for the past few months to turn the manuscript into a fantastic book. Over the course of the next few weeks, I’ll be posting more information and excerpts so you can see what you’ll find in the book.

EV3DB_front_web_high

This new edition is much more extensive and detailed than the NXT 2.0 Discovery Book released in 2010. My favorite new topics include complete coverage of how to use each of the sensors effectively, how to create My Blocks with inputs and outputs, and how to use LEGO Technic elements and gears. (After studying mechanical engineering for 3 years, I just couldn’t get away not covering gearing principles in this book.) Perhaps the most noticeable change is that this edition is printed in full color. Not only does this make the building instructions easier to follow than before, but it also helps getting many of the programming concepts across clearly.

The book should be available in fine US book stores and online retailers such as Amazon from June. You can also get a copy of the book with a complementary ebook directly from the publisher (Use coupon code DISCOVER to get 30% discount). Several translations are on the way as well. Stay tuned for more news on those.

EV3DB_back_web_veryhigh

From the back cover:

LEGO MINDSTORMS has changed the way we think about robotics by making it possible for anyone to build real, working robots. The latest MINDSTORMS set, EV3, is more powerful than ever, and The LEGO MINDSTORMS EV3 Discovery Book is the complete, beginner-friendly guide you need to get started.

Begin with the basics as you build and program a simple robot to experiment with motors, sensors, and EV3 programming. Then you’ll move on to a series of increasingly sophisticated robots that will show you how to work with advanced programming techniques like data wires, variables, and custom-made programming blocks. You’ll also learn essential building techniques like how to use beams, gears, and connector blocks effectively in your own designs.
Master the possibilities of the EV3 set as you build and program:

  • The EXPLOR3R, a wheeled vehicle that uses sensors to navigate around a room and follow lines
  • The FORMULA EV3 RACE CAR, a streamlined remote-controlled race car
  • ANTY, a six-legged walking creature that adapts its behavior to its surroundings
  • SK3TCHBOT, a robot that lets you play games on the EV3 screen
  • The SNATCH3R, a robotic arm that can autonomously find, grab, lift, and move the infrared beacon
  • LAVA R3X, a humanoid robot that walks and talks

More than 150 building and programming challenges throughout encourage you to think creatively and apply what you’ve learned to invent your own robots. With The LEGO MINDSTORMS EV3 Discovery Book as your guide, you’ll be building your own out-of-this-world creations in no time!

Requirements: One LEGO MINDSTORMS EV3 set (LEGO SET #31313)

Can’t wait for the book? Are you curious about the robots? What kind of samples and excerpts would you like to see?  Let me know in the comments below.

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
25 Comments  comments 
formats

Solve a Rubik’s Cube with just one EV3 set

David Gilday has published detailed building and programming instructions for a Rubik’s Cube solving robot that you can create with a single LEGO MINDSTORMS EV3 set. You can find the instructions for MindCub3r (here).

You’ll have to go through quite a few steps to make it work, but it’s probably still a lot easier than solving the cube on your own! BManCan1 has already followed these steps and he created this video:

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
41 Comments  comments