0

Help with possible arduino project
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Help with possible arduino project

by vivalaalec on Wed Jan 28, 2009 10:41 pm

I am currently working on a project for high school. I am making a ping pong robot that has the ability to shoot balls over the net with different spin (top, back and side). I have 2 drive wheels driven by DC motors and a servo that controls the rate at which balls go through the shooting system. We need to be able to control the speed of 2 DC motors and 1 servo motor. We were hoping to have 3 potentiometers, each controlling the speed of one of the motors (but if you have a better idea let me know). Would it be possible to do this with an Arduino board coupled with the Motor shield? Also, do you know if Arduinos boards are capable of having various preset programs that could be activated by pushing a button, or turning a multipoisition switch?
As you can probably tell, I have never used an Arduino board. I have tried finding my answers online but haven't had too much luck.

Thanks for your help
vivalaalec
 
Posts: 3
Joined: Wed Jan 28, 2009 10:36 pm

Re: Help with possible arduino project

by karlgg on Thu Jan 29, 2009 4:58 am

You wouldn't have different programs, just one program with different responses to each setting. (ie, "If switch A, do this...") But anyway, that doesn't sound beyond an Arduino at all.

And yes, a motorshield should work fine for that... You'll probably want to hook a separate power supply for the motors (there's a connector for it on the shield) to keep from giving the Arduino power problems. I'm assuming you're using little 'hobby' motors, and not some 10-pound current-sucking monsters just to shoot ping-pong balls.
I think I am, therefore I am... I think.

karlgg
 
Posts: 212
Joined: Sat Dec 27, 2008 2:41 pm
Location: Anthony, NM

Re: Help with possible arduino project

by vivalaalec on Thu Jan 29, 2009 11:42 am

Yeah, I am using high rpm RC car motors.
vivalaalec
 
Posts: 3
Joined: Wed Jan 28, 2009 10:36 pm

Re: Help with possible arduino project

by vivalaalec on Fri Jan 30, 2009 2:55 am

So I do have another question.
When I am trying to control motor speed for the DC and the servo what is actually being controlled? Would the power to the motor get changed or would something else be going on?
vivalaalec
 
Posts: 3
Joined: Wed Jan 28, 2009 10:36 pm

Re: Help with possible arduino project

by karlgg on Fri Jan 30, 2009 4:20 am

The motorshield instructions say that it controls the DC motor speed via pulse-width modulation (PWM) which basically turns the power on-and-off at various rates. If the "on" part is longer than the "off", the average power is higher and the motor turns faster. If there's more "off" than "on", it runs slower.

The servos have their own controls inside, which try to match the position of the arm with the signal coming in (also PWM). The difference with servos is that the pulse tells them what position to turn to. A longer pulse tells it to point in one direction, a shorter pulse points the other way. If each pulse is the same length, it tries to maintain the same position.
I think I am, therefore I am... I think.

karlgg
 
Posts: 212
Joined: Sat Dec 27, 2008 2:41 pm
Location: Anthony, NM

Re: Help with possible arduino project

by mtbf0 on Fri Jan 30, 2009 9:23 am

karlgg wrote:The difference with servos is that the pulse tells them what position to turn to. A longer pulse tells it to point in one direction, a shorter pulse points the other way. If each pulse is the same length, it tries to maintain the same position.


actually with hobby servos the on pulse will generally be 1 to 2 ms and the off period will be 18 to 19 ms. it is just the length of the on pulse that determines position.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Please be positive and constructive with your questions and comments.