Servo Drive Control Using Arduino Uno

Hello Everybody!,

So I am currently a university student working on controlling a DC motor w/ encoder using an Arduino Uno.
Specifically, the motor is a BLM 57050 motor and it comes with an accompanying ACS 306 servo drive.

I am unsure on how to control the motor when it is accompanied with a servo drive. The manufacture provided two different wiring schematics for connecting the ACS 306 to a motor controller (schematics added as a link).

As of now everything else is wired (encoder, motor, etc.), but I am unsure of how to connect an Arduino Uno to the ACS 306 (in particular how do I connect the PUL+/PUL- and DIR+/DIR- inputs/outputs to the Arduino).

Additionally, how can I program the Arduino so that it can control the motor?

Any help is greatly appreciated!

ACS306 to Motor Controller Wiring Schematic.doc (120 KB)

So a quick update on wiring the ACS306 servo drive to the Arduino Uno, I think I figured out the wiring.

What I did was insert connect the PUL- to pin 9 of the Arduino and DIR- to pin 8 of the Arduino.

I then connected PUL+ and DIR+ to the 5V VCC of the Arduino with the use of a breadboard.

Does this seem to be correct?

My suspicion is that pul is for pulse input, with the length of the pulse indicating something such as distance or turns. Then dir means which direction to run the motor. If you post a .pdf file, I'm sure I'll take a look. A MS word document from an unknown source isn't very inviting.

Of course, here is the pdf file for the schematics.

ACS306 to Motor Controller Wiring Schematic.pdf (84.9 KB)

You should use figure 3-2 (common anode outputs). The ACS306 seems to function on its front end as a few opto-isolators. Yes, you connect all the + signals to 5V. Then pick 3 arduino I/O pins to connect to EN (enable?), PUL (I suspect the width of a LOW pulse actuates the servo for a proportional amount of steps), and DIR(direction of motion?).

You first declare all 3 pins as output and set HIGH to all them. Then set EN pin to LOW, write a LOW pulse to PUL pin and see if the motor moves and by how much.

This is how you make a LOW pulse for 5 millisconds:

digitalWrite(PUL, LOW);
delayMicroSecond(5000);
digitalWrite(PUL,HIGH);

Yes, I believe that ENA is the enable signal and the DIR is the direction signal.

So I used the following code to try to get the servo motor to turn:

#include <Servo.h>   //Inclusion of the servo library

int pos = 0;              //Declaration and initialization of the pos variable
int PUL_pin = 8;          //Declaration of the PUL signal control pin as pin 8
int DIR_pin = 9;          //Declaration of the DIR signal control pin as pin 9
int servo_delay = 5000;   //Declaration of servo delay

//Servo 3RPR_ServoMotor1;   //Creation of servo object 3RPR_ServoMotor1 for Arduino to interface with 


void setup() {
  
  //Setup code to run once:
  pinMode(PUL_pin, OUTPUT);

}


void loop() {
  
  //Main code to run repeatedly:
  digitalWrite(PUL_pin, LOW);
  delay(servo_delay);
  digitalWrite(PUL_pin, HIGH);

}

However, my servo motor is not currently running. Would you happen to know why that is.

Also, thank you so much for your help.

So a quick update, me and my project group were able to get the motor to run with the servo drive.

Thank you so much for your help!

jkwoods0403:
So a quick update, me and my project group were able to get the motor to run with the servo drive.

Thank you so much for your help!

You need to tell us how you made it work. Did you end up making all 3 pins OUTPUT like I said?

Hello, sorry for such a late response, but yes, I set the PUL and DIR signals as outputs. I ended up not using the ENA signal.

Here is the code I used that ran our servo motor:

int pos = 0;                   //Declaration and initialization of the pos variable
int PUL_pin = 6;               //Declaration of the PUL signal control pin as pin 8
int DIR_pin = 9;               //Declaration of the DIR signal control pin as pin 9
int servo_delay = 250;         //Declaration of servo delay
int number_of_steps = 100;     //
int pulse_width_micros = 20;   //

//Servo 3RPR_ServoMotor1;   //Creation of servo object 3RPR_ServoMotor1 for Arduino to interface with 


void setup() {
  
  //Setup code to run once:
  pinMode(PUL_pin, OUTPUT);
  pinMode(DIR_pin, OUTPUT);

}


void loop() {
  
  digitalWrite(PUL_pin, LOW);
  delayMicroseconds(1000);
  digitalWrite(PUL_pin, HIGH);
  digitalWrite(DIR_pin, HIGH);
  
}

However, I noticed that the servo motor wouldn't run when PUL- and DIR- were connected to the 5V output of the Arduino, but would run when connected to the GND pin of the Arduino.
This seemed to contradict with the schematic provided by the manufacturer, and I was wondering if you would know why that is?
Would it be that the provided schematic was incorrectly labeled, or that I misunderstood the schematic?
(The schematic is attached to this post)

ACS306 to Motor Controller Wiring Schematic.pdf (84.9 KB)

The schematic was correct but you didn't interpret it correctly. The pins you mentions are isolated by optoisolators. By pulling the pin to GND, the LED will be lit and the receiving side will know the pin is activated. The LED is already connected to 5V power side. This is called a low-side switch. Just follow the yellow highlight to see the path of current flow. The Red is where your pin turns on the switch, by outputting GND. You don't actually have the transistor, which is expected to be supplied by you.