My "MINIRAY" Rov.

What are you working on .... Show off your Rov's Projects here.
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

Successful test dive off the pier today. :D

my compensator works well even in just a few metres of water.
I can see the top side regulator pressure drop as the sub side regulator opens and then rise again once it's compensated.
I also see bubbles for a few seconds as the blow off valve vents when I surface so I'm happy with that.

I need to tweak the coding for my battery gauge a bit as it appeared to go flat quite quickly but in reality it was still fine after an hours dive.

and also need to glue the desicant pack in place as it got in the way of the camera.

visibility was poor today and the fish were keeping their distance, but I got a bit of video and this tube worm was cool to see, it snapped shut when I got too close for it's comfort.

Image
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

Hopefully the last bit of coding done today, although a project is never really finished. :lol:

I realised what I was doing wrong with the battery monitor... I was comparing a calculated integer battery voltage with a float reference voltage. Doh!
ie: comparing 12v with 12.5v and coming up short.
So now I just compare the raw reading from the analog pin with a 3 digit integer representing the reference voltage.
ie: compare 819 which represents 12.0v measured with 853 which represents 12.5v reference. no maths or floats needed. :)

I also replaced my depth sensor with the Honeywell sealed gauge version and re-wrote the code to show decimal metres above 10m depth and whole metres below that. so 3m displays as 3.0m and 30m displays as 30m.

I might integrate an automatic depth holding facility at some point when I work out the maths. :?
But for now I'm done building. it's time to get it wet and do some serious dives.
Roll on summer so I can get the boat out and explore.

I was going to post my final code but it's become so specific to my ROV that it's probably not much use to anyone else.
pm me if you want it though, you might be able to pick bit's out of it for your own projects.
fryslan76
Posts: 290
Joined: Dec 18th, 2012, 4:52 pm
Location: Netherlands

Re: My "MINIRAY" Rov.

Post by fryslan76 »

Nice to see the project in the water, enjoy the dives.
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

Well.... my bidirectional brushed ESC for my vert thruster arrived today, only took 10 weeks to get here.

Image

I hooked it up to my ROV PCB and not surprisingly there are a few problems.
First off you can't calibrate it.
from the online description-
Remarks:
1. When using this product, the remote control throttle stick must be in the middle position, otherwise the ESC cannot start.
OK, fair enough, you can't start it with throttle on, that's to be expected for an RC model. my initialisation routine will sort this by sending a 90 degree command for a couple of seconds at start up.
2. This product does not need to calibrate the throttle stroke. After the ESC starts, if the motor starts to rotate, you can use the remote controller to fine-tune the throttle to stop the motor.
Read this as- you can't calibrate it. :-( so neutral has to be trimmed out.
3. This product is not welded at the factory
erm... I quite glad about that. hahaha...

the other problem is that my max throttle command (up or down) makes it stop. this is also a calibration issue.
I think I can overcome that by tweaking this line in the code but it's going to be fiddly.

ESCV.attach(11,600,2250); //attach the vertical ESC to pin 11 and set min and max pulse widths in microseconds.

ESCV.attach(11,1000,2000); will be a good start, and maybe I can offset these to set my neutral position too.

EDIT- after a bit of tweaking it works.
final settings are-
ESCV.attach(11,800,1900); // neutral = 1350 not 1500 as it should be.
that gives a center detent position on my depth knob/ps2 controller neutral stick position giving no rotation.
well.. almost no rotation, there's a slight jitter as the neutral band of this ESC is very narrow so a tiny movement of the depth pot starts rotation either up or down.

a word to the wise- If I was doing it again I wouldn't use this ESC. it's not great. but it is cheap.

On the plus side, I can now work on my auto depth coding. that'll keep me busy during lock-down.
fryslan76
Posts: 290
Joined: Dec 18th, 2012, 4:52 pm
Location: Netherlands

Re: My "MINIRAY" Rov.

Post by fryslan76 »

Just wondering, how are you going to sort out the issue that when you start up your system. First you send 90 degrees wait a bit and then you have to turn on the ESC. Are you planning on doing that on land and then closing up the ROV or are you adding a relay or an external switch to the ESC which can be fliped on the outside of the ROV?
I have a similair setup and did not make up my mind about this issue.
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

Hi Fryslan.
I don't have a problem with the turn on issue.
I power up everything at the same time, my ROV side nano sends 90 to the vertical ESC for a few seconds during setup (before loop())
during this few seconds it also sends 180, wait, 0, wait, 90, wait. to the axial thrusters to calibrate them.

It then sets up serial comms etc with the other Nano's and gets all it's ducks in a row, goes into loop(), tells me it's ready and asks me to press a button on the controller to start.
At that button push it resets depth to zero and heading reference to zero for my "Home" arrow before allowing thruster commands to be actioned by the ROV.

I got the auto depth working too, on the bench at least, it responds to me sucking and blowing into the depth sensor. the next dive will prove whether I need to tweak the thrust power to maintain depth.
here's the Auto Depth routine that is actioned if the X button on the controller is toggled.

Code: Select all

void Adepth()// holds depth to +/- 17cm
{
if (AdepthCount < 1) //first time only
{
  AdepthRef = DepthVal; // set desired depth to current depth
  AdepthCount ++;
}

if (DepthVal > (AdepthRef+2))// too deep. (2 equates to 17cm)
  {
   ESCV.write(70); //drive up. may need more or less power
  }
else if (DepthVal < (AdepthRef-2))// too shallow. 
   {
    ESCV.write(110);// drive down. may need more or less power
   }
else ESCV.write(90);// neutral.

}  
I would be useful to be able to tweak the set depth while in auto depth mode, I'll have a think about that.
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

That was more simple than I thought.
I can now adjust the desired depth using the up/down arrows on the PS2 controller. :D

Code: Select all

void Adepth() // holds depth to +/- 17cm
{
if (AdepthCount < 1) //first time only after X button pressed.
{
  AdepthRef = DepthVal;
  AdepthCount ++;
}
if (DepthUp)// Up button pressed.
{
  AdepthRef--;// decrease desired depth by 8.5cm
}
if (DepthDn)// down button pressed.
{
  AdepthRef++;// increase desired depth by 8.5cm
}
if (DepthVal > (AdepthRef+2))// too deep. 2 equates to 17cm
  {
   ESCV.write(70); //drive up. may need more or less
  }
else if (DepthVal < (AdepthRef-2))// too shallow. 
   {
    ESCV.write(110);// drive down. may need more.
   }
else ESCV.write(90);// neutral.


}
fryslan76
Posts: 290
Joined: Dec 18th, 2012, 4:52 pm
Location: Netherlands

Re: My "MINIRAY" Rov.

Post by fryslan76 »

That seems pretty simple, I don't know how often you call this routines? If you do it very often you might experience a lot of overshoot. In the water everything reactes a bit slower so use very minimal changes and don't reacte to often.
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

Good point Fryslan.
I call this once every loop of the main code while Auto Depth is active.
I have deliberately opened out the accuracy of the depth keeping to +/- 17cm so it is not trying to react to tiny changes in depth so it shouldn't be bobbing up and down all the time and also kept the throttle low to smooth it out.
I could add a wait time to the routine but that would slow the whole code down, I might need to get creative with a counter and only call it every other pass through the loop.
I'm keen to get it in the water and see how it behaves but Covid is keeping me indoors.
A big tank in the garden would be handy right now.
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: My "MINIRAY" Rov.

Post by bigbadbob »

Unsuccessful dive off the pier today. :|

Image

MiniRay failed to dive.
It seems the new vertical ESC doesn't have enough throttle.
The ROV is ballasted to be neutrally buoyant in fresh water and with the old ESC it had plenty of power to dive in seawater.
but even with a 10mm spanner tyrapped to the skid it was still floating and I didn't have anything else with me to use as ballast.

so...
if I set the min/max pulse widths to give more throttle the ESC stops. it won't accept wider pulse widths.
plan A is to try more ballast and see if I can have a removable seawater ballast clip and cope with less throttle.
plan B is to look at other bi-directional ESC's.

On the plus side, my TMS works well.
It was just knocked together from bit's of my wife's clothes hanger cut down to suit.

Image

I washed and serviced my RIB today too, so I have a boat ready for some serious dives when I get my vert sorted.

Image
Post Reply