Stepper Shield Lemonade Stand

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Stepper Shield Lemonade Stand

Post by AlaskaJeff »

My daughters and I are building a robotic lemonade dispenser. See photo[img]
lemonarduino.jpg
lemonarduino.jpg (12.76 KiB) Viewed 1416 times
[/img]. The cup moves down the rails, powered by stepper 1. When it gets to the end, stepper 2 lowers the sensor into the cup (we are experimenting with sensors- thermistor, electrodes, lm35). When the cup is full, the sensor is lifted out by stepper 2, and stepper 1 takes the cup back to the 'customer'. Our mechanics are good. Don't make fun of our welds.

Previously we successfully powered the cup with an easy driver(after cooking one), but we switched to the adafruit stepper shield, because shields are cool, and blue is better than red etc etc. We've never used a shield.

We put the shield on and loaded some test code and nothing happened (that has vast possibilities and we'll work on it). For external stepper power we used a 12 v 2amp. As a test we put the easy driver back in and that doesn't work anymore. But other aspects of the arduino still work (we were playing with the lm35 on a serial port)

Starting questions.

1) what is the easiest way to make the adafruit shield execute something super simple (go 90 degrees wait 500ms go -90) to get started.

2) our adafruit steppers have green, yellow, red and grey wires, but another stepper has green, yellow, red and blue. Is the grey and blue the same?

3) our machine will use several sensors- do we put in headers on row inside of the shield pins to use the pins? For example, if we want to use analog 0 and 5v for a temp sensor, we can solder in headers on the inside row and use them per usual?

Thanks.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper Shield Lemonade Stand

Post by adafruit_support_bill »

Great project!
1) what is the easiest way to make the adafruit shield execute something super simple (go 90 degrees wait 500ms go -90) to get started.
You didn't say which stepper you are using. But assuming it is a 200 steps/revolution motor, the code would look something like this:+

Code: Select all

  myMotor->step(50, FORWARD, DOUBLE);   // rotate 90 degrees 
  delay(500);
  myMotor->step(50, BACKWARD, DOUBLE); // rotate -90 degrees 
2) our adafruit steppers have green, yellow, red and grey wires, but another stepper has green, yellow, red and blue. Is the grey and blue the same?
Unfortunately, there is no real standardization on wire colors in the stepper industry. The simplest way to identify the wire pairs on a 4-wire motor is to measure the resistance. If there is no conductivity, the wires belong to different coils.
3) our machine will use several sensors- do we put in headers on row inside of the shield pins to use the pins? For example, if we want to use analog 0 and 5v for a temp sensor, we can solder in headers on the inside row and use them per usual?
Yes. You can solder headers to the inside row. There are direct connections from there to the corresponding Arduino pins.

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

Thanks. Will try these things.

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

Great- we have progress. We just had problems with the appropriately labeled library- now we are rolling. Thanks.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper Shield Lemonade Stand

Post by adafruit_support_bill »

Awesome. Be sure to post photos!

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

Lemonadestand.jpg
Lemonadestand.jpg (24.98 KiB) Viewed 1360 times
Lemon-bot
Lemon-bot
Lemon-bot.jpg (22.78 KiB) Viewed 1360 times
The Motor Shield rules. We have both Steppers functioning and getting the cup and sensor where they need to be. Soon we will add the spigot and figure out the sensor code. The stepper that moves the cup is a bit slow and jittery. When we used the EasyDriver the movement was smoother (we are not plugging that product- the EasyDriver is like a red rose- its beautiful and elegant, but after not to long it dies. We have a small pile of dead red.

The stepper that moves the cup down the rails is myMotor2 . This skeletal framework gets the cup down the rail, the sensor goes into the cup, lifts out of the cup, then brings the cup back. We are still geeking out on the sensor configuration.

myMotor2->setSpeed(1000);
myMotor1->setSpeed(120 );
}

void loop() {

myMotor2->step(3725, FORWARD,SINGLE);
myMotor1->step(60, FORWARD, MICROSTEP);
delay(500);
myMotor1->step(60, BACKWARD, MICROSTEP);
delay(500);
myMotor2->step(3725 ,BACKWARD,SINGLE);
delay(500);
}

1) Is there a way to make my motor2 faster and smoother. What are the limits on the rpm? We tried microstepping, but that was way too slow. The current arrangement is acceptable, but we are striving for excellence.

2) Our understanding is that we have pins 0-6 left to use with the Motor Shield on an UNO. Is that true? Other than going to a Mega is there a way to get more pins? We are going to want to drive the LEDs in the sign (via relays), and add laser treatment to the lemonade (seriously, lasers go good with everything.)


Thanks

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper Shield Lemonade Stand

Post by adafruit_support_bill »

Beautiful!
1) Is there a way to make my motor2 faster and smoother. What are the limits on the rpm? We tried microstepping, but that was way too slow. The current arrangement is acceptable, but we are striving for excellence.
You didn't say what motors you are using. 1000 RPM is pretty fast for most steppers. Most will skip steps and run rough if you try to step too fast. I'd start slow and work your way up to find the max speed. SINGLE will be the roughest stepping mode. And will also have less torque than DOUBLE. I'd suggest DOUBLE or INTERLEAVE
2) Our understanding is that we have pins 0-6 left to use with the Motor Shield on an UNO. Is that true? Other than going to a Mega is there a way to get more pins? We are going to want to drive the LEDs in the sign (via relays), and add laser treatment to the lemonade (seriously, lasers go good with everything.)
With the V2 shield, you have A0-A3, plus ALL the digital pins available to you. Looking forward to seeing the lasers :)

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

Thanks. Glad to know we have the extra pins.

The face of the lemonade-stand industry is undergoing active, tectonic, alterations...

No child will ever be able to sell Country Time on a cardboard box again. And that's a good thing.
Attachments
lemon-bot 2.jpg
lemon-bot 2.jpg (22.19 KiB) Viewed 1347 times

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

We now have reliable liquid delivery. The Stepper Shield is great- no problems whatsoever. Will stack our second shield to position the lasers.
Attachments
lemon-bot 3.jpg
lemon-bot 3.jpg (21.99 KiB) Viewed 1336 times

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

We have the lemonade delivery working. Now we want to stack another adafruit motor shield to position and aim the lasers at the lemonade as it comes back down the conveyor belt. We are constructing the scaffolding. One stepper will rotate the lasers into position above the conveyor, and a second other will rotate the lasers in an arc above the moving cup (the trig will be fun). There are lots of instructions for stacking the motor shields, and we will figure it out. We will trigger the lasers using digital pins run through relays to deliver the 2 X AAA battery power to each laser (there will be three).

We have a question.

1) We want laser sounds. We have the Adafruit Wave Shield- can we stack that on top of the motor shields?
Attachments
Laser Scaffold.jpg
Laser Scaffold.jpg (18.92 KiB) Viewed 1323 times

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper Shield Lemonade Stand

Post by adafruit_support_bill »

The wave shield should stack. It will be a challenge getting it to play sounds while stepping motors though. The "Music Maker" shield is a bit less CPU intensive. https://www.adafruit.com/product/1788

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

For the desired effect, will need to move the conveyor belt, move the laser (and calculate where), and play a laser sound when each laser shoots. The MP3 shield is cool in its own right. But would two motor shields and a Wave on a Mega work better? Would the Mega have speed and power to do all three?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper Shield Lemonade Stand

Post by adafruit_support_bill »

The Mega is no faster than an UNO. It just has more memory and pins. The problem I see is that the motor shield is going to be I/O bound trying to step all those motors via i2c. I expect that the i2c communication will contend with the timer interrupts for the DAC on the wave shield.

If I were to do it with the VS1053 shield, I'd program my laser shots as MIDI samples which could be triggered on the fly with very little overhead on the Arduino side.

User avatar
AlaskaJeff
 
Posts: 37
Joined: Sat Jan 11, 2014 1:29 am

Re: Stepper Shield Lemonade Stand

Post by AlaskaJeff »

The lights are now on. Lasers next week.
Attachments
lemonsign.jpg
lemonsign.jpg (25.48 KiB) Viewed 1287 times

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper Shield Lemonade Stand

Post by adafruit_support_bill »

That is going to be the world's most awesome lemonade stand!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”