Meet Alphabot Robot

Three Laws of Robotics:

  1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
  2. A robot must obey orders given to it by human beings, except where such orders would conflict with the First Law.
  3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.
Robot Main View Image AlphaBot was one of my weekend robotic projects.

This robot was created with the purpose of exploring:

  • Robotic hardware technologies and mechanical components
  • Schematics and circuit solutions
  • Microcontrollers, sensors and other electronic components
  • Embedded software programming
  • Real-time intelligent processing algorithms
But... mainly it was created for amusement.

The robot main design objectives were:
  • Simplicity of mechanical hardware components - easy to find parts and build
  • Simplicity of schematic solution - minimize number of electronic circuit components
  • Place most of the complexity in the robot software - it is easier to enhance and expand then hardware and circuitry.
  • Low cost of parts

Robot Functional Diagram

Robot Functional Diagram

Robot Design Highlights

Under The Hood - Main Board of the Robot
Under The Hood:
Main Board View

Main Processor:

Philips P89C51RD2 Microcontroller
  • Running at speed 11.0592 MHz
  • Four 8-bit I/O ports
  • Seven interrupt sources
  • Programmable counter array (PCA)
  • Full-duplex enhanced UART
  • Three timers
  • Four interrupt priority levels

Robot IR Sensor

Robot Sensory System

  • Proximity sensors
    • Passive - front left and right, rear contact bumpers
    • Active - Infra-Red (IR) emitter/receiver sensors,
      use modulated triangulation algorithm:
      • Sharp GP2D15 short range sensor (front, at the base)
      • Sharp GP2Y0A0YK long range IR sensor - detects obstacles up to 10 feet. Mounted on rotating head and positioned by the bi-polar Clifton Precision Stepper motor, allowing 360 degree sweep
  • Locomotion speed sensors - wheel independent, reflective optical encoding
  • Head home sensor
  • Light sensor
  • Tilt sensor
  • Low supply voltage sensor

Robot Propulsion:

  • Independent control of the left and right gearboxes and drive wheels
  • Toshiba TA7267BP Full-Bridge (H-Switch) motor driver
  • Precise power load control using Pulse Width Modulation (PWM)
  • Continuous adjustment of the robot speed using IR sensor feedback with optical encoders, automatically compensating for surface characteristics, angle/slope, battery charge level, etc.

Communication with Robot

  • Heartbeat LED indicator
  • LED Signal Tower (3 LEDs/7 colors)
  • Sound effects using audio beeper
  • Audible Morse code system to communicate error codes and status messages
  • Robot Mode switches
  • Modified RS232 UART interface for robot firmware upload and maintenance
  • 27MHz 4-channel radio control/command input interface

Robot Schematics

Robot Main Board Schematics

Main Board

Robot Chassis Board Schematics

Chassis Board

Robot Motor Driver Board Schematics

Motor Driver Board

Robot Head Board Schematics

Head Board

Robot Software Architecture

Concept Overview:
  1. The first step after robot powering up is a thorough system self-diagnostic, including testing hardware and electronic circuitry.
  2. The Robot's main routine consists of an infinite loop, within which various logic sub-routines are called in sequence.
    Routines examples include:
    • Processing sensory interrupts (bumber activation, object detection within IR proximity, unexpected change in speed...)
    • behavior decisions (deciding on driving directions, setting goals, etc.)
    • processing communication commands
    • minor self-diagnostic
    • etc.
  3. The routines are designed not to take much time and exit almost immediately: They do not actually wait to complete their task (f.e. turning robot 180 degrees) - instead they set required entries in the Robot's task message queue and exit.
  4. The robot task queue is constantly monitored and its tasks are processed by the separate timer and sensory interrupt driven routines. Tasks in the message queue have various types and priority levels.
Other quick points:
  • C programming language
  • Message Task Queue
  • Real-time pre-emptive multitasking algorithm
  • Stalled wheel detection routines and PWM load balancing

Robot Firmware Source Code

  • AlphaBot.h - Include file containing definitions
  • AlphaBot.c - Robot initialization, self-diagnostic and main loop
  • Drive.c - Robot driveing routines, including processing speed sensors and calculating appropriate PWM loads
  • Behavior.c - Robot behavior routines.
  • Diagnostic.c - Robot self-test and diagnostic routines
  • Scan.c - 360 degrees surroundings scan using long range IR sensor on rotating head
  • Task.c - Implementation of the Robot's tasks queue management
  • Utils.c - Auxiliary Robot functions - beep frequencies, LED signalling sequences, etc.
  • Artistic.c - Robot dance routine
(Keep in mind this is not the final code - some of the parts are not completed).

Robot Self-Diagnostic Routines:

  • Periodic sensory, motors and battery charge level checks

Robot Behavior and Artificial Intelligence:

  • Obstacle detection and avoidance
  • Nocturnalism, and photo-tropism (light seeking).
  • Rule-based self-learning patterns
  • Elements of Fuzzy Logic
  • Robot activities when active:
    • Wall following (left or right) using dual IR proximity circuits,
    • light seeking (happy) and light avoidance (sad) using photo sensor,
    • Play with LEDs
    • Play sounds
    • Dance/spin
    • Observe its surroundings and respond to sudden changes
    • Wander around
    • Do nothing/rest/battery charge (at night)

Future Robot Building Plans

  • Location awareness (scanning and mapping of the surrounding environment)
  • IR heat sensors, sense and react to human motion
  • Ability "outsource" the Artificial Intelligence / AI logic and heavy computation to a networked PC via radio link.
  • Enhance behavior by implementing various AI algorithms, access to the knowledge base on PC and network, etc.

 .