
olegodo
Hi.
I am curious if the EZ-Robot hardware and software might be a good solution as a control system for my underwater ROV that I am building.
Although I have tried to create something using arduino myself, the programming is really a steep learning curve for me.
I will be running a wired Ethernet connection from the surface and have a wifi hot spot in the rov to allow connection to the bv4.
It must control 9 brushless esc's. 6 for movement (thrusters) and 3 for a robotic arm. Also one servo for moving the camera vertically. The esc's use the same signal as servo's do, so I don't think this will be a problem.
I will also need to control 3 relays.
I have this unit for sensing battery voltage and current draw:
https://www.coolcomponents.co.uk/attopilot-voltage-and-current-sense-breakout-180a.html
This can be connected to the ADC pins correct? This is made for 3.3volts, but can it still be used maybe?
I have this IMU from OpenROV that I want to use:
http://store.openrov.com/collections/frontpage/products/openrov-imu-depth-module
I see there already is support for the MPU-9150 chip. But is it possible to also get the depth and temperature rating from the MS5803-14BA chip?
I want all to be controlled with a gamepad/joystick. This means that multiple motors must react differently to stick movements. For instance, if I want the ROV to turn in place. 2 motors must turn clockwise and two counterclockwise.
Would all this be possible to do?
Br
Ole
I think Alan was referring to my thread as I had a very similar issue. There are different kinds of relays like latching and toggle ones (which sounds like what you need), and the one I was using had the same problems as what you're having.
Richard R very kindly linked to a relay brick that is fairly cheap, and is simple plug 'n' play with a 5v regulator to a digital port, and this relay works really well using SET(D0, ON and SET(D0, OFF commands.
Hope that helps.
Alan
I read your thread @Steve G , and I have the exact same relay that you had problems with.
Should have been able to find this if I only did a search in the forums I guess *eyeroll*
So, either buy new relays or use a logic converter right?
Or might it be possible to get it to work using a pull down resistor on the signal pin?
I can now switch on and off my relays!
More questions though.
I have it set up so that button one on my game pad executes "Set(D20,ON)" and button two is "Set(D20,OFF)" This works fine.
But from what i read the "ToggleDigital" command should do the same job with only one button right? Pressing it once should turn the relay on D20 on, and pressing the button again should turn it off?
I tried this and it seems to work some times but not reliably.
Maybe I need to add something more to the script for the button to make this work?
Aslo, perhaps it is possible to have one button turn on/off multiple relays one after the other?
For instance. First button press turns on relay 1. Second press switches relay 1 off and turns on relay 2. Third press turns off both off. Press the button a fourth time and the cycle starts over.
If anyone can point me in the right direction for doing this it would me much appreciated!
BR
Ole.
Let me know if that isn't enough to get you on the right track and I'll write upba sample script.
Alan
@jstarne1 not quite sure what you mean. "tip 120"?
For the toggle command. could it be that I need to ad some delay for it? Or a way to ensure that it only toggles once per button press?
Not sure about toggle command. I haven't used it much.
Alan
After spending more time on the hardware side I am now tinkering with using the EZb to control everything. More specific the thrusters.
I want to use what is called a vectored thrust setup.
As you can see in the far right example in the picture below, this setup uses one motor/thruster in each corner of the craft. All on the horizontal plane, but at an angle.
What this allows is for greater maneuverability in all directions on the horizontal plane and more or less equal power in all directions.
I have tried to set this up on my test bench now using the joystick module, a 360 controller and Multi servo for each axis.
I have set up so that the left stick on the controller moves the craft (spins the motors correctly on my test bench) forward when I push the stick forward (Y axis)
And pushes the craft left and right along the X axis when I move the left joystic in the X axis. Good stuff.. simple.
But I then want to turn the craft left and right with the right stick. (X axis on "Joystic #2") This is easy to do on its own. same way as I already did with the other stick, only reverse two of the motors and the craft would turn around its own axis.
My problem is that I also need to turn it while moving forwards, backwards or sideways. This doesn't seem to work properly with this approach.
If I'm moving forward and then turn using the right stick, all motors starts to respond to the right stick and ignore the command from the left. So the craft would stop moving forward and then turn.
Does anyone have any idea if it is possible to make this work in some way?
All suggestions are more then welcome!
And I am aware that all off this might be impossible to understand only by reading this, so if you don't get it, let me know and I will try to explain better.
I have looked at the roli code and searched a bit for something like this, but haven't found anything that does this yet.
Any suggestions?
Instead of a rudder you could have the thrusters turn like a rudder, but that approach would complicate things a lot.
This video shows this type of propulsion in use.
What is teh EZ-Script equivalent command for arduinos "map" command?
For instance if I want to take the joysticks -1 to 1 range and map it to 0-180 servo pos in a custom script?
Claus (Hadeland)
-or-
easier, assign the joystick to use a Virtual servo (v0-v99). And in code, simply get the virtual servo value. That way you can let the joystick control servo handle the range.
Code:
Because of "real life issues" of buying a new home and moving I put the whole project on hold and during that time I bought a different control solution that is made for ROV use. That system will go in my ROV and my Ez-b is now the heart of my recently built, fully automatic tennisball launcher for my dog. Way overkill to use the ez-b for that. But since I already had it and it so easy to setup I figured why the hell not. Will post pictures and video of that thing later at some point.
Glad my explanation helped! Simply set any servos for virtual, and you can receive their values in code. Just remember, if you use the same virtual servo in more than one place it will be overwritten.