This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Motor.ino - drive relays?
#1
Hey Everyone - I've got openplotter up and running on an RPI4 and the motor control 'motor.ino' loaded onto an Arduino uno. Everything seems to be working ok,(with the exception of a possibly bad mpu9255) 

What I'd like to be able to do is have the Arduino drive a couple of relays, or drive a couple of transistors I can switch the relays on/off with. The motor I have already has a suitable DC power supply that has a forward/reverse switch as well as speed control. I'd like to substitute the forward / reverse switch for a couple of relays driven from the autopilot. So far as I can see motor drive only available via pwm or h bridge, neither of which will work as my motor can pull over 20A easy.

Anyone got any ideas on how I can achieve this?
Reply
#2
Moved to pypilot forum.

yes you can do it. using pwm mode the d2/d3 pins can drive the relays, however, you may need transistors to drive the relays.

I am not sure how your speed control works

a big disadvantage of doing this is is there is no longer current measurement unless you add it somehow. Without this, you will need rudder feedback or end stop switches to avoid prolonged stalling.

What kind of motor are you using?
Reply
#3
(Today, 05:00 AM)seandepagnier Wrote: Moved to pypilot forum.

 yes you can do it.   using pwm mode the d2/d3 pins can drive the relays, however, you may need transistors to drive the relays.

I am not sure how your speed control works

a big disadvantage of doing this is is there is no longer current measurement unless you add it somehow.   Without this, you will need rudder feedback or end stop switches to avoid prolonged stalling.

What kind of motor are you using?

Hey - I actually got it going using transistors to run relays off pins 9&10 in H bridge mode - seems to work ok now I got my new MPU9255 yesterday, you think it would make more sense to use the PWM mode?

Speed control is a pot attached to the motor controller - ultimately I'll mount this somewhere handy for on the fly adjustments.

Seeing it run on the bench highlighted that yes, I will be needing a rudder feedback, and I'd like to add end stops as well just for peace of mind. I'll figure something out for current monitoring, probably something like this:ASC712-30A Current Sensor Module might work.

This install is going on my old, cable steered dual helm power boat, steering on this boat is kinda stiff due to the two steering cables and two helms all being linked together so I went with the strongest wiper motor I could find. Not sure what its off but I had it pull 14A on the bench at 100% speed and not much torque resistance applied. Maybe its overkill but I'd rather too big than too small..

Also Sean - Thanks all the time you must have put into this. I've been following the pypilot project on and off for a while. I broke my leg recently so decided to build up an autopilot while I'm immobilized, this project has helped keep me busy and sane!
Reply
#4
if you use pins 9 and 10 instead of 2 and 3, there is a pwm output which is not idea for relay, but only if the servo min speed is less than 100%

any chance to show a picture of the wiper motor that pulls 14A??

This is almost unheard of. Most wiper motors draw 1-3 amps depending on speed and the older ones with universa motors I've seen 5-6 amps, but nothing like 14.
Reply
#5
(2 hours ago)seandepagnier Wrote: if you use pins 9 and 10 instead of 2 and 3, there is a pwm output which is not idea for relay, but only if the servo min speed is less than 100%

any chance to show a picture of the wiper motor that pulls 14A??

This is almost unheard of.   Most wiper motors draw 1-3 amps depending on speed and the older ones with universa motors I've seen 5-6 amps, but nothing like 14.

https://share.icloud.com/photos/0iUzs4Xv...PRp_-xlakQ

Here it is at 6.5a no load. A bit of resistance on the shaft can double the current. 
Have you found a type that works best? (Low current / High torque)
Reply


Forum Jump:


Users browsing this thread: splimp, 1 Guest(s)