Friday, November 22, 2013

Stepper Motor Music

I recently came upon a small project by accident.  I was working with a bipolar stepper motor and an Arduino, trying to program the steps individually without using the stepper motor class.  I finally succeeded, wasn't too hard but noticed I was getting some interesting beat sounds coming from the clicking of the stepper motor as it resonated on my table top.
So I wanted to amplify this sound but could not find my piezo amplifier so I decided to use the guitar pickups on my daughters pink mini strat.
By placing the stepper motor on the strings and running different sets of intervals between the steps on the stepper motor, I produced some crazy sounds.
You can listen to them here on my Sound Cloud account.
https://soundcloud.com/migsmixs/sets/stepper-motors

The basic setup is an H-Bridge with an arduino.
You can find the example here.
http://arduino.cc/en/Tutorial/MotorKnob

Rather then using the code in the stepper class, I just started sending values to the pins at different intervals.

Here's a video of it working.
https://www.youtube.com/watch?v=eIfX5nt4FPQ




Here's the code for the arduino.
#####
int mo1 = 8;  //These are the different pins connected to the H-Bridge
int mo2 = 9;
int mo3 = 10;
int mo4 = 11;
int BeatDelay=20;



void setup() {              
  // initialize the digital pin as an output.
  pinMode(mo1, OUTPUT);
 pinMode(mo2, OUTPUT);
 pinMode(mo3, OUTPUT);
 pinMode(mo4, OUTPUT);
}

void loop() {




myBeat7();




}

//This is a function that takes in different intervals.
void stepMyMotor(int mySpeed){
  digitalWrite(mo1, HIGH);   // turn the Motor on (HIGH is the voltage level)
  delay(mySpeed);               // wait for a delay
  digitalWrite(mo1, LOW);   // turn the Motor off (HIGH is the voltage level)
  delay(mySpeed);
    digitalWrite(mo4, HIGH);
  delay(mySpeed);            
  digitalWrite(mo4, LOW);
  delay(mySpeed);
    digitalWrite(mo2, HIGH);
  delay(mySpeed);            
  digitalWrite(mo2, LOW);
  delay(mySpeed);
      digitalWrite(mo3, HIGH);
  delay(mySpeed);            
  digitalWrite(mo3, LOW);
  delay(mySpeed);
  }

//These are the different beats
void myBeat1(){
stepMyMotor(1);
stepMyMotor(100);
stepMyMotor(10);
stepMyMotor(100);
stepMyMotor(10);
stepMyMotor(200);
  }


  void myBeat2(){
stepMyMotor(1);
stepMyMotor(1);

  }

  void myBeat3(){
stepMyMotor(1);
stepMyMotor(40);

  }



    void myBeat4(){
stepMyMotor(1);
stepMyMotor(120);

  }

//To keep the beats within the same intervals, the delays are divisors of each other 80, 160.
      void myBeat6(){
stepMyMotor(1);
stepMyMotor(80);
stepMyMotor(1);
stepMyMotor(160);

  }


      void myBeat5(){
stepMyMotor(1);
stepMyMotor(120);
stepMyMotor(1);
stepMyMotor(30);
stepMyMotor(30);
stepMyMotor(30);
stepMyMotor(30);

  }

  void rev(){
   int i=0;
   while (i<50 p="">     stepMyMotor(i);
     i++;
     }
    }
 
          void myBeat7(){
stepMyMotor(1);
stepMyMotor(120);
stepMyMotor(1);
stepMyMotor(60);
stepMyMotor(60);


  }

Tuesday, April 2, 2013

April Fools Make Cover

I took an old picture that I had and made it into a fake cover for Make Magazines April Fools Cover Contest.
I went with a Star Wars theme and added some wordings to the cover and viola, there you have it.
Enjoy!

Monday, February 25, 2013

LEGO Peristaltic Syrup Pump

As part of Project PancakeBot, I created a peristaltic pump that dispenses syrup onto the pancakes.
The pump is made up of round pieces of LEGO, some electric tape and some surgical tubing.  A bottle sits in the back and the syrup is sucked up and dispensed onto the plate below.
It's quiet a simple contraption but it takes a bit of effort to get the tube to sit in the right place while the rollers squeeze it through.
Instructions will be available as part of the PancakeBot instruction set through IndieGoGo.com/pancakebot2013

Sunday, September 9, 2012

LEGO Pancake Bot @ New York World Maker Faire

Woo hoo! I'm really excited to announce that the Pancake Bot will be making its debut at the World Maker Faire in NYC!  Woo Hoo!


The cool thing was, I was interviewed by Goli Mohammadi of Make Magazine!  How cool is that?
Here's a link to the interview.

http://blog.makezine.com/2012/09/08/maker-faire-new-york-lego-pancake-bot-interview/

So what is up the Pancake Bot these days?  Here's the scoop, or I guess you can say the flip.

The Pancake Bot took a break as we've been really busy with moving into our new house, starting a new job and well, enjoying the summer in Norway.  I learned that Norwegians have a tendency to stop whatever they are doing when the sun comes out!  Well, sort of.  At least for summer.

I've also been helping out at the DevotekBank1 Lab at the Konbsgerg public library.  They got a new 3D printer and CNC machine that I'm anxious to start helping out with and they've agreed to open up the lab after hours for a Maker Space!  More details on that to come later!  The most exciting thing is, the staff Hilde and Bjørn are coming out to New York for the faire and helping out with the exhibit.

So after a summer of fishing, making, building, inventing, destroying and finishing our rental unit #1 at your house, I finally got around to updating the Pancake Bot to make it a bit easier to control.

Still sporting only one LEGO NXT unit and a bunch of pneumatics, the new Pancake Bot now has a dual pump/vacuum capability.  This allows better batter control.  It also integrates the NXT controller into the gantry and uses a centralized NXT motor connected to two long axles and a drive on both sides of the gantry so that gear slipping is reduced to a minimum.
Notice how the motor shaft in the center now drives gears on both sides of the unit.  There's also some additional touch sensors to calibrate the location of the pancake bot.

The Batter dispenser unit now incorporates a pressure gauge, a vacuum and extra compression tanks.


Something about the camera really gets the kids to act funny.  

We'll also be posting up the video of Pancake Bot 2.0 and let's see what shapes I can come up with!

Cheers for now and remember to follow me on twitter @migpics for some cool announcements coming soon.

Anyhow, check us out at the World Maker Faire in NYC on September 29th and 30th.

http://makerfairenyc.eventbrite.com/

I'll do my best to make you some good tasting pancakes!

Mig


Thursday, April 26, 2012

Makerbot visit!

On my way back to Norway from San Diego I had a 27 hour lay over (planned on purpose) in New York City.  While there I took advantage of the time and jetted on over to Brooklyn where I was able to meet Greg Shutack and Bre Pettis from MakerBot Industries.
It was rather a fluke actually because I got this stupid idea to jet on over to Brooklyn from Hoboken New Jersey and meet someone from the MakerBot there.  While trying to find the building I bumbed into this guy on the street with three spindles of ABS plastic and asked him if he could help me with meeting someone there.  it was Greg Shutack the Executive Administrator for MakerBot Industries and he gave me a quick tour of the operations.
While there I was able to meet Bre Pettis and I embarrassingly flagged him down and said hi and told him about my Pancake Bot.
Here is a photo of me and Bre.
 Wow, either I'm really short or he's really tall.
Behind us are loads of Makerbots printing lots of things getting ready for the Maker Faire in San Mateo California.

What is so cool about this is the fact that these guys took a few minutes out of their busy time to say hi and had no problem encouraging me about my projects and chatting for a second.

Thanks Maker Bot Industries!

Sunday, June 26, 2011

How the Pancake Bot Works


The Pancake Bot (PB) is basically a 3 axis CNC made that uses the Z coordinate as the Pancake Batter Dispenser Control. This one just happens to be made out of LEGO.
The Pancake Bot is made up of the following parts:

1.  A set of linked base plates with 3 parallel tracks snapped on.  One track has a bunch of Technic, Gear Racks (1 x 4) riding along top which makes up the X axis.


2.  A moveable bridge that holds one NXT motor on one side and has free rolling wheels on the other.  The top of the bridge uses two tracks covered with gear racks that holds the Pancake Batter Dispenser Unit (BDU).  The track allows for Y Axis Control.


3.  A carrier gantry on top of the moveable bridge that rides on the gear racks and holds the PDU.

4.  The PDU consists of two ketchup bottles cut in half and glued together so you have two open ends.  This allows you to change the nozzle size on the bottom and allows for input of compressed air on top.


5.  Compressed Air Dispersal Apparatus (CADA) consists of an NXT Motor, two Pneumatic Cylinders, a tank and a bi-directional flexible switch.


The bi-directional flexible switch allows for the switch to be flipped based upon which direction the NXT motor turns.  If you notice in the video, on the close up of the motors turning, the cam is switching the flexible switch every time it rotates.  In the initial turn, the switch is flipped and stops and then continues to flex out of the way of the rotating cam.  When the motor turns the other way, the cam catches the switch, flips it back and changes the direction of the airflow.  It continues to flex as the cam passes over it.  This allows for air to be compressed when the motor turns clockwise, and then the air to be released when the motor turns counter-clockwise.
The reason I did this is because I only have 3NXT motors and needed to a way to change the direction of the air flow while at the same time, still compressing air.

The Program
Originally, the goal was to control this with Python NXT, an open source programming interface developed by Marcus Warner and the Python NXT group.  It worked like a charm at first but for some reason, I could no longer communicate with the brick, so I went back to using the less flexible LEGO Mindstorms programming.

The program itself is a variant of the the Etch-A-NXT program found in Extreme NXT, by By Michael Gasperi, Philippe E. Hurbain, and Isabelle L. Hurbain.  The original program just controlled two motors using an external text file.  I modified the program by adding the third motor.

The text file needed to draw with the Pancake Bot uses three coordinates, each with a character return afterwards.

360
2400
-500

This tells the NXT to rotate Motor A 360 degrees, Motor B 2400 degrees, and Motor C 500 degrees conterclockwise.  Depending on which gears you choose, one rotation can equal different numbers of units of movement.
I used the 8 tooth gear which with one rotation, moves 4 standard LEGO units.
Depending on the size of your electric griddle, you can calibrate how big you want your drawings.
A simple program in XL converts the LEGO units into degrees and outputs the text file.

Motor C in this case is the Z axis which controls the BDU.  It also acts as a timer for discharging the batter.

The parts that are exposed to the heat of the griddle are covered with a sheet of aluminum foil during cooking.  This reduces the chance of parts melting.

Making the batter.

The batter is made using Martha Stewart's Basic Pancake Recipe as the base.   I sometimes add cinnamon or different berries for flavors or color.
Once the batter is made it goes through a strainer and all the clumps are removed.  This makes the batter smooth and allows for continuous flow of the batter from the BDU.

Things to work on!
The BDU is not the best design but other attempts were not as successful for batter delivery.  I attempted using a standard RCX motor with a corkscrew that went to a funnel but the corkscrew was not as effective as using air pressure.
A corkscrew discharge would allow for controlled amount of flow vs. the air pressure discharge (10 turns equals 20cc's of pancake batter.  When you use the air pressure discharge you have the additional variable of batter viscosity and so any slight changes in batter recipe modifies the flow speed.
The advantage of the air pressure solution is that you don't need a mechanical means to extrude the batter, so even using a aquarium pump (thanks Bruce Shapiro from Egg-Bot) could be used to control the flow of the batter.

Thursday, March 17, 2011

I made this snow sculpture about a week before the earthquake and Tsunami in Japan but hadn't posted any pictures of it yet. (We wish the people of Japan the best as they face several catastrophes.)

 It's a sculpture of a Valkyrie VF-1S R.Focker Custom Snow Sculpture from the Robotech Macross Saga, a cartoon I watched as a kid.  Maia is standing in front of it for scale.  It's painted with non-toxic finger paint and I shot it in the morning as the sun came up over the horizon.  There are no build instructions for it but I ended up using a broom stick in the torso after the thing fell over twice while I was in the middle of making it.  There is a stick for the gun since it hangs over so much.  Hope you enjoy the photos.  Now it's back to getting Chris-bot and the animation project going again!



This is the non painted version.  I personally like the painted version because the colors really add to the shading of the thing.

Sometimes, it's not cool to mess with a robot.  Don't worry about Maia.  She was outside for 2 minutes and it was nice and warm in the sun.

She just didn't listen when I told her not to play with the robot.
This will probably be my last snow sculpture as the snow is starting to get crispy and not very usable.  I may give it one last shot this weekend, maybe a snow speeder in the woods, or possibly an Imperial tie fighter.
We'll see.