The Automated Radio controled Rowboat

Hey folks, I’ve been scheming on this for a while, A radion controlled Rowboat. Its not the first, wont be the last of course, but just something neat I want to try my hand out.

The boat building part, no problem, already built, Lots of experience with servo linkages from years of fiddling with RC

The Rowing mechinism uses four servos, two per oar. One servo pulls the oar forward and backwards, the other lifts the oar up and down. the servos are controlled by a Microcontroler, that is taking the throttle and rudder signals from the RX and translates them into the servos functions.
or as the guy that made the prototype that I’m most intrigued by says:

Interrupt routines measure the rudder and throttle signal then the program works out how to move the oars using a lookup table.

and he is using a Atmega chip, programed off a Arduino board.

The Prototype I’m talking about can be seen here:

I’m not sure where to start where to learn how to code like this. short of Begging the guy for his skript, Can any one nudge where to go to learn, or how to pull this off? maybe some example code I can dissect?

Thank you every one in advance.

He's saying that he has the PWM signals from the RC receiver triggering interrupts so he can read the length of the pulse. The length of the pulse represents the throttle or steering position. Using those throttle and steering readings he then decides how to move the servos based on information he has stored in a lookup table.

Using interrupts is a bit advanced. You can go that route and assuredly snatch some code from any of the many autopilot/drone-type software packages out there -- they use interrupts because they're seeking peak performance and are trying to read a boatload of sensors in a timely manner. Assuming you're not risking the boat dropping out of the sky then the simpler method is using pulseIn; An (untested) example with the channel 1 and 2 signals set to digital pins 2 and 3, respectively:

#define CHANNEL1 2
#define CHANNEL2 3

unsigned long channel1in;
unsigned long channel2in;

void setup() {
  pinMode(CHANNEL1, INPUT);
  pinMode(CHANNEL2, INPUT);
}

void loop() {
  channel1in = pulseIn(CHANNEL1, HIGH, 10000);
  channel2in = pulseIn(CHANNEL2, HIGH, 10000);

  serial.print("Channel 1: ");
  serial.println(channel1in);
  serial.print("Channel 2: ");
  serial.println(channel2in);

  delay(500); // pause half a second
}

The trick is what you do with those readings and translate that into the proper motion of the paddles. Certainly a bit of a logic puzzle.

it most certainly is isn't it?

So, As i understand it here.. in a radio control system. just to clear my head of the thoughts.. the transmitter is pretty much just four banks of pots.. you are transmitting the position of the pots to the reciever which sends the control signal to the servos..

hence... just like the "knob" servo program in the examples turtorial..

just replace the analouge pot with the output of the receiver... yep pretty simple in that reguard..

got all that down..

just typing out loud here as it were..

the trick is turning that PWM signal into a routine.

As I'm looking at it, it seems to me that the lift and pull servos are pretty much doing the same thing.. moving in a 45 degree arc to accomplish the movement. Perhaps, for each channel you just have to send the same instruction to both servos?

I think you are broadly on the right lines, but there are some aspects of your reply that didn't see quite right.

I understand that you've got a conventional RC system that is designed to drive four servos. Each server would normally connect directly to the receiver, and take a PWM signal from the receiver.

What you're planning is to connect those four PWM signals into the Arduino and have it work out the corresponding analog position of the corresponding joystick on the transmitter. Then the Arduino will interpret these as abstract values like 'forwards speed', 'rate of turn' and generate four PWM outputs to drive the servos to paddle in a way that carries out those commands.

If that's the plan, you need to understand that the method of reading a PWM signal into the Arduino is very different to just reading a plain old analog value.

As a software person I hesitate to suggest doing this in hardware, but I think this is very similar to a 'flapping bird' type of problem where you want both wings to stay in phase but vary the amplitudes separately. If you're familiar with thinking in terms of rods and cranks, that's not too hard to achieve using a continuously rotating motor with a servo to vary the left/right amplitudes. Taking that approach, you would not need an Arduino at all, just a conventional 2-channel RC system and lots of patience. If you fancy taking the software approach, though, that could be a fun way to tackle it too.

Actually peter, what is going on here is a coventinal 2 channel surface remote system, throttle and rudder, or stearing if you want to think of it as a car. It is completly possible to take a four channel system and run a gimble type of control articulation. But, well, to put it mildly.. it is a pain in the butt to actually operate control side. Have you ever rowed a boat in real life? This is the operation I'm trying to emulate. Drop the oar, then pull it to you push the boat forward in the water. Turning the boat is concentratrating the motion to the direction you want to turn. It can be done by hand and it takes a lot of hand/eye co-ordination. The same circular motion you make with your hands in real life needs to be emuated via the transmitter sticks. In this controll scheme I'm trying to do, it is only two radio channels.. +/- 1500 on 1 for the forward /reverse and +/- 1500 for left or right. Full channel 1 gives you full forward which has all four servos working in unison to pick up and drop the oars and pull them forward. Pull the throttle stick back now you have full -1500 controll signal telling the servos to do it all backwards. On channel two, you are now blending the signal.. so going forward and turning right might be. Now the servos on the left side are getting a 1500 signal, and the ones on the right are getting a 550 signal.

That makes sense - I was thinking of a 2 channel radio and I don't know why I wrote 4 channel. Perhaps because of the 4 servos.

I only have a little experience of using oars and sculls but usually this involves feathering the blades and well as moving them in two dimensions. As long as you can reliably get the blades clear of the water you can probably afford to ignore that, but it depends how elegant you are trying to get your solution.

Hi,

Not sure if this will be helpful to you or not, but instead of using 4 servos I think you could use 2 motors and a crank arrangement (which was suggested before). What I mean is treat it like 'tank steering' with 2 (or 3) differentials. I've also heard them called adder/subtractor. One motor supplies the forward and reverse propulsion and the other motor when turned on makes it steer one way or the other. By adjusting the turn motor input it would steer harder the faster the motor is reving. Plus, I know by driving only the turning motor you can make a zero-radius turn. Of course the crank would give you the up and down motion of the oars. If you have a source for the gears or can make them, perhaps this might be easier to control. Here are some links: http://www.gizmology.net/tracked.htm http://members.tele2.nl/s_weggeman/Differential%20steering%20book%20of%20wisdom.htm http://staff.science.uva.nl/~leo/lego/diff.html http://technicbricks.blogspot.com/2008/09/tbs-techtips-17-adder-substractor.html http://www.youtube.com/watch?v=ibYiWI_2aCk

Hope this helps... Brian

I would have thought you'd want to steer by keeping the two blades in phase and changing the length of the stroke, not by treating the blades like a 'skid steer' system. You could achieve that by a clever mechanical system, but I suspect you'll find it is quicker just to go ahead with servos as proposed and deal with the problem in software.

Thanks for the ideas and inputs folks.

Yeah, the Tank steering idea has gone through my head, and it is the easiest way to go about it, However, the Idea would be to hide all the mechanics as much as possible and have a figurine attached to the articulated oars. That figurine would then be compelled to move with the action of the oars, looking like it is doing the work.

y'know.. a little guy rowing the boat around. The function doesn't need to be precise to the actual Mechanics of row boating, just looking convincing from a distance, and of course... be functional to control.

A tank control, with cranks would be similar to this thing here.

And my plans for something along this line would be using two CR servo's for the cranks and simply using V- tail mixing on the radio for control.

I of course would make something like a fantasy scale model, as opposed to a realistic scale model that I'm trying to achieve with the four standard servo arrangement. I would make drive mechanism appear to be from the Gilded age.. steam punk if you will, and have a figurine attached to two control levers that would move forward and back, as if the figure was working the control arms for the "Electro-mechanical Locomotive oarsman."

Not that I dont want to do that, I do, I also want to do the other thing as I go through this grand journey of learning how to program these micro controlers to make my little models all that more interesting and needlessly complicated. :grin:

#include <Servo.h>
Servo Servo1, Servo2, Servo3, Servo4;

int ch11; // Here’s where we’ll keep our channel values
int ch22;
int ch33;
int ch1; // Here’s where we’ll keep our channel values
int ch2;
int ch3;
int i;
int pos1, pos2, pos3, pos4;
int pos1R, pos2R, pos3R, posR4;
int phase=90;

void setup()
{
Servo1.attach(8);
Servo2.attach(9);
Servo3.attach(10);
Servo4.attach(11);
pinMode(5, INPUT); // Set our input pins as such
pinMode(6, INPUT);
pinMode(7, INPUT);
i=0;
Serial.begin(9600); // Pour a bowl of Serial
}

void loop() {

ch11 = pulseIn(5, HIGH, 25000); // Read the pulse width of
ch22 = pulseIn(6, HIGH, 25000); // each channel
ch33 = pulseIn(7, HIGH, 25000);

ch1=map(ch11,900,2000,0,90);
ch2=map(ch22,900,2000,0,90);
ch3=map(ch33,900,2000,0,90);

for (i=0; i<359; i+=10) {

pos1 = i+2*phase;
pos2 = i+phase;
pos3 = i;

if (pos1>359) pos1-=360;
if (pos2>359) pos2-=360;
if (pos3>359) pos3-=360;

if (pos1>179) pos1=360-pos1;
if (pos2>179) pos2=360-pos2;
if (pos3>179) pos3=360-pos3;

pos1R=map(pos1,0,180,0+ch2,180-ch2);
pos2R=map(pos2,0,180,0+ch2,180-ch2);
pos3R=map(pos3,0,180,60,120);

Servo1.write(pos1R); // write pos1 to servo
Servo2.write(pos2R);
Servo3.write(pos3R);

delay(0);

Serial.print(“Channel 1:”); // Print the value of
Serial.println(ch1); // each channel

Serial.print(“Channel 2:”);
Serial.println(ch2);

Serial.print(“Channel 3:”);
Serial.println(ch3);

//delay(100); // I put this here just to make the terminal
// window happier
}}

try this code i have only written one oar but i hope it helps let me know i will post the full code later once written. if you can write a better code let me know

try this code

I would, but my Arduino doesn't have a smiley face pin. Bummer.

Perhaps you really should read the sticky at the top of the forum, and post your code correctly - using code tags, not quote tags and NOT the stupid copy for forum option in the IDE.

yes your right smiley face should be " 8) " LOL thanks for the reply i will look at the other methods as suggested

timpeace: yes your right smiley face should be " 8) "

Well, it would be   Servo1.attach(8); if you go back to that post, click on "Modify" and replace your "quote" tags with "code". OK?