KR2 ROV

What are you working on .... Show off your Rov's Projects here.
Bindo
Posts: 112
Joined: Apr 7th, 2015, 4:42 pm

Re: KR2 ROV

Post by Bindo »

Hi Ryan,

Hopefully you can access this, it's a spreadsheet utilizing my calcs, if you change the numbers in the bottom section you should see the results at the thrusters

https://drive.google.com/file/d/0Bw71Vt ... sp=sharing
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: KR2 ROV

Post by KR2_Diving »

Got the spreadsheet! Thanks!

Just to verify... Surge and Sway are X and Y axis respectively?

Surge = Up / Down Axis
Sway = Left / Right axis
Heading = ? what am I missing...

Correct?

(Side Note: I've only managed to get one cup of coffee in me at the moment... and I am at work... )

Edit 2: Oh Duh! Now i get it! Read all the post Ryan... read ALL the post... then open mouth... off to the coffee machine now...
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: KR2 ROV

Post by KR2_Diving »

Coffee has kicked in! Thought of a way to clean up this code even more! Have you considered the constrain function

Current Code:

Code: Select all

    //Take joystick values and mix to give vectored output.....

    STBDFOR   = (rxdata.surg - rxdata.sway - rxdata.head + 180);      //  See spreadsheet for calcs and results
    STBDAFT   = (rxdata.surg - rxdata.sway + rxdata.head);            //
    PORTAFT   = (rxdata.surg + rxdata.sway - rxdata.head);            //
    PORTFOR   = (rxdata.surg + rxdata.sway + rxdata.head - 180);      //


    // Thruster calcs would result in out of range results, restrict calcs to servo range
    if (STBDFOR > 179)   {
      (STBDFOR = 178);
    }
    if (STBDFOR < 1)     {
      (STBDFOR = 2);
    }

    if (STBDAFT > 179)   {
      (STBDAFT = 178);
    }
    if (STBDAFT < 1)     {
      (STBDAFT = 2);
    }

    if (PORTAFT > 179) {
      (PORTAFT = 178);
    }
    if (PORTAFT < 1)    {
      (PORTAFT = 2);
    }

    if (PORTFOR > 179) {
      (PORTFOR = 178);
    }
    if (PORTFOR < 1)   {
      (PORTFOR = 2);
    }


    // Write commands to ESC's after mix calcs

    stbda.write   (STBDAFT);
    stbdf.write   (STBDFOR);
    porta.write   (PORTAFT);
    portf.write   (PORTFOR);
    verta.write   (rxdata.dept);
    vertf.write   (rxdata.dept);
//  manip.write   (rxdata.jaw);

New Code:

Code: Select all

//Take joystick values and mix to give vectored output.....
 STBDFOR   = (rxdata.surg - rxdata.sway - rxdata.head + 180);      //  See spreadsheet for calcs and results
 STBDAFT   = (rxdata.surg - rxdata.sway + rxdata.head);            //
 PORTAFT   = (rxdata.surg + rxdata.sway - rxdata.head);            //
 PORTFOR   = (rxdata.surg + rxdata.sway + rxdata.head - 180);      //


//Thruster calcs would result in out of range results, restrict calcs to servo range
 STBDFOR = constrain(STBDFOR, 2, 178);
 STBDAFT = constrain(STBDAFT, 2, 178);
 PORTFOR = constrain(PORTFOR, 2, 178);
 PORTAFT = constrain(PORTAFT, 2, 178);
 
//Write commands to ESC's after mix calcs
 stbda.write   (STBDAFT);
 stbdf.write   (STBDFOR);
 porta.write   (PORTAFT);
 portf.write   (PORTFOR);
 verta.write   (rxdata.dept);
 vertf.write   (rxdata.dept);
Bindo
Posts: 112
Joined: Apr 7th, 2015, 4:42 pm

Re: KR2 ROV

Post by Bindo »

Hi Ryan.

Yeah I'd only stumbled across constrain after I'd written the code (hence never bothered to implement it yet :lol: ). That looks a lot cleaner though! I'll be implementing that in the next version of my code.

Thanks!

Bindo
HwT
Posts: 1
Joined: Jul 16th, 2015, 10:22 am

Re: KR2 ROV

Post by HwT »

I want to use this with ethernet, how do i go forward?
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: KR2 ROV

Post by KR2_Diving »

HwT wrote:I want to use this with Ethernet, how do i go forward?
I have not played with Ethernet much... in which way do you mean that you want to use this with Ethernet? If you are talking for the tether.. i would think you would just have to look at the code regarding the RS485 coms... and replace this with the data handling code for the Ethernet coms... see the EASY TRANSFER section of my code...
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: KR2 ROV

Post by KR2_Diving »

Oh YEA!
T100 + Blue ESC
T100 + Blue ESC
2015-08-24 21.26.25 (Medium).jpg (221.12 KiB) Viewed 10569 times
My shipment from BlueRobotics arrived today!

First impressions:
These thrusters are pretty solid! Feel a lot heavier and solid in the hand then I was expecting! Cables all appear very sound, and the build quality is GREAT! It is a shame it is going to be such a crazy week, or I would have these guys up and running already!

Rest assured, any free time I have will be spend getting these up and running! Watch this post for updates!

Best regards,
KR2_Diving
Bindo
Posts: 112
Joined: Apr 7th, 2015, 4:42 pm

Re: KR2 ROV

Post by Bindo »

Can't wait to see these puppies in action 8-)
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: KR2 ROV

Post by KR2_Diving »

Status Update!

So... I have been so excited to get my BlueRobotics T100's up and running... that I haven't even touched them yet... sad... I know...

But I have had some time to tinker with some other stuff.

Today I got my Easytransfer Library back up and running, and tested. I wanted to make sure I understood the i2c Bus and EasyTransfer before I tackled the challenge of flashing all the firmware on the T100s to change addresses...

Anyway, you can see below the current layout of the system.
Layout
Layout
ROV system Layout Sept 2015 labled.jpg (77.09 KiB) Viewed 10464 times
All of the 7-seg displays are are the same i2c bus. I am using the LCD Backpacks from Adafruit.

Here is a link to the video of it all in action! Warning: the LED's get BRIGHT!


The Left and Right Sticks control the thrusters, the Left Pad UP/DOWN control the brightness of the LEDs, Start Turns them on, Select turns them off. The colon on the BLUE display will turn on when the LEDs are on.

All seems in order, so now I think I can tackle the T100's!
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: KR2 ROV

Post by KR2_Diving »

Had a few minutes this evening to finally unpack my T100's and 4"hull to see how things laid out.
Starting to get the picture!
Starting to get the picture!
ROV Layout.jpg (632.84 KiB) Viewed 10358 times
The creative juices are flowing... Hoping to gain some momentum on the build and move Version 1 from the drawing board to the diving board!
Post Reply