Control dc motor with pwm by using one dir and one pwm pins in both directions like Cytron MDD10A

Hello folks!!
I have a DRV8833 motor driver and to control the dc motor with PWM in both directions we require two PWM pins. For Arduino nano controlling four motors is impossible .
After research, I found out that Cytron MDD10A uses one dir and one PWM pin to control the motors which is what I wanted to achieve.
I created a circuit for that using relays which I don't think is efficient but it gets the work done.
Please help me out here to design a better alternative for it.

I have attached a schematic diagram for it , the output will be received by the inputs of DRV8833.


Below are the images of Cytron mdd10a and its datasheet.
cytron user-manual-mdd10a.pdf (4.8 MB)

Hi,
@2003_2003 schematic;

You should be able to EXPORT from the CAD in jpg format.
You won't be able to use PWM with relays.
You cannot supply motor current from the output pin of the UNO....
What current is needed to activate the coils, the UNO will not have the output current to drive a relay coil.
You will also need Back EMF diodes on each of the coils.

Can you please tell us your electronics, programming, arduino, hardware experience?

Can you please post link to specs/data of your motor?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Basically the motor which i have shown in the design is just as a reference. The terminals of the motor will be replaced by IN1 and IN2 of the DRV8833 motor driver and the OUT1 and OUT 2 of DRV8833 will be connected to the motors.
And the pwm signal is supplied by pin 6 of arduino which passes through two switching relays so that the the correct pin of the DRV8833 gets the pwm signal. The switch action of the 5 v relay is carried out by the pin 7 of arduino.
This system works flawlessly but the efficiency is my main concern as relay consumes a lot of power .
I want to replace the relays by mosfets to increase effociency but keeping the same system and same pins.
For reference you can compare how MDD10A MOTOR DRIVER works and compare it with DRV8833.

It won't for long without some drive device on the relay coils to prevent output pin failure, and back EMF diodes.
So the motor is not the motor but the DRV8833.
It might be better to include the proper DRV8833 and all its connections.

Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Please post link to specs and data for MDD10A.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Hi,
The Nano has these PWM pins.
Why will you run out for two motors?

Board PWM Pins PWM Frequency
Uno, Nano, Mini 3, 5, 6, 9, 10, 11 490 Hz (pins 5 and 6: 980 Hz)

Use pins 3 and 9, and 10 and 11.

Tom.. :smiley: :+1: :coffee: :australia:

Yes, but I want to control four dc motors so the PWM pins are not enough.

I have added the data sheet and the Cytron driver .

Please don't go back and edit older posts, post new information in new posts to keep the logical flow of the thread.

If you are happy with getting two of the Cytrons, then okay.
It looks like a basic board with some nice test features and clean layout.

Tom... :smiley: :+1: :coffee: :australia:

Well, basically I am trying to replicate its design for the DRV8833 as it is a cheap and useful board.
I want to achieve the control structure of cytron on drv8833.
Thank you.

Hi,
Have you seen this page from the datasheet?

If you look at the bottom table.
If you apply PWM to AN1 and then 0 or 1 to AN2, you can have a change in direction, but one way is fast and the other slow decay.
Not sure if that will effect your application.
Placing 0 on both AN1 and AN2 will give you a coasting stop.
Placing 1 on both AN1 and AN2 will give you a braking stop.
drv8833.pdf (1.0 MB)

Tom... :smiley: :+1: :coffee: :australia:

Yess .
I did study that table and all I want to achieve is given in that table.
You can see that only one pwm pin is used and the direction can be changed with one normal digital pin.
I just wish to achieve the first and last case of the table.
Thankss..

And you can with just two Nano/Uno pins.
PWM pin, paired with a Digital I/O pin.

Tom... :smiley: :+1: :coffee: :australia:

I can with the cytron driver not with DRV8833 as it requires two pwm pins for speed control in both directions

Look at the table and just look at these three conditions,

Have you actually connected a motor, Nano and 8833 as a POC prototype and tried it?

Tom... :smiley: :+1: :coffee: :australia:

Yes i have drv8833 and i have connected it to pwm pins 3 and 6 .
So when i set pin 3 low and pin 6 a pwm signal then it runs forward with the given pwm.
If i set pin 6 low and pin 3 pwm it runs backward with the given speed.
To stop the motor both are set low or both are set high.

Hi,
So you have the code and connections to do four motors with 8833.

Note the 8833 has provision for current limit sensing.

Tom.. :smiley: :+1: :coffee: :australia:

Yess I can connect four motors if i dont want speed control but can control 3 motors if speed control is required as nano has 6 pwm pins

Hi,

Use the PWM pins for speed control.
The digital pins for direction.
If you want the PWM pin to output a 0 (LOW) , then analogWrite(PWMPin, 0) along with digital pin output 0 (LOW) to have STOP.

Tom.. :smiley: :+1: :coffee: :australia:

Okay but I don't think U understood what I am trying to do.
So basically the DRV8833 has two input pins to control one motor and both are required to be pwm but on the other hand the cytron driver requires one pwm and one dir pin to drive one motor.
Hence i can control 4 motors using nano with the help of cytron driver but cannot control 4 motors using DRV8833 as nano has only 6 pwm pins but requires 8 pwm pins.

No, only one is required to be PWM if you look at the table in post #14 .

Tom... :smiley: :+1: :coffee: :australia:
PS Can you post your circuit diagram for the 8833 experiment and the code you used?