PDA

View Full Version : [Question(s)] 3 uno's one mega now what?



War Wolf
03-13-2014, 11:18 PM
I have an arduino Mega and three arduino uno's a couple of seeed studio motor controller v1's . I was told I could use the arduinos together but haven't a clue how to do so does anyone have any idea how I can do this? Also I have purchased a an airsoft gearbox but am unable to get it to run continuously without it occasionally having to have the power reversed to sort of reset it's gearing. Any help on this would truly be. Appreciated dearly.

War Wolf
03-13-2014, 11:30 PM
As before from a previous thread I am attempting to make a 3 dof quad walker for my son Who has fallen helplessly in love with mech warfare I have created the pan tilt mechanism multiple body and leg designs and many components. Now its time for the brains of this beast.

tician
03-13-2014, 11:51 PM
I responded without refreshing...

If you are using dynamixel servos, you only need the Mega and none of the Uno unless you want them to interface with sensors and/or the motor shield to control the airsoft motor.

If you are using PWM servos, you will probably want to use the Uno's to handle the PWM control for the servos and have the Mega perform all the calculations. This would involve creating a simple sketch for the Uno to take a goal position for each servo from the Mega over the UART and then changing the PWM value for that servo accordingly (basically each Uno would be a homebrew SSC-32).

War Wolf
03-14-2014, 12:14 AM
I was gifted with the Mega and two more uno's as well as the extra motor shield by my son's grandma. I was told using the arduino to power servos could potentially damage them hence the motor shields my goal 3 servo motors per leg varying in size if necessary pan tilt servo motors if possible if not I could adjust for regular motors if needed.. I still haven't planned on how I would have the robot communicate in a wireless manner with my computer but low cost suggestions would be definitely considered. I am very glad that you answered my questions, I am new to the terminology so your meaning is a bit unclear hopefully some surfing on the net will help clarify your response. Again thank you for the assistance.

War Wolf
03-14-2014, 12:29 AM
I am toying with a clear plastic gearbox from cyma I found on a Chinese airsoft website for a bit over $7.00 it is available with shipping for about $15.00 model 022 or 023 on airsoft Asia or airsoft tiger111.

tician
03-14-2014, 01:23 AM
Right. Let's make it very clear: all servos have built-in motor drivers. That is the entire purpose of a servo; if it does not have a motor driver and/or motion controller built-in into it, or always connected to it, then it is not a servo. You do not need a motor shield to control servos. You do need an independent power supply, but you simply connect all ground pins together to keep all control and power signals referenced to the same voltage (0V, ground, GND, whatever name you want).

So, with hobby (R/C) (PWM-controlled) servos, you use an independent 5V or 6V supply (depends on servo model) capable of sourcing several amps: the positive wire of the supply is connected to the +5V/6V pin of the servo, and the ground/negative wire connected to both the arduino ground pin and the servo ground pin. The arduino PWM output/control pin is connected to the servo's PWM input pin. There are plenty of tutorials out there for connecting everything up and using the 'servo' library with the Uno and Mega (not all pins have PWM capability, so achieving PWM on those pins requires lots of processing time and intervention).

The arbotix and several other arduino derivative boards have the three-pin headers required to control servos with an independent power supply selectable for those pin headers (arbotix-M only has 4 PWM pins with an independent supply). There are also several servo/sensor shields available for arduino boards that basically break out all of the PWM pins on the arduino to three-pin headers with an independent connection for an external power supply for the servos.

The motors in airsoft guns should require only a single relay or transistor to drive, because if it is working correctly it should never need to reverse direction. If the motor is requiring direction reversal because it is a really cheap gearbox, then the H-bridge in an arduino motor shield would be very useful. Even if the direction reversal were not needed, a motor shield could be used with the H-bridge only driving the motor in a single direction.

War Wolf
03-14-2014, 06:16 AM
Thank you for helping make things clearer for me I will make attempts to implement your most likely well earned knowledge into my current project. I truly am grateful for your time and am so thank you for your help.

KurtEck
03-14-2014, 09:18 AM
If it were me, with 3dof quad Hobby servos (so at least 12 servos), I would personally use a Servo controller board, like the SSC-32 (http://www.lynxmotion.com/p-395-ssc-32-servo-controller.aspx). It has the power buss and the like and it takes care of lots of details of controlling the RC servos. In Theory the Uno can control 12 servos the Megas up to 48(http://arduino.cc/en/reference/servo#.UyMNKFe1vQs), but this is using the servo library, which uses timer interrupts and the like and my personally experience with doing it this way is you will get a little jitter in the servos as the pulse widths generated are not 100% consistent. (Note: I do have code for hexapods and quads), that go with either configuration.

Now the Robotis servos like the AX-12 that is a different ballgame. The Arbotix works great for this. I have not tried the Arbotix-m, but I am sure it would as well. I also have also used an Arduino Mega to control these. I simply created a cable that connected the RX/TX pins of one usart to each other and then went through a resistor to the data line of an AX cable, which I also connected up the ground. The other side of this cable was plugged into a powered AX hub. Lots of other ways as well.

Good Luck

kgranat
03-19-2014, 12:20 PM
You might take a look at this article from Hack-A Day
http://hackaday.com/2012/08/31/dual-core-arduino-for-more-pins/

Basically they've turned one Arduino into a I2C slave, allowing one central arduino to control another (and possible multiples). Because of the speed if I2C, this might not be the best choice for robotics, but it's an interesting way to connect multiple arduinos together.

War Wolf
03-20-2014, 04:54 AM
That saddens me greatly because now I have to to tell my sons grandma she wasted her money on the boards and shield this probably won't go over well. Thank you for the heads up. My attempts at making a mech warfare robot for my son in a not so costly fashion seem to be in vain. Breaking the bank is not an option but breaking my sons heart definitely seems like its around the corner.

jwatte
03-20-2014, 03:50 PM
You can totally use the boards you have. You can use the motor board as a power on/off switch. The main point is wiring it all correctly.
You can probably get away with just one Uno or one Mega, even, plus the shield. Use the other Uno for the remote control. You'd need to add some Xbees, though.

War Wolf
03-21-2014, 05:37 AM
Thank you for the positive feedback. On a different note I have been looking into the communication portion of this project and have seen the xbee type I did want to know if there are any cheaper alternatives? Again jwatte thank you for your valued input.

jwatte
03-21-2014, 11:01 AM
Two Xbees (series 1) are probably about as cheap as you can go and have it be reliable (although you still need a "explorer" or "shield" carrier)
Alternative options may include:
- nRF24L01 based modules, like http://imall.iteadstudio.com/wireless/im120606003.html (SPI based, not serial-port-based)
- RC plane sender/receiver based controllers, like http://www.spektrumrc.com/Products/Default.aspx?ProdId=SPM5510 (decoding these robustly on an Arduino is a pain)
- WiFi shield, assuming you already have a laptop to do the control from

War Wolf
03-22-2014, 06:08 AM
Nrf24l looks interesting the spectrum is a bit price heavy , thanks for the suggestion with the nrf24l would I require two for my project? Also are two wifi shields necessary? If I only require one I assume it would go inside the project. Thank you again for your help on this subject.

jwatte
03-22-2014, 04:14 PM
The NRF24L is cheaper, but it is harder to program. Yes, you need two: One for the remote control side, and one for the robot side.
For a WiFi shield, you only need one, assuming that the house where you're using this has a WiFi base station (router) that your controlling computer/laptop is connected to.
Again, I would actually recommend the Xbee modules. They are much easier to work with if you're not used to embedded programming.

War Wolf
03-23-2014, 07:56 AM
Thank you again jwatte for the insight. I did happen to see some xbee wifi units and other 2.4 ghz components on a sight called babyhood.com some of the items even in the dollar range! I was curious to know your opinion on the 2.4 pieces also your view on this Bluetooth xbee. Again your help has been great,thank you again.

jwatte
03-23-2014, 01:03 PM
some of the items even in the dollar range

In my experience with those kinds of sites and technologies, you typically get approximately what you pay for.
If the gear is authentic and high quality, then shipping, returns, and support is probably not that great.
But to get to dollar range, you have to compromise both on the gear and on the support...

War Wolf
03-24-2014, 06:19 AM
I understand about the quality I have purchased items from China before to my dismay. My query was as to if it would be possible to use some of the products on the banggood.com site for use in my son and mine's project at least for testing purposes and if I were to try these 2.4ghz units or xbee Bluetooth tooth units how would it be possible to connect them to our current project? Thanks again for the thoughtful responses jwatte.