LEGO Mindstorms ShooterBot: The Guide 2

Hello there,

It is time to start building some models on my own. Being fairly new to LEGO Technics and LEGO Mindstorms I couldn’t find a better way of learning than to create LEGO Mindstorms official models. So here we are.

IMG_8414

The Shooter is a tracked robot built using the Official LEGO Mindstorms 8547 Set and one of the most basic setup you can build. Anyway it is ideal for introducing yourself in Technic building and NTX-G coding.

Ads by Google

1st step: Clear the working area

I can’t stress this enough. You need to keep the working area as clear of things as possible or building any model gets harder and harder.

IMG_8370

Also it is a good idea to sort the bricks by colors and sizes before starting so you can save time looking for them. I bought three small boxes and IKEA that somewhat do the work ( by now ).

First robot: Shooterbot moves forward and back

IMG_8403

This is the base robot that we will use during the rest of the tutorial. So here it is a small stop-motion video of how I built it.

Ok, we are done with it.

NTX-G Shooterbot Move forward program

It is a fairly easy program with just two blocks, one to make the bot move forward and another one to make it move backward to the original position.

moveforwardandback

Just make sure you set the right amount of rotations on both blocks and that the second block has the reverse direction.

moveforwardandback-motordetail

You shouldn’t have any major problems on this one and the “impressive” result is this.

LEGO Mindstorms NXT file: Download

Problems and bugs

Problem: NXT Brick not found

That’s an easy one.
1) Make sure it is turned On. Press the orange button of your NXT Brick and it will turn on with a distintive noise sound.
2) Make sure the USB Cable is connected to both the NXT Brick and your computer.

Problem: Shooterbot doesn’t move

1) Did you send the program to the NXT Brick? Yes? So Click on and click again to run it.
2) Did you plugged correctly the cable between NXT Bricks and Motors? Check that the are firmly plugged on ports B and C.

Problem: Shooterbot doesn’t move in a straight line

1) Maybe you plugged any of the motors on port A?
2) Make sure you got the Move block and not the Motor block.

Second bot: ShooterBot finds the red line and return

IMG_8432

In this bot we need to add the Color Sensor so that the robot can see the red line. You need to use the Test area that comes with the set for this bot. It is really important that the color sensor is pointing to the ground and close to it or it won’t read correctly the color. I have had a few headaches with this problem on the Color Sorter bot.

NXT-G Find the red line and return Program

This program is a bit more tricky than the LEGO tutorial says. If you see instruction they just make the bot move forward until red line is found and then they rotate it 180º and move back 2 rotations. That’s simple and nice but it is not correct. What if the robot started 5 rotations away?

Worry no more! Here I am to the rescue. In this program with are going to use the rotation sensor so we can know how far we travelled so we can return to the same exact position.

findthelineandreturn

I use a Number variable called turnedDeegres to store the amount of degrees motor B has done. It doesn’t mind if you use Motor B or C because both of them moves the same amount of degrees when moving forward in straight line.

LEGO Mindstorms NXT file: Download

So this is the result.

Problems and bugs

Problem: ShooterBot doesn’t see the red line

1) Make sure the Color Sensor is plugged! I have this problem myself… quite stupid mistake… and quite common.
2) Make sure there isn’t too much light on the room.

Problem: ShooterBot doesn’t return home

I had lots of fun with this one. Documentation on NXT-G says that the Motor Block output the amount of degrees or rotations that the motor has done since the program begin. NO. It doesn’t.
You need to use the Rotation Sensor to get that information.

Problem: ShooterBot doesn’t turn 180º

ShooterBot fire color balls

IMG_8458

There we are! There we are! We almost have a complete guardian right now. This new step involves removing the Color Sensor and placing it on the top of the bot, where it will be a hugely expensive LED light. On the frontal part of the bot we will build the balls storage and connect the Motor responsible of moving it to Port A.

The mechanism is quite tricky one and I love it. You do one rotation of Motor A and the axle that is fixed to the bot chassis will press itself against the balls holder so hard that the lowest ball will be fired from it quite fast. You have to see it to believe.

NXT-G Shoot and Patrol

This is a simple program and it is the first one that adds a Loop. LEGO solution suggests using an unlimited loop but as you will eventually run out of balls, it is better to loop just as many times as ball your bot has ( Seven, in case you were wondering about it ).

moveandshoot

LEGO Mindstorms NXT file: Download

And this is the result ( Don’t do this at home or expect to spend a few hours looking for the balls! )

Keep tuned for the last part of this guide where ShooterBot will patrol and shoot balls to intruders. Have any question? Just ask.

Best regards,
Miguel

2 thoughts on “LEGO Mindstorms ShooterBot: The Guide

  1. Pingback: Robogator: Your Fearless LEGO Mindstorms Guardian | The Technic Gear

  2. Pingback: Mindstorms EV3 Color Sorter MOC ← LEGO Reviews & Videos

Leave a Reply