Go Down

Topic: Arduino controlled ROV (Read 2325 times) previous topic - next topic

SKY

Dec 18, 2010, 04:47 pm Last Edit: Dec 18, 2010, 04:48 pm by SKY Reason: 1
Hey all
Im currently building a rov and am considering using a arduino to control it. I was considering the Uno since this is the only 1 available here :)
but since im new to all this i still have some questions

1.Can a arduino Uno control 4 brushless esc's + motors and 4 relays at once? (motors and relays have to all be separatly controllable). Does the uno have enough channels/outputs to control all these functions at once. Would there still be ports open to control more functions?

2.Would i need some kind of shield to run the esc's and motors or can they be connected directly to the Uno?

3.Could i control the motors via a joystick connected to pc with usb(for variable speed)

4.Probably a stupid Q but the arduino cant be used when not plugged into a pc right? :)

If someone could help me here i would really appreciate it
Thanks
Philipp

Sorry if some of the questions are stupid, im still new to all this :)

jada

Quote
.Can a arduino Uno control 4 brushless esc's + motors and 4 relays at once? (motors and relays have to all be separatly controllable). Does the uno have enough channels/outputs to control all these functions at once. Would there still be ports open to control more functions?

YES ARDUINO MAKES IT POSSIBLE  :D
Quote
Would i need some kind of shield to run the esc's and motors or can they be connected directly to the Uno?

well the ESc's wont need a sheild
But the motors need one ( consider building one your self )
Quote
3.Could i control the motors via a joystick connected to pc with usb(for variable speed)

YES
Quote
4.Probably a stupid Q but the arduino cant be used when not plugged into a pc right?

YES

HOpe this helps ;)

Groove

#2
Dec 18, 2010, 04:53 pm Last Edit: Dec 18, 2010, 04:54 pm by GrooveFlotilla Reason: 1
Motor speed and direction  for all four motors?

Of course you can use an Arduino when it isn't conneccted to a PC - there wouldn't be much point in it if you couldn't!
Per Arduino ad Astra

SKY

Thanks for the replies  :)

The esc arent reversible so the motors would only have to be controlled in 1 direction.

when the arduino is connected to the pc can it recieve instructions from the pc though like pressing keyboard button turns on motor connected to the arduino ect?

Would the coding for something like this be hard to create (I already know loops and some other basics)
Thanks Philipp


Groove

You can talk to the Arduino directly using a terminal emulator, or the IDE's serial monitor, or you could create an app in Processing, or VB or...
Per Arduino ad Astra

SKY

#5
Dec 18, 2010, 06:26 pm Last Edit: Dec 18, 2010, 06:29 pm by SKY Reason: 1
So i can either control the arduino via the pc fuctions such as mouse,joystick and keyboard when its plugged into the pc (im guessing this is the better option if the system doesnt have to be portable and has lots of motors, relays that have to be controlled)??? :-?
If it is coded to recieve input from the pc i cant use it without 1 unless i modify the program right?

or download the program and use it on the go. and In this case how do you control it (just switches ect?) or is the on the go more for autonomous projects such as robots, bots ect that mainly control themselves with sensors ect?
Thanks
Philipp

zoomkat

Just some general comments:

Use the board search function at the top of the page and search for ROV. You will probably get a half day's reading with some project links.

ESCs are usually controlled via the same PPM control that servos use, so the servo library probably can be used. Note that the ESC may need to be armed for it to work, and an external power source wil be needed.

Relays can be controlled via the digital I/O pins. Note that relays can't generally be powered from the arduino.

There are different ways to interface with an arduino, including applications on a pc, and via a web page when an ethernet shield is used.

Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

SKY

Thanks
Ive already seen schematics for the relays. So i will need 1 digital pin per relay
and to control the esc will be 1 analog pin for the pwm and the other 2 esc cables will go to the power supply (directly to battery or psu)
Is that correct?
And it is possible to make a pc gui via which you can control the arduino is that correct?
Sorry for all these questions :)
Thanks


SKY

#8
Dec 19, 2010, 09:39 am Last Edit: Dec 19, 2010, 10:01 am by SKY Reason: 1
Hey
i was hoping someone could help me with this:
What is the maximum amount of servos/esc i can control individually with a arduino duemilanove

*Btw should i rather get the duelianove or the mega (need to control 4 esc's and 4 relays )
Thanks for the help
Philipp

PaulS

Quote
What is the maximum amount of servos/esc i can control individually with a arduino duemilanove

The answer is either 2 or one per pin, depending on what else the Arduino is doing.

If the Arduino is doing things that require disabling interrupts for periods of time (no matter how small), the Servo2 library needs to be used. It does not use hardware capabilities to do the pulsing, but it can only manage two pins.

If the Arduino is not doing things that disable interrupts, the Servo library can be used. The Servo library does use hardware capabilities, and, as a result, can drive a servo on each pin.

NewSoftSerial does disable interrupts, so if you are using it, you are limited to two servos, on the Duemilanove and similar one hardware serial port models.

Because the Mega has 4 hardware serial ports, NewSoftSerial is generally not needed on the Mega, so it can control lots of servos.

SKY

#10
Dec 19, 2010, 04:13 pm Last Edit: Dec 19, 2010, 04:16 pm by SKY Reason: 1
Thanks for the Info PaulS :)

So just to be sure before i buy 1
to control 4 brushless esc's withs motors and so that each one can be individually varied from stop to full throttle
and to power 5 relays (on/off)
the duemilanove will be enough or would i have to get the mega?

Thanks for all the help so far, sorry if half my questions seem stupid lol ::)

Philipp

PaulS

Yes, the Duemilanove, or Uno, would be enough. You need 4 pins for the servo/ESCs and 4 pins for the relays. You have more than enough.

However, doing something with those servos and relays, when the PC is not providing instructions, may require other sensors that will also require pins.

SKY

#12
Dec 19, 2010, 05:03 pm Last Edit: Dec 19, 2010, 05:05 pm by SKY Reason: 1
Thanks so much man :)
Im planning to have it connected to the pc and then use a joystick or gamepad as inputs so that
all the instructions and inputs would be sent over the usb cable so no pins are neccesary for input then?
This should work right? or do the inputs have to be connected directly to the arduino

Thanks for all the help :)
Philipp

PaulS

You won't be able to read the joystick position from the Arduino, unless the joystick is connected to the Arduino.

But, you can have an application that runs on the PC that the joystick is connected to that sends serial data to the Arduino, whenever a change in the position of the joystick occurs.

This will not be as fast as connecting the joystick to the Arduino, but it can work. Minimizing the amount of data sent is essential, as is clearly defining the boundaries and intentions of a packet.

The serial data can consist of the joystick value as a string (<U:1020>) that the Arduino needs to parse and convert to an integer that it then converts to a servo angle, or as a string <U:120> that the Arduino needs to parse and convert to an integer that IS the servo angle, or as a byte <U:xxx> that needs only to be parsed, and already IS a servo angle.

Each method has advantages and disadvantages. The raw joystick value means that the meaning of that data is entirely in the Arduino code. The servo position as a string is easy to process and verify on both ends, but it means that the PC is doing most of the work. The servo position as a byte is the quickest to transmit, but the hardest to debug.

SKY

#14
Dec 19, 2010, 06:16 pm Last Edit: Dec 19, 2010, 06:58 pm by SKY Reason: 1
Thanks

That was a very helpful post :)
So to use the joystick I would have to use a program to "bridge" the arduino and the joystick signals. What program could i use for this

Thanks
Philipp

Go Up