Wednesday, June 2, 2021

Parallax Penguin Robot Superhero




Make a Superhero Out of your Parallax Penguin Robot
Software can enhance your bot beyond your wildest dreams!
by Humanoido

Imagine, a Parallax Penguin robot built from a kit of parts flying high with seven new superpowers made by programming it repertoire of powerful built-in hardware gadgets.

A superhero is a person gifted with extraordinary abilities and power, superhuman strength and a desire to use such powers to represent good, help people and even save the world. Meet little Penguin—a tiny robot barely 4 inches tall. It would take some stretch of the imagination to think he could help save the world or have any superpowers! After writing hundreds of Penguin programs, I decided to create a robotic superhero using the software approach. Exactly how does some-thing so little and cute meet the substantial criteria of the league of superheroes? How can he help you?—even save you under certain conditions?


PENGUIN SPECS
MICROPROCESSOR: Powerful Turbo Speed Basic Stamp BS2px24 module chipset, ~19,000 instructions/sec., Voltage Comparator, Schmidt Trigger, Configurable Pull Up Resistor, I/O Pin Logic Threshold Circuitry, for timing, artificial intelligence, sleeping, calculating
PBASIC 2.5 LANGUAGE: 63 commands.
EEPROM: 8x2K Bytes program memory ~4,000 instructions,
program, memory, data logging
COMPASS: Hitachi HM55B Digital Compass sensor, sense direction
ROBOTICS CHASSIS: CNC-machined 6061 aluminum parts and robotics chassis available in black, red, blue and aluminum, conductive aluminum parts.
INFRARED RECEIVER: Object detection, remote control. INFRARED LIGHT TRANSMITTER: Two infrared LED emitters,
left and right, in combination with IR receiver for object detection.
PHOTORESISTORS: Two CaS light-detector cells, left and right, light-following and avoidance, vision, detection, input.
DISPLAY: Blue, seven-segment LED, feedback, transmitting light, message, indicator, menu.
MOTORS: Two microservos, tilt and stride, biped walking design, motion such as dancing, skating, walking, running, aerobics, martial arts, soccer.
SOUND: Speaker Piezoelectric speaker, sound, music, language, alarm.
POWER SWITCH: On/off for robot.
RESET SWITCH: Reset Basic Stamp, pushbutton function key.
USB PROGRAMMING PORT: FTDI 232RL mini USB programming port.
POWER SOURCE: Two CR123 batteries for 6V power supply. LED: Blue LED power indicator.
EXPANSION PORT: 3-Pin I/O expansion port AUX5, for Ping))) ultrasonic sensor, Parallax RF modules, hardware add-ons.
SENSORS: Ultrasonic Unit PING))). For ultrasonic vision, night vision, range finding, detection; cadmium-sulfide light sensor; IR receiver.


The plan is to make our Penguin robot rely heavily on new DIY-created PBASIC software and its own repertoire of state-of-the-art gadgets already built into its microcontroller boards. We’ll examine these modern gadgets one at a time and look toward mining their potential.

To begin, we need to know exactly what Penguin has that can be programmed. Most superheroes have more than one power. Superman can fly and he has X-ray vision, super speed and breath, invincibility and superhuman strength. Batman has martial arts expertise, a superior understanding of science and the ability to do acrobatics. Iron Man has his powerful suit of invincibility and weaponry and he can fly. Let’s decide to create more than one power for Penguin. A typical robot may walk, avoid obstacles, beep and have light or line following capability. Still, it isn’t obvious that any of this would qualify for superhero stature. We’ll need to think of other ideas to empower Penguin.

PENGUIN ATTRIBUTES & GADGETS
Let’s look at each Penguin Robot attribute, gadget and feature and then think about programming and what can be used for creating superpowers. Every attribute can potentially become a power. Some of the general categories that can be programmed: sound, music, alarm, vision, distance, touch, light, infrared, ultrasonic, time, direction, memory, motion and behavior.

THE SEVEN SUPERPOWERS
After reviewing Penguin’s attributes and onboard gadgets, let’s create these seven superpowers:

1. Storm power.
You’re outside and a storm is approaching. Suddenly, there’s a flash of lightning. A few seconds later, you hear thunder. Press the reset button! Penguin has the power to report the storm distance on the display in miles. This may potentially save your life in the event of a tornado, hurricane, typhoon, or category storm, letting you know whether the storm is approaching or moving away, giving advanced warning and time to seek a safe shelter.

2. Direction power. You’re in the deep woods on a camping trip and hiking and you get lost. Maybe you have food and water for only a couple days. The sky is overcast, so stars and the sun aren’t visible; just trees and mountains. Penguin robot will save you! He will track and report directions of north, south, east and west, and you’ll find your way back to civilization!

3. Time power.
The power of this time is amazing. Focus your energy, mind and body into Penguin’s precise power minute! One minute of exercise. One minute of deep breathing. One minute of meditation and relaxation. One minute of rest. One minute of concentration. Generate Chi energy. Mind train. Create life focus. Improve health. Organize yourself. Time Power: one minute a day, or one minute throughout the day can change your life.

4. Sleep power.
You cannot sleep at night, but you must report to work the next day. If you don’t sleep, you could lose life or limb by being drowsy when working with heavy machinery, driving in busy traffic or even crossing the street at a busy intersection. Never fear, Penguin is here with the magical power of inducing sleep.

5. Light power.
The ability to send a rescue message using light waves: SOS in light code! You’re on an outing, camping and exploring with friends and night approaches; in the darkness you get separated from your party. Use the power of light to send a repeating traceable message in the dark that your friends can see, follow and find you. Utilizing full candelabra output from the blue LED segment display output device, lighting as many segments simultaneously as possible, signals of light can be sent across space and time.

6. Night power.
You’re inside the house and the electricity goes off at night, or you’re outside walking at night and it’s pitch dark. You need to find your way, and there are hidden dangerous obstacles directly in your path. Penguin will use the power of ultrasonic night vision to see in total darkness and alert you to dangerous objects out to a distance of 9 feet; you’ll be saved from potential pain, injury and doctor bills!

7. Life power.
Many people dream about life extension and longevity! It’s known that exercise is a key to better health and maintains a good conditioning that leads to a longer life. In a simple, but healthful, aerobic workout with you, Penguin will “pedometer” the lead for life extension. Can you keep up with this tiny but relentless Zen master?


WRITING PBASIC CODE
With our seven ideas, we have eight programs to write. The eighth program will be a menu driven by the number of presses on the main board reset key. This is the Master Power Portal (MPP)—a unique addition to code that tells the reset button to act like a multiple function key so any given superpower can be selected. Press the MPP, and this programming trick will reset the basic stamp, read the number of reset presses that were stored in memory and initiate that superpower’s code subroutine. Each power is written in PBASIC language—a form of BASIC that incorporates microcontroller functions. Good programming practice uses comments generously. Remember to review the detailed comments within the code.

COMBINING CODE TO CREATE A MASTER SUPERHERO PROGRAM
The challenge is to combine all eight programs into one Master Superhero program that contains all the superpowers of each individual program, convert the powers into subroutines and create a menu-selectable master power portal with the reset function key. One way to make this successful and fit into finite memory is by using shared variables—words, bytes and nibbles. Using this programming technique, the program size went from “not fitting into a memory page,” to fitting into memory with nearly 50 percent free space. It’s good to know free space is available for more add-on functions or to expand existing ones.

CODE OVERVIEW
1. Storm—display, time
2. Direction—display, compass
3. Time—display, time, sound
4. Sleep—sound, virtual reality (vr)
5. Light—display, time
6. Night—display, sound, ultrasonics
7. Life—display, sound, time, motion, vr

Subroutines using the speaker include Time, Sleep, Night and Life. Life uses motion. Sleep and Life use Virtual Reality. Time is the only code not in a continuous loop. Timing is important to Storm, Time, Light and Life. The number of reset button presses to activate each superpower is the same as the numbered listings (Storm is one button press, Life 7).

Meet the first twelve Penguin Robot Superheroes. Posing for the camera, they make up the Superhero League of Penguin Robots, with seven superpowers – Night, Storm, Direction, Time, Sleep, Light, and Life. All software can be downloaded free - see links & software at the end of this article.

CALIBRATION
For proper functioning, calibrate the life servos using penguin_automatic_servo_calibrator, calibrate the direction compass using Penguin-CompassCalibration, and calibrate light-sensitive CaS cells according to the comments in the storm power program. Other power code can be tweaked as needed.

OPERATING THE SUPER CODE MENU
Once the master super code has been loaded, select each superpower by pressing the master power portal key a specific number of times. Storm is the default power. The MPP can be used to interrupt any of the seven powers and begin a new one.

HOW TO USE EACH SUPERPOWER
Connect the USB cable from the robot to the computer, switch on the power switch, wait a few moments for the computer to find the USB device, run the Basic Stamp Editor, and load the Superhero program and run it. Face the robot’s front when reading the display. The display will cycle to previous stored storm miles value, display it and switch off. This will show zero the first time.

To run Storm Power, press the MPP once. In the dark, point Penguin Robot towards the direction of brightest lightning using the left CdS cell as a reference. If you move the robot from a bright room to outside or a dark window, you may wish to cover the sensors with your hand to prevent the program tripping from room light. Now wait for a bright flash of lightning. When you hear the following thunder, immediately press the MPP. The display will show the distance to the storm in miles. The display is only one-digit capable, but it must show up to two digits and a decimal point.

To accomplish this, a virtual display screen is created. It shows each of the individual numerals and decimal point, one at a time, according to timing. Because the segment display is efficiently routed through the SN74LS47NSR BCD-to-Seven-Segment Decoder/Driver IC chip to reduce Basic Stamp port usage, the dot is nonfunctional, and a graphic is used for the decimal point.

Storm Power uses an interesting decimal point. If the mile has a decimal, the decimal point will be shown as a graphics character, with a programmed code value of 10. Now press the MPP button twice to call Direction Power into action. Note the display. It may or may not show a graphic. If it shows a graphic, our superhero will be facing one of the four directions, north, south, east, or west. While maintaining level, slowly turn Penguin around its center and as each direction is faced, its corresponding graphic character will display. Between directions, for example, north and east, the display will blank. This allows a more precise focus on any one direction. A complete breakdown of these directional graphics can be found with the download notes and illustrations. Press the MPP button again, three times, to call up Time Power. A beep begins the process and is followed by a zero digit that starts counting one minute. The one-digit displays counts to 60 seconds starting at 0 ending at 60. It uses the one-digit display and shows only one-digit numbers, one at a time. For the exact details, refer to the One Minute Equivalency Table.

Press the MPP button 4 times to call up Sleep Power. Immediately, the speaker will produce a random form of repeating white noise with sound-masking capabilities. Use carefully! Press the button 5 times for light power: the display will light all 7 segments, resulting in maximum light output power and a continuously flashing SOS message.

PARALLAX PING)))
Engage the button 6 times, making sure the Parallax Ultrasonic Ping))) sensor is already plugged into the expansion port to enable the power of night. It could also be called the power of ultrasonic night vision that can see using high-frequency sound. There is no harm if night power is engaged without the ultrasonic detector; the display and sound will default to 0.

An immediate repeating tone will sound based on night vision’s distance to the object directly in front. The tone will rise or fall, as the distance decreases or increases. The tone will change at each 1-foot distance increment or decrement. Designed for total darkness, the power also functions in the daytime. As added power, the display will show the distance in feet with numbers up to 9 feet and graphics thereafter (see Download Notes). Press the MPP button 7 times to effect the power of life. A miniature VR sound/display pedometer begins counting the motions as a repeating side-to-side aerobics session begins. Match the exercise. To stop, press the MPP portal button or turn off the power using the on/off slide switch.

Dozens of Penguin superhero robots created by Humanoido

SUPERHERO WEAKNESS
It appears that every superhero has weaknesses, and our Super Penguin is no different. For example, Batman is human, and Superman’s weaknesses are green or red kryptonite, and Lois Lane. Here’s a summary of what to be careful with when you depend on our mighty tiny companion:

* Storm and Time Powers have no apparent weaknesses
* Sleep Power is affected by super-loud sounds
* Direction power is negated by a giant magnet
* Light Power can be obstructed by objects in space
* Life Power depends on battery reserves
* Night Power’s weaknesses are rain and soft objects

A ring of superpower – The first conference of the League of Superhero Penguin Robots. Robots gather as each shows off their programming represented by a number on the blue segment display.

CONCLUSION
A tiny superhero is born out of a stock robot parts kit and unique DIY software. Our meek Penguin friend is now empowered to be a mighty tiny superhero and do great things using only half a programming memory page for seven new superpowers. What comes next? The rest is up to you and Penguin Robot! To learn more about Penguin Robot, review pages this robot web site, at Big Brain Technologies, the Parallax Forum, and historical pages of the Penguin Robot Society.










Fig. 4 Direction Power: Showing directions and equivalent display graphics

 

' 0    North    
' 90   East
' 180  South
' 270  West
' 360  North

Fig. 5 With Direction Power, turning penguin a given number of degrees will equal the direction shown.

 

Time Power uses the one digit display and shows only one digit numbers, one at a time, to achieve sixty seconds using a simple Truth Table to count as shown in Figure 6. The sound is forgiven at the tens increment to note the position in the time.

' 0 1 2 3 4 5 6 7 8 9  1 

' 1 2 3 4 5 6 7 8 9    2 

' 1 2 3 4 5 6 7 8 9    3 

' 1 2 3 4 5 6 7 8 9    4 

' 1 2 3 4 5 6 7 8 9    5 

1 2 3 4 5 6 7 8 9    6

FIG. 6  ONE MINUTE TRUTH TABLE It's easy to see the counting pattern in the truth table. For the exact details, refer to the One Minute Equivalency Table in Figure 7. 


    '  0  1  2  3  4  5  6  7  8  9  10
  • '  11 12 13 14 15 16 17 18 19 20

  • '  21 22 23 24 25 26 27 28 29 30

  • '  31 32 33 34 35 36 37 38 39 40

  • '  41 42 43 44 45 46 47 48 49 50

  • '  51 52 53 54 55 56 57 58 59 60

    Fig. 7 One Minute Equivalency Table 





A List of Provided Code for Download

MASTER SUPERHERO CODE

Penguin_superhero.bpx

INDIVIDUAL POWER CODE FOR EXPERIMENTS

penguin_storm_power.bpx 

penguin_direction_power.bpx 

penguin_time_power.bpx 

penguin_sleep_power.bpx 

penguin_light_power.bpx 

penguin_night_power.bpx 

penguin_life_power.bpx

CALIBRATION CODE

penguin_automatic_servo_calibrator.bpx 

Penguin-CompassCalibration.bpx 

DISPLAY REFERENCE CODE

penguin_display0.bpx 

penguin_display1.bpx 

penguin_display2.bpx 

penguin_display3.bpx 

penguin_display4.bpx 

penguin_display5.bpx 

penguin_display6.bpx 

penguin_display7.bpx 

penguin_display8.bpx 

penguin_display9.bpx 

penguin_decimal_point.bpx 

penguin_display_G2.bpx 

penguin_display_G3.bpx 

penguin_display_G4.bpx 

penguin_display_G5.bpx

RESET BUTTON CODE

penguin_button_test.bpx 

penguin_reset_reader1.bpx 

penguin_reset_reader2.bpx 

penguin_reset_test.bpx 

penguin_reset_timing.bpx 

HUMANOIDO SOFTWARE DOWNLOAD
I have placed superhero software in a folder. Download link below.

https://drive.google.com/file/d/1Ap7CVceJ6jSEBs_9UTTXXFloHxmMIcbY/view?usp=sharing

All photos, programming code and illustrations by Humanoido


REFERENCES
Penguin Robot with 27 Brains
Machine to Machine Mind Meld Penguin
Penguin with 12 Brains - Basic Stamp Supercomputer
Penguin Robot Resources
Downloads for the Penguin Robot
Humanoido's Penguin Robot World
Penguin Superhero Article by Humanoido
Penguin Kit
Parallax Ping))) Ultrasonic Detector, Parallax item code 28015
Parallax Forum
http:// forums.parallax.com/forums/
Penguin Robot Society (PRS), penguin.robot@yahoo.com
Use Wayback Machine
Penguin Robot Superhero Article by Humanoido
May/June 2009 Robot Magazine page 44, 45, 46, 47, 48
(Robot magazine has deleted the notes, diagrams, and software online at botmag.com)

Note: Humanoido has published his article, at this site, complete with photos, notes, diagrams, and software 

Parallax' 2010 Calendar featured Humanoido's Penguin Robot
Superhero for the month of July

Page 18 of the Parallax 2010 catalog featured a photo of
Humanoido's Penguin Robot Superhero



ABOUT PENGUIN ROBOT
Penguin is a rare desktop robot introduced on the cover of Servo Magazine December 2005. The Penguin is a 3.5" tall precision-machined robot designed for desktop navigation. Parallax offered 1,000 limited edition Penguin kits for purchase during Q1 2006 in anodized blue, black, red or nickel color schemes. This mini robot includes a BS2px processor, HM55B digital compass, blue seven-segment LED, infrared emitters and detectors, photoresistors, speaker, and a socket for an RF receiver or Parallax Ping))) ultrasonic sensor. The body parts are made from 6061 aluminum, machined within a 0.001" tolerance in colors of red, blue, black or nickel.