Logo Bot

There are a lot of things to live up to when you’re a nerd such as myself. Certainly one of the requirements is that you build at least one robot, preferably for a high school science fair. I was quite late on this point, I’m afraid. Although high school is long past, I finally got around to building a robot. (one more thing checked off the list)

koch snowflake

I had the idea in my head since my undergraduate days when I wrote a paper on recursion and demonstrated some simple fractals using Logo and PHP. (See my Fractals page) It’s fun to write three or four lines of code that produce some really cool looking designs. My idea was to one day build a “real” turtle that could understand Logo and draw on the ground/floor with a real pen.

the frame of the robot, showing the motors

The Logo Bot is based around 2 bipolar stepper motors. I built a custom driver board using a PIC and a couple of Quad Half-H Driver IC’s. The brains of this guy is an Arduino Diecimila.

old tires

The pen is passive for now, meaning it is always “down.” It draws quite well on smooth flooring such as linoleum. The weight of the marker puts enough pressure on the tip to draw solid lines. The aluminum tube is the perfect size for washable markers or sticks of chalk.

The Logo Bot starts a Koch fractal routine…

Close up of front wheel

View of battery pack and motor controller board

Finished Snowflake Segment

I haven’t had much luck drawing outside, which is it’s intended purpose, but I’ve been making improvements. (Unfortunately winter came, as well as finals, so the ‘bot is sitting on my shelf at the moment) At first I had some pretty large all terrain rc tires on it, but the motors didn’t have enough torque to drive them. (Actually, the moment of inertia of the wheels was too large, causing oscillations in the motors. See my paper on Stepper Motor Resonance).

The wheels on it now were made by cutting circles out of press board with a hole saw and gluing rubber on them with rubber cement. They work way better than I could have expected. I have also since modified the frame to make it shorter, made a smaller driver board, and added an enclosure to protect the electronics.

One of the problems I ran into was programming the robot to turn a certain number of degrees. Because fractals are recursive it is extremely important that you draw accurately or very small errors will become very large, very quickly.

The problem is that there is only so much correction you can do when using stepper motors. The motors are 200 steps/rotation, meaning 1.8 degrees or 0.0314 radians per step. When the robot turns, one wheel goes forward, one wheel backward. The wheels make a circle with a diameter equal to the wheel-base. The circumference is then PI*[wheelbase]. In order for the robot to turn it’s body 1 degree it has to travel (1/360)(PI/wheelbase). The robot can only move in discrete steps equal to the arc-length of 0.0314 radians on the wheel, which is equal to (wheelradius)*(0.0314)

I have already chosen my wheels, so that variable is static. I can change the wheelbase slightly by loosening the set screws and moving the hubs on the motor shafts, but I only have a finite range there. If I want accuracy to one-degree, I would need to find a wheelbase that allows the travel required to turn 1 degree to be a multiple of my stepping-distance, (wheelradius)*(0.0314). The accuracy required here is so high that I had to obtain values experimentally because my measuring equipment (a ruler) wasn’t accurate enough. Come to find out, there is no possible way for this robot to accurately move 1 degree.

Fortunately the minimum accuracy I would ever need is 15 degrees, and this I can do. Still, even kitchen floors aren’t perfectly flat and level and tiny imperfections lead to some pretty huge errors after a few recursions. What I found was that it is impractical for a robot of this design to draw very complex fractals in a less than perfectly controlled environment. It would be interesting to explore the posibilities of building a robot which is capable of marking it’s environment, then using those marks as a reference to move precisely, but I think I’ll leave this for another time.

I can still do a lot with this basic robotic platform, so I plan to make some improvements.

One thing I want to do is solve the torque problem. The motors are capable of operating at 12v per coil. At first I was running the entire robot on one 7.2v nicad pack, and have since added another. Still this only gives me 7.2v per coil as I’m running them in series. The smaller wheels help, and the resonance is not a factor anymore because they are lighter, but for chalk drawing on concrete I may need greater torque.

I also want to create a mechanical pen to be able to send the robot “penup” and “pendown” commands.

Which brings me to my next improvement because right now the robot doesn’t “understand” Logo. I write all the code in C in the Arduino IDE. I want to be able to add an EEPROM or even removable memory (sd card?) that can store “programs” for the robot to execute.

One thought on “Logo Bot

Leave a Reply

Your email address will not be published. Required fields are marked *