MX3cK Servo Line Following Robotic Development Kit ...

16
MX3cK Servo Line Following Robotic Development Kit Reference Manual Revision: April 24, 2012 1300 NE Henley Court, Suite 3 Pullman, WA 99163 (509) 334 6306 Voice | (509) 334 6300 Fax Doc: XXX-YYY page 1 of 16 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. Overview The Digilent Robotic Development Kit with the Cerebot MX3cK with a Servo Robotic Kit (SRK) is an ideal platform for robotic applications. It is rugged and easily assembled by all skill levels. The Cerebot MX3cK can be programmed with either MPIDE or MPLAB. In this document the MX3cK, SRK and the addition of the Line following expansion kit will be used together to create a basic line following robot. The line following robot kit includes the following parts: Cerebot MX3cK Battery Holder (4xAA) 2” Velcro Strip (for battery holder) (2) Pmod Brackets Metal Platform with Holes on ½-inch Center Metal Line Sensor Mounting Platform (4) IRROSC (Infrared sensors) with Connectors 4” Velcro mounting strip (2) Continuous Rotation GWS Servos (2) Servo Brackets with Mounting Hardware Rugged Splined Hub Plastic Wheels with Traction Bands Tail Skid Stand-offs for Mounting MX3cK PmodLS1 PmodCON3 (2) 6” 6-pin Pmod Cables (4) 8/32 Machine Screws, Machine Nuts and washers MX3ck Power Cable Functional Description The rugged steel components have holes on ½-inch centers allowing Digilent circuit boards and other vendors’ products to be easily attached. The following tools are recommended for robot assembly: regular and small Phillips head screwdrivers pliers

Transcript of MX3cK Servo Line Following Robotic Development Kit ...

MX3cK Servo Line Following

Robotic Development Kit

Reference Manual

Revision: April 24, 2012 1300 NE Henley Court, Suite 3 Pullman, WA 99163

(509) 334 6306 Voice | (509) 334 6300 Fax

Doc: XXX-YYY page 1 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Overview The Digilent Robotic Development Kit with the Cerebot MX3cK with a Servo Robotic Kit (SRK) is an ideal platform for robotic applications. It is rugged and easily assembled by all skill levels. The Cerebot MX3cK can be programmed with either MPIDE or MPLAB. In this document the MX3cK, SRK and the addition of the Line following expansion kit will be used together to create a basic line following robot. The line following robot kit includes the following parts:

• Cerebot MX3cK • Battery Holder (4xAA) • 2” Velcro Strip (for battery holder) • (2) Pmod Brackets • Metal Platform with Holes on ½-inch Center • Metal Line Sensor Mounting Platform • (4) IRROSC (Infrared sensors) with Connectors • 4” Velcro mounting strip • (2) Continuous Rotation GWS Servos • (2) Servo Brackets with Mounting Hardware • Rugged Splined Hub Plastic Wheels with Traction Bands • Tail Skid • Stand-offs for Mounting MX3cK • PmodLS1 • PmodCON3 • (2) 6” 6-pin Pmod Cables • (4) 8/32 Machine Screws, Machine Nuts and washers • MX3ck Power Cable •

Functional Description The rugged steel components have holes on ½-inch centers allowing Digilent circuit boards and other vendors’ products to be easily attached. The following tools are recommended for robot assembly:

• regular and small Phillips head screwdrivers

• pliers

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 2 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Example Assembly The following assembly document is a combination of the SRK basic kit with the addition of the line following sensors and mounting:

1. Attach the two servo brackets to the main plate using 4 screws and nuts for each side from the hardware included with the servo mounts.

2. Attach the rear tail skid using two 8/32 screws and nuts as shown in the picture below.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 3 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

3. Add the standoffs to the robotic kit as shown below set the extra 4 screws aside to mount the MX3cK in a later step:

4. Attach the two Pmod clips with included hardware in the Pmod clip bags.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 4 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

5. Locate a location on the bottom side of main plate where the battery holder will have clearance from the other mounts. Then peel one side of the 2” Velcro and stick it to the main plate centered in your location.

6. First remove the white servo wheels that are included on the servo from the factory. This can

be done by unscrewing the black screw from the center of the white wheel and set them aside for the next step. Then mount the servos in the servo mounts using the remaining hardware that was included with the servo mounts you should have four nuts and bolts per servo. The servos can be set into the mount from the backside where the short lip side of the bracket is considered the back. Mount the servos with the white servo splined shaft toward the center of the tail skid.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 5 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

7. Before you attach the wheels you will need to put the rubber traction bands on the wheels. It is simply a matter of stretching the rubber band over the outside the wheel. Then place the wheel on top of the servo hub and rotate until the splines in the wheel and the hub line up once this is done you can then press the wheel down and screw the wheel in with the black screws removed from the previous step.

8. Attach the MX3cK to the previous mounted standoffs with the remaining four screws.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 6 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

9. Using the Metal Line Sensor Mount attach the hook side (the non-fuzzy side) of the 4” Velcro strip on the lower edge of the plate. Then attach the line sensor mount to the robot kit using the last two 8/32 screws and nuts as well as two 8/32 washers to the front of the robotic platform.

10. Cut four ½-inch sections of loop piece of Velcro from the other half of the 4-inch strip. Attach these ½-inch strips to each of the four IROS sensors.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 7 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

11. Connect the PmodLS1 using the 6” Pmod cable and pass through 6-pin header. Where the white maker on the cable ends connects to pin 1 on the PmodLS1 and pin 1 on the JE Pmod header on the MX3cK. Using the 6-pin pass through connector on the MX3cK side of the cable connect the white pin 1 marker on the cable to pin 1on the MX3cK, located on the top row and the furthest away from the barrel power jack. If correctly connected the pin 1 white maker on the MX3cK end of the cable will be face down when connected to the board. Then press the PmodLS1 into the nearest Pmod clip.

12. Attach the four IROS (Infrared sensors) from step 10 to the bent bracket from left to right using the attached Velcro. Then connect the sensors from right to left to the S1-S4 ports on the PmodLS1.Where the furthest right sensor goes to S1 on the PmodLS1 connector the label of the ports on the PmodLS1 the port label is listed below the port pins on the edge opposite of the Pmod cable connector. The orientation of the four wires from the sensors for each of the S ports is: white wire connects to the pin closets to the Pmod cable see the picture below and to the right then the blue wire, green wire then finally the red wire will be closest to the S port label at the end of the board. The third picture below shows the finished connections of the sensors to the PmodLS1.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 8 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

13. Using the second 6” Pmod cable included in the kit connect the PmodCON3 to the JC Pmod header. The P1 pin on the PmodCON3 has the white pin 1 maker on the cable connected to it. The other end of the cable has a white pin 1 maker as well. This end of the cable needs the included 6 pin pass through connector connected to it and then plugged into the lower half of the MX3ck JC connector. Pin 1 on the JC connector is the furthest toward the I2C label and 8 pin header sticking vertically out of the board. When the cable is plugged in correctly between the MX3cK the PmodCON3 one of the white pin 1 markers will be facing up and the other end will have the marker facing down similar to step 11. Once that is done press the PmodCON3 into the remaining Pmod clip.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 9 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

14. The next step is to connect the two drive servos to the PmodCON3. The left servo (the IR

sensors are considered the front of the robot) is connected to port J5 and the right is connected to J4. The labels of the ports on the PmodCON3 are shown opposite the Pmod cable connection. There are three wires that come from the servo a white, red and black the white wire is the “sig” wire and should be plugged into the Pmod port pin labeled SIG this would be the vertical pin closest to the Pmod cable connector from the previous step. The two pictures below show the correct orientation of the wires in their respective port on the PmodCON3.

15. Now to finalize the mounting of the battery holder on the underside of the robot. Previously we

placed the 2” strip of Velcro to a location where the battery holder will be clear of obstructions. Now it’s time to remove the remaining Velcro adhesive backing and place the battery holder in place.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 10 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

16. Once the battery holders are stuck in place it is time to connect the MX3cK power cable to the

robot. The first step is to plug the barrel connector on the cable into the MX3cK power jack. Then take the 2-pin pass through connector and plug it into the battery 2-pin socket. Next align the red wire from the battery connector to the red wire 2-pin connector on the battery cable and plug them so that the red and black wires on both sides of the connector are connected to the same color on the other side of the connector (see picture on the left below). Do not put the batteries in until the end of assymbly.

The next step is take the remaining red and black wires with exposed ends on the MX3cK power cable and connect them to the PmodCON3 screw terminal. The terminal has to screw terminations. In the picture shown below you can see the little “+” symbol to the lower left of the right screw terminal this is the positive polarity terminal of the power supply. The red wire needs to be screwed in on this side. As you can see from the picture you need to connect the exposed end of the red wire (ensuring there are no small stray wires outside of the connection) needs to be screwed into this terminal. The black wire needs to be screwed into the left side ensuring there are no stray wires exposed here as well.

17. You have now completed the construction of the line following robot and you should have a robot that looks similar to the one below:

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 11 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Software Tutorial using MPIDE

The last step in getting your line following robot up and running is to program your MX3cK microcontroller board. The MX3ck can be used with either MPLAB (with an additional programming module) or the MPIDE development environment. The remaining portion of this document will show you how to program your MX3ck with the reference design using the MPIDE (Multi-Platform Integrated Development Environment) that is freely available from the following link: https://github.com/chipKIT32/chipKIT32-MAX/downloads.

The first step is to download the MPIDE from the above link selecting the version made

for your OS. MPIDE will run on Windows, MAC and linux 32-bit. Once you have downloaded and extracted files then you will need the appropriate software code often referred to as source code for the demo project. In MPIDE the source code for a specific project is called a sketch and you will need to down load the RDKcK_line_Demo.pde sketch from the (INSERT digilent website page name here).

Once you have the MPIDE and sketch on your computer the next step is to open the MPIDE by finding and launching the MPIDE launcher application shown in the picture below:

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 12 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Once the application has been launched you should have the MPIDE application

displayed on your desktop. Below I have a picture of the home screen for MPIDE as well as the descriptions of the functions for the displayed buttons was well as the indication of the currently selected microcontroller board.

At this point plug the usb A to mini B into the MX3cK board. The robot is ready to

programmed after the following configuration steps are completed. The first step in getting the demo code working is to tell MPIDE the correct

microcontroller board and the correct path to communicate with the board. This is done by using the tools menu located just below the window title bar. Clicking on Tools will then present a dropdown menu that will give you the options to change the board and communication ports from all boards and ports that are available to MPIDE.

MPIDE does not know what communication port to use so you will have to select this value. To ensure that you have the correct communications port settings you will have to locate the proper COM port for the board from your operating system in this case I am using windows so I will use the device manger to locate this port.

Below is the device manger from my computer you can see all the com ports that are available the MX3cK microcontroller board will show up as a USB Serial Port in my case listed as (COM11). If your computer shows more than one USB Serial Port then you may have to disconnect other devices from the computer until only one remains or you can use the trial and error method until the communication goes through I will discuss this method later in the tutorial.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 13 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Now that you have the com port number you can tell MPIDE this information. Navigate back to the MPIDE application and select the Tools menu. The dropdown menu will open, select the serial port option. This will pop up a selection menu that will match the ports listed in your device manger. Now select the com port that you found in the previous step, select it and now it should show a check mark next to it.

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 14 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

Now MPIDE knows how to communicate with the board but it doesn’t know which board that you are using. To change this you return the Tools menu and this time we select the Board option from the dropdown menu. In this menu there will be a list of all the supported boards you will need to select the Cerebot MX3cK from the list. Once you select this board the menu will disappear but it will update the current board selection on the home screen.

At this point MPIDE knows which board you are using as well as how to communicate with the board. The next step is to open the line following demo sketch that you downloaded at the beginning of this software tutorial. You can do this by using the open button and selecting the first option in the dropdown menu and then navigating to the location you saved the previous downloaded RDKcK_line_Demo.pde file. Once it is open you may get a popup screen that states “The file “RDKcK_Line_Demo.pde” needs to be inside a sketch folder named “RDKcK_Line_Demo”. Create

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 15 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

this folder, move the file, and continue?” select ok. A new window should pop up similar to the home screen with the sketch shown.

Finely you should have a screen that looks as follows:

Line Sensor Robotic Development Kit Reference Manual

www.digilentinc.com page 16 of 16

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

If you would like to know more about how the code works then see the following document located on the Digilent website (insert link here). Now the last step is to program the board with the sketch. Select the verify and program button below the tool bar. MPIDE will begin to compile the source code and you will see some text pop-up in the black box on the lower half of the screen.

You should see the Binary sketch size: 8468 bytes (of a 126976 byte maximum) listed in the bottom of the screen in the black box. If you see something other than that you may have to trouble shoot the program, I would suggest downloading the sketch again and restart the above process before trouble shooting the code itself. If you did get the Binary sketch size statement and the status line states done uploading your line following robot is ready to follow lines.