Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Control of Dual Trolling Motors

Status
Not open for further replies.

dtbradio

New Member
I am mad-scientisting (to coin a phrase) a little 12-foot flat-bottom boat. I plan on mounting a pair of 12-volt, 50-pound thrust trolling motors (hooked to 24 volts YEEHAW) , positioned on a transom-mounted frame with a motor at each corner. I will use varying and reversible motor thrust for steering. The reason I am running them from 24 volts is for BRIEF bursts of what I hope will be crazy speeds for an electric-powered boat.

I've already designed, built, and tested a pair of PICAXE-based PWM circuits which will read a POT voltage and shift PWM control to a forward, reverse, or stop sub-routine. The circuit works like a charm with either bipolar or MOSFET controls in both high-side and low-side configurations

My problem is that I haven't been able to find a POT that is anything remotely like what I'm looking for. What I want is a lever-controlled POT with a lever position radius of about 160-170 degrees and some kind of center-stop or center-indent. Normal POT's have roughly 300 degrees or so, and that's not practical for what I want to do. If anyone knows of a source for that kind of control, I'd love to hear about it. I'm not totally against trying to construct my own, but I'm ALMOST totally against it.
 
Last edited:
Why not modify a PC joystick, you could also use the side to side motion to controle steering?

That was my first thought when starting this project, but I wanted to use micro-controllers I already had on hand. I would need a controller with dual ADC inputs and dual PWM outputs, and I have none here. That and my programming skills aren't that great yet, and I'd need to figure out how to mix the two control voltages to get proper motor response during steering moves. For me, that would be a very big challenge. The dual-control option works best for now, but I'm not dismissing the joystick idea for future use, since I ultimately plan on setting this up for radio control.
 
Ok, I ended up breaking down and buying a PICAXE 28X2 chip to simplify the design, and allow PWM for two motors with a single chip. I also decided to go with the joystick option, since I was having a lot of trouble finding the limited-turn POT's I needed for my other idea.

Here is the code that worked for me. If anyone sees something that can be shortened or done better, please feel free to post the code you come up with.



symbol throttle = b0
symbol steering = b1
symbol lmotor = b2
symbol rmotor = b3
symbol lmode = b.0
symbol rmode = b.1

double_speed:
'setfreq m8

main:
readadc 0,throttle
readadc 1,steering

allstop:
if throttle > 123 and throttle < 132 and steering > 123 and steering < 132 then
rmotor = 0
lmotor = 0
low rmode
low lmode
goto sendpwm
end if

straight:
if steering > 123 and steering < 132 then
if throttle > 127 then
throttle = throttle - 127
low lmode
low lmode
lmotor = throttle
rmotor = throttle
goto sendpwm
end if
if throttle < 127 then
throttle = 127 - throttle
high lmode
high rmode
lmotor = throttle
rmotor = throttle
goto sendpwm
end if
end if

rotate:
if throttle > 123 and throttle < 132 then
if steering > 127 then
lmotor = steering - 127
rmotor = steering - 127
high rmode
low lmode
goto sendpwm
end if
if steering < 127 then
rmotor = 127 - steering
lmotor = 127 - steering
high lmode
low rmode
end if
end if

rightfwd:
if steering > 127 and throttle > 127 then
steering = steering - 127
throttle = throttle - 127
lmotor = throttle + steering max 127
low lmode
rmotor = throttle - steering
if rmotor > 127 then
rmotor = rmotor - 127
rmotor = 128 - rmotor
high rmode
else
low rmode
end if

goto sendpwm
end if

leftfwd:
if steering < 127 and throttle > 127 then
steering = 127 - steering
throttle = throttle - 127
rmotor = throttle + steering
lmotor = throttle - steering
low rmode
if lmotor > 127 then
lmotor = lmotor - 127
lmotor = 128 - lmotor
high lmode
else
low lmode
end if
goto sendpwm
end if

rightrev:
if steering > 127 and throttle < 127 then
throttle = 127 - throttle
lmotor = steering - throttle
if lmotor > 127 then
lmotor = lmotor - 127
low lmode
else
high lmode
lmotor = 127 - lmotor
end if
rmotor = steering - 127 + throttle max 127
high rmode
goto sendpwm
end if

leftrev:
if steering < 127 and throttle < 127 then
throttle = 127 - throttle
steering = 127 - steering
lmotor = steering + throttle max 127
rmotor = steering - throttle
rmotor = 127 - rmotor
if rmotor > 127 then
high rmode
rmotor = rmotor - 127
else
low rmode
rmotor = 127 - rmotor
end if
high lmode
goto sendpwm
end if

sendpwm:
pwmout c.1, 31, lmotor
pwmout c.2, 31, rmotor
goto main
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top