- User Interaction
- Technical Description
- Modified Fisher Price Toy
- Development Narrative
1. Overview of the Learning Environment | Watch Video | Download Karan's UCI Masters Thesis
M-CLE is an Embodied Constructivist Learning Environment that is based on three key design concepts:
a. Learning through Assimilation and Accommodation
b. Learning through Embodiment
c. Learning through Design
M-CLE is a physical learning environment in which synergistic artificial intelligence through the use of robots (creative agents) is employed to embellish the creativity of the child. In M-CLE, the child uses a modified Fischer Price SmartCycle (that is wirelessly enabled by replacing the proprietary microcontroller with a custom microcontroller) to create floor art through a black creative agent that is embellished by the other agents using synergistic AI techniques. Many thanks to the ACE program and committee members Prof. Simon Penny, Prof. Kavita Philip and Prof. Sven Bernecker
User Interaction Design
2. User Interaction
The user interaction in M-CLE is realized through the following components:
a] A fun way of an embodied input to the system in the form of a toy bike
b] Four robots or creative agents that are colored as black, red, green and blue.
c] An erasable design space and a fortification around this space.
The key steps of this user interaction are:
1] A child using a modified toy bike controls the black creative agent. This agent leaves a black trail in the design space to help realize the child’s ideas.
2] As soon as the black agent is initiated, the task of the other three creative agents is to use artificial intelligence to embellish the creativity of the child through free-form design. The bike and the black agent thus allow the child to impose its creations i.e. assimilation while the other creative agents help the child to accommodate new information thereby scaffolding its learning process.
The working of the project begins with the child sending steering and acceleration data from the toy bike to the black creative agent. This data allows the black agent to navigate the design space and accordingly realize what the child directs it to draw. This agent leaves an erasable black print of the child's artwork on the floor. As soon as this agent is activated, the other three agents begin a search action in the design space to seek a black trail. As and when a zone of such trail has been found, the agents autonomously use their artificial intelligence to create new patterns around this trail. There is a certain percentage of freeform behavior and randomness to what the agents create since their primary function is to regard the child as the active constructor of its knowledge by giving new directions to what it has created - in other words embellishing its creations.
The secondary functions of these agents are collision avoidance and path re-direction in order to not continuously disrupt the activity of other agents thereby keeping the health of the swarm at its creative best. As the agents perform within the design space, emergent artwork begins to be realized and an interesting dynamic of creativtiy through work and play begins to be established between the child and the autonomous agents. Some examples of such emergence can be seen in Fig. 5.4 where agents have chosen to draw some shark fins around the black curves left by the child's agent. The importance of such emergence is thus the highlight of my project since this AI assisted collaboratively constructed artwork can have different interpretations for the child, continuously expanding the repertoire of what it could actively construct with its own artistic realizations.
A preliminary repertoire of creative intelligence has been given to the agents such as finding a black trail, then selecting a random design action that is proportional to the distance that the agent covers in one of the many navigational directions, for example arcs would involve moving left and right while shark fins would invove moving forward, right, left and back. Since the agents are also wirelessly enabled, the intelligence that guides them can be directly uploaded from a local or remote location. As a result, the project provides a good experimental platform where more sophisticated forms of emergent artificial intelligence such as those involving genetic learning algorithms can be made available to the agents by a third party such as student researcher.
4. Technical Description
4.1 The Creative Agent
The Creative Agent is an externally or autonomously guided robot using a custom RF enabled ATMEGA168 circuit. Structurally made out of Expanded PVC, it has an ultrasonic sensor and rubber feelers for collision avoidance and path redirection, a front mounted IR sensor for line detection and three servos - one for the color marker assembly that allows the agent to draw and two for propelling it. Differentiated 5V/6V Power Supply is provided for the microcontroller and servos. Each of these components is divided into two decks - Bottom Deck (that holds the sensors, actuators and the microcontroller) and Top Deck (that holds the Power Supply to the Bottom Deck). This has been done to ease the debug process so that any faults in the agent belong to either of the two decks. The Top Deck is housed over the Bottom Deck using hex standoffs and has wired connections to be plugged in to the power supply pins of the microcontroller.
4.1.A. Bottom Deck of Creative Agent
The Bottom Deck of the Creative Agent is composed of:
1. Servo Guided Ping Sensor Assembly:
The Ping Sensor from Parallax is an ultrasonic sensor that provides a very low-cost and easy method of distance measurement. A recurring pulse is transmitted from the sensor and the distance-to-target is determined by measuring the time required for the echo return. Output from the PING sensor is a variable-width pulse that corresponds to the distance to the target and is available in a digital format. This sensor is housed using a metal bracket affixed to a 180 degree servo. The servo allows scanning of near field objects from 0 to 180 degrees and a ping pulse is sent at every 20 degrees of such increment (left-to-right scan) or decrement(right-to-left scan). The ping result that provides the most clear direction is recorded in terms of the servo position that is multiplied by a certain correction factor sent to the agent's primary rotation servos. This process of scanning, detecting collisions and correcting movement direction is active throughout the agent's life.
2. IR Line Sensor:
The Infrared(IR) Line Sensor is a digital Single Line Detector reflective sensor commercially available from Lynxmotion. The sensor delivers a stable TTL compatible high or low voltage depending on the color of the surface it is positioned over. When the sensor is positioned over a black or dark surface or if nothing is there for the light to
reflect off of, the output is LOW. When the sensor is positioned over a white or light surface the output is HIGH. This sensor is used by the creative agent to detect the black trail left by the child's agent so that it can create its embellishments around it.
3. Servo Guided Color Marker Assembly:
This assembly is mounted at the front of the agent before the ping sensor assembly. It consists of a continuous rotation servo that rotates in either the forward or the reverse direction. When the servo is rotating forward, the marker moves down while when the servo is rotating backwards, the marker moves up. The marker is obstructed by the Top Deck and the floor to remain in each of its desired positions.
4. 8 Microswitches and Rubber Tubing as Feelers:
The agent uses a series of 8 microswitches and rubber tubing as feelers for secondary protection when the Ping sensor might fail. These microswitches are installed in a set of two for each of the directions: N/S/W/E. The tubing size and placement of switches is such that they maximally contribute to cover the 360 degree space around the agent. These feelers are available in the form of Bumper Switch Assemblies from Lynxmotion.
5. 55 oz.in. Continuous Rotation Servos and Wheels:
The main drive wheels are operated by two 55 oz.in. continuous rotation servos that are sent a combination of forward and reverse direction signals from the microcontroller to accordingly travel in either the forward, backward, left or right directions.
6. Custom ATMEGA168 based circuit:
The custom ATMEGA168 based circuit contains the ATMEGA168 microcontroller and is RF enabled to communicate with the toy bike and other agents. This circuit is explained in a separate subsection.
4.1.B. Top Deck of Creative Agent
The Top Deck of the Creative Agent carries the differentiated power supply for the operation of the agent. This is composed of batteries and rocker switches. One set of AA batteries i.e. 4 X 1.2V = 4.8V powers the microcontroller and sensors while the second set of batteries i.e. 5 X 1.2V = 6V powers the agent's actuators i.e. servos. In order to get 6V, two types of battery holders were connected in series - one with a carrying capacity of 3 batteries while the other with a capacity of two batteries. 2900 mAH Rechargeable Ni-MH batteries have been used for low cost repetitive runs of the project. Battery holders are 'Velcroed' on the deck's surface. Two output connections are made available from the top deck one for 4.8V and the other for 6V that plug into the power pins of the controller's circuit. Aesthetic looking rocker switches were used to enable / disable the power supply. Negative terminal of both battery holders goes to ground while the positive terminal of each is connected to one of the leads of the corresponding switches. The other end of each switch is connected to the power pins of the controller circuit.
4.1.C. Custom ATMEGA168 based Circuit
The custom circuit uses an ATMEGA168 microcontroller that has 16K Bytes of Flash Program Memory and operates at near 5V. It was designed using the Eagle PCB software. It has a microcontroller interface to the XBee RF module which is a low-cost point-to-multipoint/peer-to-peer networking module. This module is used to wirelessly program the ATMEGA using a transistor (that momentarily pulls the controller's reset pin to ground) as well as to communicate with other agents. Power supply pins and 4 Servo connections are available. Two 4051 Multiplexers expand the available input pins on the ATMEGA for reading data from microswitch feelers. Two optional 74HC595 ShiftOut register slots exist for expanding output pins. A voltage regulator ensures a constant 5V to the circuit.
4.1.D. Explanation of Code Structure
The program code that runs on the ATMEGA168 controller is optimized to be small in size and efficient at the same time given the tradeoff between memory limitation and the number of functions that the agent has to perform. The code that is loaded on the toy bike's ATMEGA basically performs two functions: reading the potentiometer data from the steering movement and encoding this movement in terms of radio signal data. I have used the alphabet space 'a-z' for encoding most of the RF signal specific data. So when the steering is positioned at the center, a 'c' is communicated to the black agent, likewise an 'l' for left and so on for left-mid, right-mid and right. The controller on the bike also senses the acceleration in terms of revolutions/min and then translates this into digital values to move faster or slower. With respect to the code that sits inside the agents' controllers, two slightly different versions of the same code were used.
The first version controlling the black agent is minimalistic in the sense that all it does is to check for incoming serial data periodically from the bike using the statement [if Serial.available() is greater than 0] and then decode the incoming data to send control signals to the agent's drive motors and for the marker up/down movement. The second version controlling the other agents is a lot more complicated since it requires the agents' behavior to be autonomous as they are performing several functions at the same time. The first of these functions is the main drive movement, the second is scanning and collision avoidance using Ping sensors which is accomplished using PingOut() that sends, receives and analyzes the ping pulse where an object is detected if inches is greater than inches-threshold. Within collision avoidance is also the function PingAround() where the agent scans left to right to acquire a sense of the clearest drection to proceed. Thirdly, the code to the IR sensor is of the form l-black = digitalRead(line-sensor-pin) and if l-black == 0 then black line is detected. Finally the code that embellishes the black line is one that has a repertoire of drawing basic curves by directing the main drive wheels to move in particular directions for a random amount of time. This code is of the following form right now involving inter-nested random variables:
turn = 0;
int one = random(60, 80);
// Agent goes left for turn value from 0 to random upper limit between 60 to 80
int two = random(one, 100);
// Agent goes forward for turn value from 0 to random upper limit between [variable one] to 100
int three = random(two, 140); // Use above logic for right
int four = random(three, 160); // Use above logic for back
marker-down(); // Position marker down to begin to draw
if (turn is-less-than-equal-to one) left(); // Left movement data to main drives
turn++; // Increment turn value for next iteration ]
4.1.E. Physical Realization of Creative Agent
5. Modified Fisher Price Toy
In order to make available to the child a fun way of a wireless embodied input to the system, the Smart Cycle Physical Learning System from Fischer Price was disassembled and modified by replacing the company's proprietary wired microcontroller connections to television with my own custom wireless microcontroller circuit. In order to do this every connection that went in and out of the microcontroller was studied and reverse engineered to RF enable potentiometer steering data and acceleration data from the toy's pedals. The steering data directs the black creative agent to move in various directions while the acceleration data controls the speed of the agent in the design space. One of the push buttons on the bike handle is used to control the movement of the agent's marker in up and down direction. The other push button was well utilized to send reverse acceleration data due to the insensitivity of the toy's IR sensor package to encode direction based pedal acceleration. Also since the power supply that runs the toy is 4 X 1.5V (D Battery) = 6V while the ATMEGA168 runs on 5V, it was necessary to use a 5V regulator to step down the voltage.
The Open Chassis
Hack-a-Day Press Coverage
6. Project Development Narrative
When speaking in terms of a personal project development experience, I would cherish this project as one of the most fruitful and amazing of all learning endevedors that I have undertaken in my academic career till now. I don't exactly recollect how I went about conceptualizing the idea for this project. What I do recollect though are two things - the first being that of having a lot of personal support and embellishment from my committee members and second being the fact that this project was both ideated, designed, tested and demonstrated in an extremely short amount of time. The project realization was also not one without obstacles or uncertainties. In fact, given the number of unknowns that this project begged I feel fortunate enough to realize it in any given form.
The first of these unknowns was to technically realize a toy bike as an embodied form of input to the system. With respect to the Fischer Price Smart Cycle Physical Learning System, I was uncertain whether the system could be tampered with in any given form. Fortunately, the toy's assembly was straight-forward. A set of screws that allowed the bike to be assembled and dissambled along its cross section was the key to modify the bike. However, this was only the first step. The second step was to reverse engineer every connection that went in and out of the toy's microcontroller circuit and match these connections with my custom circuit. It was an anxious moment to see what the mechanism was to steer the bike - it happened to be a simple potentiometer. It was more than an anxious moment to see what the mechanism was to get pedal acceleration data - it happened to be a simple IR sensor package that encoded the rotations. I was so amazed and excited with this knowledge that I worked straight 18 hours from there to finish the integration of the bike with my microcontroller. The risk had paid off, I had saved valuable time and I had a ready to demo embodied input to the system.
However, I knew that I should keep up the good work and not slack off since this was only the first part of the project. I still had to begin work on constructing my four creative agents. Before starting work on them however, I recaptured some of the lessons from my earlier project. Robotic constructions require hardware and build time and they require software intelligence too. The former of these requires a combination of building your own custom constructions from scratch and ordering specific parts from specific vendors which have their own order processing and shipping times. The latter of these requires a lot of patient thinking and negotiation with your computer given hangups, crashes, power supply etc. Also there is always the case of getting stuck in a debug cycle where you just don't know what piece of code has gone wrong.
As regards to the hardware material for my project, I took the decision of using Expanded PVC (also called as rigid or foam PVC). The primary advantage of this material is that it has some great features - it's strong, tough yet easy to cut and drill, non-conductive and aesthetically very appealing. However, the main disadvantage of it (and one that I had entirely not anticipated) is the fact that it is available in very limited amounts in colors other than black, white, gray, yellow and blue. Since I had color coded my agents in red, green, blue and black, the primary colors that were missing from my PVC collection were red and green and I needed to have these colors to keep the aesthetic of my project consistent (something that I realized is equally important other than the sole functioning of the project). I did call up several PVC vendors without success, finally at the 16th try I managed to personally request a vendor to have these colors shipped to me as soon as possible and my aesthetic was then complete.
However, it was not just the bike and the aesthetic that I had to worry about. Several problems surfaced while just building the electronics and agent structure. With regards to electronics, there was a recurring problem of testing the performance of the agent in physical space using on-board rechargeable batteries. Since the drain on the batteries was primarily a function of how well I had written the code to efficiently utilize the power hungry ping, IR sensors and servos, there were multiple times when I had to neatly synchronize battery recharge times with code reconstruction and testing. Moreover, although I had relied on the quick wireless method of uploading code to the agents, there were many times when the TX / RX on the controller-Xbee interface would just halt. Thereby part of the code would get uploaded to the agents and I could not send them the reset command to reset their transistors. In this case, I had to disassemble the agents to the lower deck, take out the microcontroller, serially reprogram it, fit it back into the circuit and then go for wireless upload again.
With regards to the agent structure, I guess there were two problems that I was worried about. The first was governed by the need of minimizing the space occupied by the agent in the design space. Since I had a 6 feet X 6 feet space to operate within, I had roughly calculated a base diameter not exceeding 7 inches. Within these 7 inches, I had to fit two drive servos, a 'centered' marker assembly (overlapping which was the screw to tighten one of the two skids that allowed the agent to be supported on two wheels), the microcontroller circuit, feelers - the arrangement of which did take some optimization. One of the foundational decisions though was that of adding the Ping sensor and its mounting bracket for which I had zero room left on the base deck. So I jig-sawed a quick piece of expanded PVC to extend the base deck, the concern in mind being if the weight of the front servo and ping sensor assembly would be supported adequately by this small piece which was already extending the design requirement of 7 inches. Fortunately, that decision turned out to be the best one that I took since during actual runs, the performance with feelers alone would only be satisfactory. Frequent collisions would be so disturbing that the agents would be more busy in conflict negotiation that actual creative work. Adding the ping sensor assembly that allowed the agents to keep a distance of 6 inches between them was thus very crucial. The second of the problems with respect to the agent structure was the agent's center of gravity being proportional to the number of decks installed. I was concerned of the agent tipping over if I loaded the second deck with batteries and then the third deck with the equally important shark fin that allowed for a sense of direction to be attributed to the movement of the agent. Fortunately, the combined weight on the servos was well distributed and my agents were well balanced and composed for their creative act.
Wow!…. So many problems just come along your way and keep testing you until the very end. But these problems and the unique solutions that we discover for them is what a learning experience is finally all about. And many times there are important things that have happened, ones that you just don't recollect while documenting your experiences. In my case, the above subjective description is thus only a subset of the sheer number of do-it-yourself, try, fail and succeed sort of things that happened during my time at ACE. Its been such a wonderful, wonderful learning experience that a symbolic mode of documenting them indeed seems vicarious!
I feel a sense of tremendous satisfaction with the completion of this thesis and project and greatly acknowledge the personal embellishment of all my committee members. Even though I failed too many times, all those failures were critical to my learning experience. It was the process and not the end result that mattered. This process has tought me important lessons and skills and I look forward to the future with a deep sense of gratitude and a positive mindset. Thankyou again to my committee and all those who have supported my work.