New ROV - The Mimee

What are you working on .... Show off your Rov's Projects here.
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

Hey Everyone,

Great to see you are all making sound progress :)

Since it's been a couple of weeks since my last post, I thought give you all an update on 'The Mimee'.

I've received a heap of parts I'd been waiting on included the Max488 chips for my duplex comms between the arduino's. I ended up swapping out the land side Arduino Uno, with another Arduino Mega which has also arrived. I haven't conducted any testing yet.

I've now got the couplers (universal joints) for the main thrusters so I can now connect the drive shaft to the motor, all the way through to the new props that have now also arrived. Finally, the whole assembly is sound and I've just got to finish the aluminium casings that I've shown in earlier pics. The only thing I haven't completely decided upon is the shaft seal. I've got some rubber grommets, after reading somewhere that they will do the job just fine (but will require regular replacement). It just doesn't sit well with me though, and so I've ordered some flanged bearings which I might get a decide watertight seal on. Its something I'm excited about experimenting with, knowing full well that if the housing floods, it only contains the motor that can run open anyway. It's still my intention, however, to find a solution for running the thrusters dry and I'll put some honest time and energy into it once I make more progress on the rest of the project.

I've also got an Amp Meter for monitoring during mission, voltage LED display for my test-bed, prototype board for putting everything together neatly, and the servo's also arrived for the tilt/pan for the camera. They are all sitting there waiting for me to roll up my sleeves.

Lastly, the digital compass arrived and i got it set up quickly. I didn't realize, however, that as soon as the ROV is not level, the compass will no longer be accurate. So now I need to set up tilt compensation, and have ordered an accelerometer.

So I was waiting on parts arriving but now I just have to make the time to sit down and make some more progress.
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

Wow - How quickly time goes by! Merry xmas to everyone who celebrates :)

SO after a few months on the sidelines the ROV project is back out again so i look forward to a few more regular posts. I've been caught up with other projects, but I've just decided that I have to make time for 'The Mimee'!

So I've pulled in the test bed, and look forward to uploading the Arduino code and testing the latest revision, after remapping ESC values and control values. I've also got the code written for 3 temperature sensors, and one has already been mounted in the right motor housing. I'll upload a photo when i get the chance. My next step is to run some tests with the completed motor housing and ensure everything is working as it is supposed to before completing the second motor housing which is 3/4 done. I'm also looking at using lipo's instead of lead acid battery's due to the weight and space it would save. It also seems easier to run some 2s and 3s as required, rather than a couple of 12v batteries with a few regulators stepping down voltage as required. I should really spend a few minutes drawing up a circuit diagram.....

Hope everyone is progressing well :)
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

Its great to have pulled the ROV out again after another break. Since my last update, I have completed the internal motor chassis that fits inside the semi-complete pvc watertight compartment. I say, 'semi-complete' because it is not yet watertight. I've got a flange bearing on the end which i suspect will leak water but I wanted to complete the rest of the housing before water testing. I have an alternative to the flange bearing if it fails, using magnets in a clutch like fashion. I'm sure its been done before but i did a quick sketch that looks sound if i need to use it.
DSC00311.JPG
DSC00311.JPG (175.95 KiB) Viewed 4143 times
DSC00313.JPG
DSC00313.JPG (214.5 KiB) Viewed 4143 times
I got to test the code I'd fixed last time and made adjustments to cater for the massive neutral position that I get when my left and right analogue stick is supposedly in the middle (neutral position). The vertical movement is great but when i tested reverse, i came across a problem. I'm not sure if its a mistake in coding, or if I'm taking the wrong approach. Here's the issue:

When the Left Stick is UP (LY=0) (LX=Neutral) left and right motor speed is full forward and all is well
When the Left Stick is DOWN (LY=255) (LX=Neutral) left and right motor speed is neutral, instead of full reverse. EEK.

Using serial.print: it appeared that the Left Stick being straight down satisfied the argument to create full reverse, but I noticed that LX being neutral would also be telling the motors to stop. I'm not sure why this is only happening in reverse, because the logic should apply in all directions. That is, that when I push forward on the left stick, the LX (left and right axis) is neutral, sending a signal to the ESC to stop the motors. It doesn't seem to be the case but i won't be able to bench test it until my new ESC arrives. As its coming from Hong Kong, i might have to turn my attention elsewhere for a couple of weeks.

But to address the above, is this an error I've created in the code? (I know its tricky to tell without me presenting the code)
Is it a limitation created by only having two motors that are responsible for both forward, reverse, and left/right movement? ie, because diagonal positions satisfy more than one condition, on one motor.
Or do i need to take a different approach with my code, like I've seen elsewhere (Ryan) where zones of the controller are assigned to a specific ESC response?

I guess I'll sleep on it. I thought it might have been an issue with the LY and LX coming from the same stick, but then pondered that if I used the buttons, the same thing would happen? because if button not pressed created neutral (motors off), then when i press one button, the other three will be creating a motor off scenario. I'm sure I've got this all wrong and can't wait for someone to correct me :)
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

Epiphanies come at the strangest times....lol. I was cooking stir-fry and not even thinking about the ROV when my solution popped in my head.

As I mentioned in my first post, I'm new to this whole field so common sense doesn't apply to me because I haven't learned it yet :P So I believe that I could have added a motor and that would have sorted out the issue, purely because I wouldn't be using the same motor for both forward, reverse, and turning. But I knew I'd made a mistake in the code, and I didn't want to change the whole design of the ROV just because I was making a fundamental mistake in programming. I realised that I needed to stipulate that my neutral condition could only be met if LX & LY were centered. My code was stating that individually, but unfortunately satisfying two conditions at the same time. It seems simple enough now but it had me stumped :) Don't you love it! I won't geek out anymore, but am happy to explain this mistake in more detail if anyone thinks they'll benefit. I realise its a noob mistake though, so I'll leave it at that.

I'm waiting on a replacement ESC before I can physically test the new code I haven't written yet. That's the next step. Of course I'll be able to test the code using serial.print

My 2 cell 3300maH lipo arrived so I'm looking forward to setting up my test bed again, and getting rid of the lead acid battery for now. I was reluctant to use Lipo's for this project because I had no experience with them, but after buying a RC Plane and getting a bit of confidence with Lipo's, I'll be running with them instead and saving some weight and space.
Zaibach
Posts: 48
Joined: Aug 13th, 2013, 9:50 am

Re: New ROV - The Mimee

Post by Zaibach »

Just wondering if you are using functions since you said you were really new to programming. If you aren't they can really help you compartmentalize your code and make it a lot easier to read through at the same time.
User avatar
KDM
Posts: 14
Joined: Aug 27th, 2012, 5:06 pm
Location: Northern Ireland

Re: New ROV - The Mimee

Post by KDM »

Looking good. What are the bolts around your arcrylic faceplates bolted to? Have you glued a flange onto the pipe? Mine also has a gasket made from a car inner tube. Fantastic stuff, inner tube.
a_shorething
Posts: 289
Joined: Sep 10th, 2013, 5:26 pm
Location: New Jersey Shore

Re: New ROV - The Mimee

Post by a_shorething »

I can understand what you were doing with the code and if I may make a suggestion, you might want to try a case statement that will compare all pertinent inputs and put you in a specific part of the code (or call a procedure and pass parameters) depending on the inputs.

As you mentioned, the status of BOTH X and Y are important when determining what to send to your motors. I did this in my code (more or less).

(assumes X and Y input of -100 to 100 where -100 is 100% left or down, and 100 is 100% up or right.
get X input
get Y input
deadspot range= 6 (or whatever)

case abs(X)<(deadspot range) and abs(Y)<(deadspot range)
zero out all motors, no imput
case X>(deadspot range) and Y>(deadspot range)
Do something that is desired when the stick is in the top right quadrant
case X<(deadspot range) and Y>(deadspot range)
Do something that is desired when the stick is in the top left quadrant
case X>(deadspot range) and Y<(deadspot range)
Do something that is desired when the stick is in the lower right quadrant
case X<(deadspot range) and Y<(deadspot range)
Do something that is desired when the stick is in the lower left quadrant

endcase

In this scenario you are polling the X and Y on each loop and sending the input to the motor each time based on the current status, but you're considering the combination of the inputs before you do anything. In a case statement the first option that is 'TRUE' is the one that's done and only one option or choice will be executed as you pass through each loop, so the options should go from more specific or 'default' to more general and not the reverse.

*You would need to account for one of them being in the deadspot range and the other not as well, and might also want to compare current to previous state for each one, but I'm sure you get the idea.
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

Zaibach wrote:Just wondering if you are using functions since you said you were really new to programming. If you aren't they can really help you compartmentalize your code and make it a lot easier to read through at the same time.
Thanks for the feedback :) You're absolutely right. I'm not using functions and don't really know what they are so I'll be busy googling!
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

KDM wrote:Have you glued a flange onto the pipe?
Absolutely right, KDM. I found a flange that fit nicely inside the main compartment. I think I got the inner tube idea from this forum! but might make up a aluminium plate to act as a giant washer behind the flange, as its a little on the thin side. I'll obviously know for sure when I do some water testing!
Tal
Posts: 47
Joined: Feb 7th, 2013, 8:10 pm

Re: New ROV - The Mimee

Post by Tal »

a_shorething wrote:Lots of really useful information
Thanks so much, a_shorething! I didn't quite realise that once a condition had been met, that it completed the loop. I really am still a beginner :) and your feedback has helped heaps.
Post Reply