background image

Copyright © Parallax Inc.  

Penguin Robot (#27313-27316) 

v1.4  2/16/2010  Page 19 of 23 

3.4. EXAMPLE PROGRAMS 

Download the following test programs from the Penguin product page at www.parallax.com and test that 

each Penguin subsystem is working properly.  Complete code listings are also included in this document.  

 

y

 

Penguin-CenterServos.bpx, page 6 

y

 

Penguin-SpeakerTest.bpx, page 20 

y

 

Penguin-IRTest.bpx, page 21 

y

 

Penguin-7SegmentLEDTest-v1.3.bpx, page 21 

y

 

Penguin-PhotoresistorTest.bpx, page 20 

y

 

Penguin-CompassTest.bpx, page 22 

 

Once you are familiar with the I/O capabilities of the Penguin, the following programs can be used to 
demonstrate all of the Penguin’s abilities. Download from the Penguin product page at www.parallax.com.

 

 

 

y

 

Penguin-AutonomousNavigation.bpx 

y

 

Penguin-MigrateNorth.bpx 

 

3.5. OPTIONAL COMPASS CALIBRATION 

To improve the accuracy of the compass, the calibration routines for the Hitachi HM55B Compass Module 

have been ported to the Penguin.  With the calibrated compass routines added to the Penguin's control 
code, extra RAM and code space is required.  Separate versions of the following programs have been 

created to allow for either more available resources or a more accurate compass. 

 

Original Code 

Code Incorporating a Calibrated Compass 

Penguin-CompassTest.bpx

 

Penguin-CalibratedCompassTest.bpx

 

Penguin-AutonomousNavigation.bpx

 

Penguin-AutonomousNavigation-CalibratedCompass.bpx

 

Penguin-MigrateNorth.bpx

 

Penguin-MigrateNorth-CalibratedCompass.bpx

 

 

Before the calibrated compass routines can be used, Penguin-CompassCalibration.bpx must be run to 

record the compass calibration data.  For more information about compass calibration, please read the 

product documentation and the associated code available from the #29123 product page at  

www.parallax.com. 

3.6. OTHER HELPFUL DOCUMENTATION 

The following materials are helpful documents for programming the Penguin; each can be downloaded 
from its associated product page: 

 

y

 

BASIC Stamp PBASIC Syntax Guide (on-line version of help file installed with the BASIC Stamp 

Windows Editor) 

y

 

HM55B Compass Documentation (#29123) 

y

 

HM55B Graphical Viewer for the HM55B (#29123) 

y

 

Smart Sensors and Applications (a Stamps in Class Text) (#28029) 

y

 

IR Remote for the Boe-Bot Text (a Stamps in Class Text) (#70016) 

y

 

Ping))) Ultrasonic Sensor Documentation (#28014) 

 

Summary of Contents for Penguin

Page 1: ...ed together for this robot to walk This basic biped design functions best in the Penguin s small scale The Penguin mechanics have a close tolerance fit and are designed to provide precise electronic c...

Page 2: ...The Penguin s electronics are fully assembled and wired to an assortment of I O devices Additionally it has a fairly complex programming process which is more difficult to understand than a two wheele...

Page 3: ...5 2 56 threaded rod 2 5 long 2 710 00013 4 40 1 8 long 0 149 diameter stainless steel shoulder screw 4 710 00010 4 40 1 8 long 1 8 diameter stainless steel shoulder screw 4 710 00011 4 40 1 4 button s...

Page 4: ...Copyright Parallax Inc Penguin Robot 27313 27316 v1 4 2 16 2010 Page 4 of 23 1 5 BODY KIT MECHANICAL DRAWINGS...

Page 5: ...process includes several steps where you will be exposed to danger You will be using a sharp drill bit to enlarge a tiny hole and tiny pieces may fly You will be pressing ball joints together where a...

Page 6: ...ted Orientation may differ from picture shown c Plug two servos into the bottom of the power pack being careful to orient them correctly From the perspective of this photo the servo s white leads are...

Page 7: ...on the stride servo Locate the small black plastic stride linkage with two ball shaped ends This part has changed the style shown on the left is included in your kit The previous style is shown in al...

Page 8: ...est part of the ankle faces forward Shoulder screws have a 1 8 diameter smooth stainless steel surface upon which the legs will rock back and forth To install the leg assemblies on the Penguin use the...

Page 9: ...ach foot has an additional 2 56 threaded hole where the Penguin s ball joints mount for the threaded rod which connects to the tilt servo the ski poles These threaded holes denote the front of the foo...

Page 10: ...quent step Open the package and thread the 2 56 ball link post into the front of each foot You can tighten them using a 3 16 socket or small wrench Be careful not to scratch the feet as you tighten th...

Page 11: ...des an assortment of servo horns We ll use the widest servo horn in this step If you make a mistake it s okay because there s a second one in the other servo package Put on your safety goggles Place t...

Page 12: ...16 ball links on the servo horn Tighten carefully but don t deform the plastic Step 11 Attach the servo horn to the tilt servo Press the assembled servo horn onto the tilt servo positioning it cross w...

Page 13: ...ocket Future adjustments can be made quite easily by disconnecting the ball link socket from the feet only To disconnect them use a small screwdriver as a lever against the foot Cover the foot with a...

Page 14: ...board to the Penguin body The Penguin s top board contains the BASIC Stamp 2px24 circuitry It is mounted on the top of the Penguin using 2 2 56 1 4 button socket cap stainless steel screws and the 0...

Page 15: ...power pack board is installed using 4 2 56 long flathead screws and the 0 050 hex key When you mount this board be sure that the servo wires are not preventing it from properly seating into position P...

Page 16: ...ll be oriented in the same direction refer to the pictorial molded into the bottom of the battery holder s plastic surface Coil up the servo wires behind the robot It s also possible to hide them in t...

Page 17: ...to knife to remove any plastic burrs inside the plastic socket b Add a drop of oil into the socket c Reassemble the ball links and check for friction Legs move too much from left to right Pressing the...

Page 18: ...the Penguin can walk This is a crucial step and the Penguin will not walk without it 1 Run Penguin ServoCalibration bpx 2 Click in the white Transmit area at the top of the Debug Terminal 3 Press Ent...

Page 19: ...space is required Separate versions of the following programs have been created to allow for either more available resources or a more accurate compass Original Code Code Incorporating a Calibrated C...

Page 20: ...0 Freq Play the frequency Freq Freq Scale lower frequency by 1 octave NEXT Parallax Penguin Robot Penguin PhotoresistorTest bpx STAMP BS2px PBASIC 2 5 RLDRPin PIN 0 LLDRPin PIN 1 LeftLDR VAR Word Righ...

Page 21: ...2px PBASIC 2 5 Rev A boards use the OUTC port to control a 74LS47 BCD to 7 segment decoder LEDDisplay VAR OUTC The LED display mirrors OUTC Rev B boards use a 74HC595 shift register to individually se...

Page 22: ...ReadCompass DEBUG CRSRXY 9 0 DEC Heading PAUSE 150 LOOP ReadCompass Compass module subroutine HIGH Enable Send reset command to HM55B LOW Enable SHIFTOUT Compass Clock MSBFIRST Reset 4 HIGH Enable HM...

Page 23: ...ave approximately the same capacity as the more expensive ones and they re sold by Parallax at less than half the price of retail outlets Don t be fooled into paying high prices for CR123 batteries If...

Page 24: ......

Reviews: