Wednesday, July 19, 2017

Strobing Zoetrope v2, Now With Logo!

This project started during my participation in Design Do Discover 2017. At the end of my post about it I said I wanted to try making it work with a mashup of LightLogo and LogoTurtle and now I have! In this phase of making a zoetrope with a spinning disk of animation frames and a strobing light source, the project has gotten several upgrades:

  • Instead of being programmed in Arduino, it is programmed in Logo. I added the necessary parts of LogoTurtle from the sys.txt file to spin the right stepper motor to the sys.txt file of the latest version of LightLogo.
  • I'm also using LogoTurtle and LightLogo hardware. I made the motor circuit with a 5V stepper and the Darlington driver using Arduino pins 6-9 and the light comes from a 24 NeoPixel ring with data in connected to pin 2 on the Arduino.
  • I added two potentiometers, one to change the size of the steps the motor takes each loop of the program-effectively the frame rate-on pin A0, and one to change the color the NeoPixel ring flashes, on pin A1. This latter addition is a really wonderful effect, so fun to play with.
  • I also designed a laser cut box. Some of the holes were off and I'm finding it needs more openings for things as I use it, so I will be modifying that. I only had quarter inch mdf available which is unnecessarily thick and I would like to make the next box with 1/8 inch plywood or mdf.
Here is the new circuit attached to a breadboard inside:

One slightly perplexing thing about the second potentiometer is when its ground wire is connected to the breadboard's common ground it almost never registers 0, so I can't get white. It does stay at 0 when I connect it directly to the Arduino's ground. Of course I could change the code to "ifelse sensor1 > 1" instead of "ifelse sensor1 > 0" and lose a little bit of red.
The LightLogoTurtle (what I'm calling it) program controlling it looks like this:
 to startup  
 setbrightness 99  
 loop [  
 if sensor0 > 0 [  
      ifelse sensor1 > 0  
           [all sensor1 / 10]  
           [all -1]  
      wait 20  
      repeat convert-to-degrees sensor0 / 10 [rstep+]  
      ;print sensor0 / 10  
 to convert-to-degrees :steps  
 ;512 steps per rev  
 ;div by 360 to get angle  
 ;5120 / 36 * 100 = 142 to deal w no floats  
 make "steps (:steps * 142) / 100  
 output :steps  

The input range of the potentiometers is 0-1023 so it was convenient to divide by 10 to get LightLogo's 0-99 range of colors. I made a procedure that converts the other pot's 0-102 input range to degrees of a full revolution. So it's cool that when the pot / 10 is reading 90, the stepper really does spin 90 degrees after the light flashes. One result of this is you could really see that using just 4 pictures to make you animation around the disk will work, but with a frame rate of only 4 it will look very choppy. The more frames you use, the more fluid it will look.
I intend to use this machine in the classroom to play students' Turtle Art designs. They will stop the turtle during successive loops of a program and save an image of each frame, then add each frame to a circle template with the appropriate number of frames I made in Google Drawing. Here's one of my own:

After playing with Turtle Art a bit I wanted to see some of Eadweard Muybridge's photography in the zoetrope. His motion studies would seem to be perfect animation material. And they are!
Muybridge Jumper
Muybridge Pickaxe
Muybridge Cat
Muybridge Gymnast

No comments :