Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post Reply
admin
Site Admin
Posts: 866
Joined: Sun Aug 05, 2012 4:02 pm

Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post by admin » Thu Jun 07, 2018 11:32 am

Image


An Arduino compatible stepper motor driver shield. This shield makes use of 2x Allegro A3969 microstepping driver ICs allowing the shield to drive up to two stepper motors independently. The motors can be connected to the shield via screw terminals, or if fitted, via the 4 pin JST connectors. Separate motor power can be supplied via the 2.1mm jack socket or via the shields Vin pin. The shield also includes headers for controlling up to 4 standard servos. An on-board 3.3V/5V logic selection switch provides compatibility with 3.3 and 5V Arduinos.

Image Image


Specification:

Product code: HARDU0103
Motor supply voltage: 5 to 12V DC
Motor supply current (max): 750mA per motor
Micro step resolution: Full/Half/Quarter/Eighth (set via jumpers)
Automatic current-decay mode
Fast and slow current decay modes
Internal thermal shutdown circuitry
Dimensions: 69mm x 61mm


Our Notes:

Motor supply voltage (Vin) should be less than or equal to the coil voltage of your stepper motor.
Motor supply voltage (Vin) is directly connected the Vin pin of your Arduino, therefore it should not exceed the maximum supply voltage of the Arduino (normally 12V).
Servo outputs A0 & A1 are not available if motor Y is in use and servo outputs A2 & A3 are not available if motor X is in use.
IIC is only compatible with Arduino Uno.



Image





Example Arduino Sketch:

Code: Select all

/* FILE:    HCARDU0103_Dual_A3967_Stepper_Motor_Shield_Example
   DATE:    06/06/18
   VERSION: 0.1
   AUTHOR:  Andrew Davies


This example sketch uses the HCMotor library to individually control two stepper
motors connected to the motor X & Y output terminals of the shield.

The HCMOTOR library can be downloaded from the software section of our support forum 
here: http://forum.hobbycomponents.com/viewtopic.php?f=58&t=1870

The HCARDU0103 dual A3967 stepper motor shield can be purchased from our website here:
[LINK TBA]
 

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Include the library */
#include "HCMotor.h"

#define STEPPER_X 0
#define STEPPER_Y 1


/* Digital pins used to drive the motors */
#define XDIR_PIN  3
#define XSTEP_PIN 2
#define YDIR_PIN  7 
#define YSTEP_PIN 6 


/* Create an instance of the library */
HCMotor HCMotor;


void setup() 
{
  /* Initialise the library */
  HCMotor.Init();

  /* Tell the library which pins control which motor and type of driver */
  HCMotor.attach(STEPPER_X, STEPPER, XSTEP_PIN, XDIR_PIN);
  HCMotor.attach(STEPPER_Y, STEPPER, YSTEP_PIN, YDIR_PIN);

  /* Set the step mode to continuous output */
  HCMotor.Steps(STEPPER_X, CONTINUOUS);
  HCMotor.Steps(STEPPER_Y, CONTINUOUS);
}


void loop() 
{
  /* Set the direction of each motor */
  HCMotor.Direction(STEPPER_X, FORWARD);
  HCMotor.Direction(STEPPER_Y, REVERSE);

  /* Slowly ramp up the speed of the motors. Note that CLK_DUTY is set in 100ms increments */
  for(unsigned int CLK_DUTY = 50; CLK_DUTY >= 5; CLK_DUTY--)
  {
    HCMotor.DutyCycle(STEPPER_X, CLK_DUTY);
    HCMotor.DutyCycle(STEPPER_Y, CLK_DUTY);
    delay(20);
  }

  delay(2000);

  /* Slowly ramp down the speed of the motors. Note that CLK_DUTY is set in 100ms increments */
  for(unsigned int CLK_DUTY = 5; CLK_DUTY <= 50; CLK_DUTY++)
  {
    HCMotor.DutyCycle(STEPPER_X, CLK_DUTY);
    HCMotor.DutyCycle(STEPPER_Y, CLK_DUTY);
    delay(20);
  }

  
  /* Switch the direction of the motors */
  HCMotor.Direction(STEPPER_X, REVERSE);
  HCMotor.Direction(STEPPER_Y, FORWARD);

  /* Slowly ramp up the speed of the motors. Note that CLK_DUTY is set in 100ms increments */
  for(unsigned int CLK_DUTY = 50; CLK_DUTY >= 5; CLK_DUTY--)
  {
    HCMotor.DutyCycle(STEPPER_X, CLK_DUTY);
    HCMotor.DutyCycle(STEPPER_Y, CLK_DUTY);
    delay(20);
  }

  delay(2000);

  /* Slowly ramp down the speed of the motors. Note that CLK_DUTY is set in 100ms increments */
  for(unsigned int CLK_DUTY = 5; CLK_DUTY <= 50; CLK_DUTY++)
  {
    HCMotor.DutyCycle(STEPPER_X, CLK_DUTY);
    HCMotor.DutyCycle(STEPPER_Y, CLK_DUTY);
    delay(20);
  }
}




Image

The HCMotor Arduino compatible library can be downloaded from the software section of this forum here:

http://forum.hobbycomponents.com/viewto ... =58&t=1870


Schematic:
Dual_A3697_Stepper_Motor_Shield_Schematic_HCARDU0103.pdf

A3697 datasheet:
A3967-Datasheet.pdf



Disclaimer: Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do not provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.
You do not have the required permissions to view the files attached to this post.

john_m0ers
Posts: 12
Joined: Fri Feb 28, 2014 10:21 pm

Re: Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post by john_m0ers » Wed Sep 26, 2018 7:23 pm

Hi,
A beautifully made product, but one word of warning. If this is used on the hobby components Arduino, there is a potential for the usb shorting out the underneath of the motor driver shield. I've yet to find a permanent solution, other than to make extenders to the Arduino connectors. Maybe glue a mica washer to the usb socket, although it is right on the edge of some pins on the motor board. If anyone else has ideas I would like to hear.
john

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post by andrew » Thu Sep 27, 2018 8:49 am

If I recall correctly I think it's the pins of the white socket that are quite close to the USB socket, is this what you are referring to? However I believe they should sit off to the side of the USB socket and just missing it by about 1 to 2mm. It is pretty close so I guess if the headers of the shield or the Arduino where slightly bent to one side it could touch the USB socket.

Unfortunately we are currently out of stock of these shields so I can't check this but I'll take a look as soon as we get new stock.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

john_m0ers
Posts: 12
Joined: Fri Feb 28, 2014 10:21 pm

Re: Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post by john_m0ers » Wed Jan 09, 2019 10:20 pm

They are incredibly close, however that doesn't detract from their usefulness though. I have hooked mine up to an Arduino uno programmed with the provided sketch. Using two of your nema 17 motors, which have the correct plugs to connect straight to the board. The issue I'm having is that with 12v plugged into the motor board everything works for so long, ie the motors ramp up and down in speed, and then reverse. I have noticed that the driver chips get incredibly hot after ten or so seconds, and then one or both motors run erratically. I cannot tell if the potentiometer connected to each chip makes a difference or not. Do you have any advice regarding the pots, and the heat, apart from maybe heatsinks/fans?
regards john

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post by andrew » Thu Jan 10, 2019 11:37 am

The issue I'm having is that with 12v plugged into the motor board everything works for so long, ie the motors ramp up and down in speed, and then reverse. I have noticed that the driver chips get incredibly hot after ten or so seconds, and then one or both motors run erratically.

This sounds like the thermal protection is kicking in and shutting down the driver circuit. As a general rule with all electronics is if a component gets too hot to touch then it is probably being overloaded. I.e. too much current is flowing through it.

I cannot tell if the potentiometer connected to each chip makes a difference or not.

I've taken a look at the schematic (we still don't have any in stock so I can't check what's actually fitted to the board) and according to it the boards have a 0R resistor fitted for the sense resistor. Checking the datasheet this would imply that the driver will not limit the current though the motor(s).

If this is the case the only things I can suggest would be either to replace the sens resistors (R3 & R7) with a larger value or to significantly reduce the supply voltage (Vin) to your motors.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

john_m0ers
Posts: 12
Joined: Fri Feb 28, 2014 10:21 pm

Re: Dual A3697 Stepper Motor Driver Shield (HCARDU0103)

Post by john_m0ers » Mon Jan 14, 2019 10:26 pm

hi Andrew, thank you for that. I will try tomorrow and let you know.
regards john

Post Reply

Return to “Arduino Shields”