Sunday, March 16, 2025

building the logo turtle

Seymour Papert started lots of things!

How to build a programmable floor turtle” is on Josh Burker’s (JoshB) site: LogoTurtle

INSPIRATION

Going back roughly 50 years, the inspiration originally came from Seymour Papert’s Logo floor turtle which accompanied the Logo programming language, developed for children.

I was further inspired on reading Neil Gershenfeld’s account in his book, Designing Reality, of a conversation he had with Seymour, back then:

“As fab labs started doubling and the Fab Academy began to grow, Seymour came by to see me to talk about them. I had considered the whole fab-lab thing to be an historical accident, but he made a gesture of poking his side. He said that it had been a thorn in his side that kids could program the motion of the turtle but could not make the turtle itself. This had been his goal all along”
Designing Reality, p. 29

Another goal I have is learning more electronics in a practical way. So, I was on the look out for a meaningful project to help me achieve that.

These factors pushed me over the edge. I decided to build the Logo Turtle!

Following the links in JoshB’s article I bought the materials from adafruit, Core Electronics and some other online and local stores.

There were some mishaps along the way. eg. it’s much better if you can get the 2xAA battery holders with a hole in the middle for the flat head screws. After some searching I found an Adelaide store, Altronics, which had these.

I wrote to Josh and his advice was that I should make a Printed Circuit Board (PCB) since the breadboard approach produced unreliable results. He sent me the Gerber files that I needed for that.

I downloaded a free open source viewer, Gerbv to view the files.

I asked for advice on the Adelaide Maker Space forum about how to get the PCB made and some helpful people suggested a couple of companies. I went with PCBWay and they made the PCB for me.

I have my own 3D printer so I printed the parts in PETG. All the links for that are in the JoshB article.

HELP

I’m an electronics novice so I had trouble finding some of the equivalents between the breadboard design and the PCB design. Fortunately I found Tony Onofrio, a friend in the Adelaide Hackerspace group. He translated the fritzing diagram on JoshB’s article into a PCB diagram for me.

Unfortunately, the link to the LogoTurtle software on JoshB’s article is broken. But I wrote to Josh and he sent me the files. Following his instructions (downloading drivers and Java) I tested the LogoTurtle software on the metro mini board and this was successful.

The software is a Logo implementation in Java. The logo files are text files which you download to the metro board. I didn't understand how it was working but spoke to David, a Java programmer at the Hackerspace group and he explained some of it to me.

The next step was soldering the parts onto the PCB board. This was hard for me since I’m a novice at soldering. Again Tony helped out by giving me some lessons in soldering. The order in which I soldered the parts on was: (1) resistors x 2 (2) Darlington driver, note the notch (3) Metro Mini (4) header pins 2 x 5 then x 3 (5) photocell (6) switch

Having done all this I was ready to attach the PCB to the turtle. I soldered the 4 battery leads, plugged in the stepper motor 5 pin connectors and inserted the 4xAA batteries.

I found some pens with the correct diameter at Office Works and placed one in the pen holder on a sheet of paper. I flicked the switch to turn on the metro power, indicated by a green light and pressed the reset button

Hallelujah, the turtle drew a square! Logo.jar runs the test.txt file by default.

to startup
square
end

to square
pd
wait 1000
repeat 4 [fd 100 rt 90]
pu
alloff
end

But note the angles are not quite 90 degrees. Using trial and error, I changed the angle to 85 degrees and it drew a pretty good square

JoshB’s solution here is to add a shim to alter the angle of the stepper motors reproduce. I tried this but it didn’t make any difference.

I wrote to JoshB again and he suggested I alter the sys.txt file where the logo drawing procedures are stored as text files.

So I altered the rt and lt turn procedures by multiply and angle by 85/90. This then drew a perfect square.

to rt :n
make "n :n * 235 / 100 # (the multiplying factor was altered from * 25 / 10)
repeat :n [rstep- lstep+]
alloff
end

I then tried a pentagon, square and triangle combined:

The more ambitious rotating octagon worked well first up:

Then I made a similar change to the arcrt (arc right) and arclt (arc left) procedures and then I could draw near perfect circles and arcs.

An interesting feature of the design is the photo resistor. When exposed to the light the resistance goes down. This photocell is plugged into A0 on the Metro Mini, so you can introduce this value into the code to achieve variations based on light intensity.

Following JoshB's notes I established the A0 values for a bright flashlight were roughly 960, for normal light 830 and with curtains drawn about 565. So I ran the following procedure in normal mode and flashlight mode which modified the size of a circle:

to startup
wait 1000
let [n a0 / 10]
repeat 10 [
arcrt 50 :n
make "n a0 / 10
]
alloff
end

So far, so good. I could draw closed shapes with the LogoTurtle.

But to draw people's initials, for example, you need to be able to lift the pen (logo command pu) and put it down again (pd) at the right times. This requires fitting a servo to lift the pen. I also added a weight to the pen to ensure it drew firmly on the paper when down.

Here are a couple of initials I drew, using the alphabet file from JoshB's LogoTurtle Curriculum. I presented these to a couple of members of the Hackerspace group who have been helping me:

REFERENCE

Josh Burker's original article: LogoTurtle
LogoTurtle Curriculum (lots of great ideas here)

No comments:

Post a Comment