My daughters and I are building a robotic lemonade dispenser. See photo[img]
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.
[/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.Stepper Shield Lemonade Stand
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper Shield Lemonade Stand
Great project!
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:+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.
Code: Select all
myMotor->step(50, FORWARD, DOUBLE); // rotate 90 degrees
delay(500);
myMotor->step(50, BACKWARD, DOUBLE); // rotate -90 degrees
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.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?
Yes. You can solder headers to the inside row. There are direct connections from there to the corresponding Arduino pins.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?
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
Thanks. Will try these things.
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
Great- we have progress. We just had problems with the appropriately labeled library- now we are rolling. Thanks.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper Shield Lemonade Stand
Awesome. Be sure to post photos!
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
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
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper Shield Lemonade Stand
Beautiful!
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 INTERLEAVE1) 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.
With the V2 shield, you have A0-A3, plus ALL the digital pins available to you. Looking forward to seeing the lasers :)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.)
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
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.
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 (22.19 KiB) Viewed 1347 times
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
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 (21.99 KiB) Viewed 1336 times
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
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?
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 (18.92 KiB) Viewed 1323 times
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper Shield Lemonade Stand
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
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
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?
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper Shield Lemonade Stand
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.
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.
- AlaskaJeff
- Posts: 37
- Joined: Sat Jan 11, 2014 1:29 am
Re: Stepper Shield Lemonade Stand
The lights are now on. Lasers next week.
- Attachments
-
- lemonsign.jpg (25.48 KiB) Viewed 1287 times
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper Shield Lemonade Stand
That is going to be the world's most awesome lemonade stand!
Please be positive and constructive with your questions and comments.