Sharing single PWM Output Pin to drive 2 Cytron 13 amp Motor Controllers

sailgene

Member
Hi everyone. I've looked around and cannot find an answer to this: I'm working on an ROV using an 18M2 chip to control two thruster motors. I was looking at the Cytron Motor Controllers which seem to require PWM input vs a high-low signal to turn the motors on and off. As I only have one available PWM pin (the PCB is already built and the one other PWM pin is being used for something else), does anyone know if a single PWM output signal could be sent to two motor controller boards - each motor running at the same speed? Or would the output signal be de-graded if shared? These boards use a high-low signal for motor direction control and so that issue would be a slam dunk.

Thanks for any help. Here is a link to the Board I'm looking at: https://www.robotshop.com/en/cytron-13a-5-30v-single-dc-motor-controller.html#Multimedia
 

westaust55

Moderator
Using one micro controller output to conrtrol the input on two separate chips/devices is allowable. It is typically at logic levels classed as “Fan-out” of the IC/microcontroller.

If both your motors only need to run at the same speed then that is okay.
But what if you need to fine tune the speeds.
For both motors to be able to always run at the same speed infers that you have separate steering mechanism and control signals. ???
 

sailgene

Member
Thank you. The project involves a very slow moving ROV with two motors, one on either side of the vehicle. The props are running in counter rotation and hopefully will push relatively equally from both sides. In almost all cases, I'd be running at top speed with very little need to use PWM for slower speeds. My other concern was whether or not the Cytron Board would see any difference in the PWM signal if it was being shared with another board at the same time. But at least you've given me hope that I can use one PWM Out pin to control two Motor Control Boards. Thanks again!
 

hippy

Technical Support
Staff member
It should be entirely possible to send the PICAXE PWMOUT to both motor controllers as suggested.

Looking at page 7 of the datasheet the PWM does not have to actually be a PWM signal, can be a digital signal -

PWM = 0, DIR = 0 : Stopped
PWM = 0, DIR = 1 : Stopped
PWM = 1, DIR = 0 : Full speed one way
PWM = 1, DIR = 1 : Full speed the other way

So you could connect DIR to 0V, and turn each motor on or off by controlling the signal to PWM.
 

sailgene

Member
Thanks Hippy. I had read the Truth Table but was not sure if by "high" they meant digital or simply a specific PWM signal coming in. So at least now I have the option of "full speed ahead" if for any reason my PWM signal doesn't work. And thanks to Westaust55 for teaching me about the term "Fan-out". Just ordered 2 of these Cytron Motor Control Boards and will see what happens. Thanks again, guys. You are always on top of things!
 

hippy

Technical Support
Staff member
Thanks again, guys. You are always on top of things!
If you could let everyone know which 18M2 pins you are using and which are free there may be some clever tricks which could be used to optimally control your two motors without having to redesign your board.

The 18M2 has a Digital Signal Multiplexor and Alternative Function Pins which, though not exposed as PICAXE Basic commands, may be usable and useful.
 

sailgene

Member
Thanks Hippy. Actually, I was using 4 pins for 2-motor control (b.4, b.5, b.6 and b.7). It looks like the Cytron Boards will only require 3 of these same pins - using b.6 for PWM, and say b.4 and b.5 for directions control. As you can see, there are a few other available pins but c.4 appears to be an input-only (I'm using c.5 for serial comms) and only b.3 and b.6 appear to support PWM output. But again, I believe the board will be fine with just a little re-wiring and program tweaking.PIC 18M2 PIN USAGE.png
 
Top