Showing posts with label robotics. Show all posts
Showing posts with label robotics. Show all posts

Monday, June 24, 2013

Random Walk to Remember

The random walk is my Hello World— the foundation code I always write to get things up and running. If I'm using a new visualizer, I try to make it look like TV static. I'll use random colors or numbers or motions to get a broad sense of what my new system can do.

I'm pleased with Neko's code so far, it's very well-organized. The random walk is my best yet so I'll explain it for the sake of anyone who doesn't know how to read code, but would like a little puzzle to try it out.

This a screenshot of one of the functions in my program: randomWalk(). I tell the function to repeat infinitely with two parameters: the maximum distance the brush should jump, and the time to pause after each iteration. My current parameters are 50 steps and 500 milliseconds, so when the computer reads the instruction randomWalk(50, 500) it will run this piece of code with the variables jump and del set to 50 steps and 500ms, respectively.

This function uses randomness in two ways: it randomly picks one of the six motors, then it randomly picks the number of steps for that motor to move.

Neko also has a motorized shoulder which is not moved in the random walk, but instead responds to the ultrasonic sensor. This keeps the brush on the canvas. The accelerometer is read in a balanceBrush() function, but I don't use it much yet. There's also a readGyro() function, adapted from this tutorial, which prints the gyroscope readings but does nothing more; another noch-nicht. A zip file of Neko's Arduino program can be found here— a link I'll update with each new version.

Reading live data as scrolling lines of serial output can be quite meditative. I just disabled the motors and moved the brush around the canvas by hand, allowing my own neural network to get a sense of how the sensor data changes while drawing different shapes and lines. As a stepping-stone to a Kalman filter, I'll now try writing a complementary fiter to combine accelerometer and gyroscope data and determine how the arm is moving.

Thursday, June 20, 2013

Beeping with Robots

The central objective of my work is to allow robots to express themselves using oil paint. But today I've been thinking about incorporating another mode of expression: beeps. My first Roomba was a castaway from my mother who, though an enthusiastic early adopter, has vacuuming standards the robot was unable to meet. Eventually I tried teaching it to paint which went well, until it went poorly. Its stair detecting feature failed (presumably paint-related) and it plummeted off a sawhorse.


Now I have a newer model Roomba and although it's better at vacuuming, the updated voice is a huge disappointment. The red model had an all-beep vocabulary. The white one has the saccharine GPS navigatress saying things like "open Roomba's brush cage" or "please charge Roomba." It's speaking in the third person, in parroted English. The Roomba only needs to vocalize three things: I'm ready to clean, I'm in distress, I've successfully cleaned. Whatever caused the distress is apparent as soon as it's got your attention.


I've been testing out some basic emotive themes on my keyboard today, and came up with some beeps to try out on Neko. http://paintbot.org/beeps/



Monday, June 17, 2013

Terra Verte


Little Neko finally got some paint tonight: Terra Verte. He's just doing a random walk, using the ultrasonic sensor to keep the brush at the canvas, and the accelerometer to stay upright. I'm hoping eventually that using a random walk and a canvas, Neko could learn how to address the canvas as an X-Y plane. Writing something like that isn't easy, but it's less tedious than hard coding all the different angles. I'm hoping I can get away without putting potentiometers at each joint.

A List of Robot Artists

I am not alone in my efforts to build artistic robots. I've seen many, some already decades old. This post will serve as a list to be expanded with time. It won't be comprehensive— there are too many, often similar— just my favorites. If you know of any I've missed, please leave a comment.

Kanayama

Thursday, May 30, 2013

Sensing Brush Location

Getting Neko back and forth across the country proved extremely difficult, so I've been rebuilding him at half-size. In the process I decided to add a gyroscope (measures tilt about 3 axes) to the accelerometer  (measures static and dynamic acceleration, due to gravity and motion respectively) and ultrasonic sensor (measures distance to the nearest object by emitting an inaudible ping, and timing how long it takes to bounce back). In Neko's first iteration, I had the accelerometer on the shoulder joint, telling those motors to keep the arm generally upright. I had the ping sensor on the wrist, telling the shoulder motors to keep the brush at the right distance from the canvas. The wrist motors moved the brush back and forth as the elbow motor moved from the top of the canvas to the bottom. The shoulder had continuous rotation servos, all others were standard servos.


For half-pint Neko, all the servos are continuous rotation. I was aiming for uniformity, and the ability to scale up to stepper motors if I rebuild the robot at full-size. The accelerometer will tell me pitch and roll, but I need pitch and yaw. I think a gyroscope can fill the gaps. I got some trusty-sounding advice from r/robotics on sensor placement, and now have everything mounted together. I'm still pretty confused, and scared of whatever Unscented Kalman Filtering is, but I'm making progress. My current technical difficulty is that I don't know how to use the gyroscope in Python (the Prototyping library is extremely limited, and not really meeting my motor needs either), and don't know how to log data without it (Firmata seems deprecated).