#DAISY-2-V2 - Stepper motor driver board

<div class="text-success lead">
3 Ampere r.m.s bipolar stepper motor driver board based ST L6470 
fully integrated microstepping motor driver with motion engine and SPI chip
</div> 

@include='daisy_eol'

<img src="./DAISY-2-V2.jpg"/>

The L6470, realized in analog mixed signal technology, is an advanced 
fully integrated solution suitable for driving two-phase bipolar stepper 
motors with microstepping. It integrates a dual low RDS(on)DMOS full-bridge 
with all of the power switches equipped with an accurate on-chip current 
sensing circuitry suitable for non-dissipative current control and 
overcurrent protection. Thanks to a unique control system, a 
true 1/128 steps resolution is achieved. 

The digital control core can generate user defined motion profiles with acceleration, deceleration, 
speed or target position, easily programmed through a dedicated registers set. 
All commands and data registers, including those used to set analogue values (i.e. current control value, 
current protection trip point, deadtime, PWM frequency, etc.) are sent through a standard 5-Mbit/s SPI. 
A very rich set of protections (thermal, low bus voltage, overcurrent, motor stall) allows the design of a 
fully protected application, as required by the most demanding motor control applications.

##Key features

* Operating voltage: 8 - 45 V
* 7.0 A out peak current (3.0 A r.m.s.)
* Low RDS(on)Power MOSFETs
* Programmable speed profile and positioning
* Programmable power MOS slew rate
* Up to 1/128 microstepping
* Sensorless stall detection
* SPI interface
* Low quiescent and standby currents
* Programmable non-dissipative overcurrent protection on high and low-side
* Two-levels of overtemperature protection

##Daisy wirings

This board is pluggable on:

* [FOX Board G20](/FOXG20) + [Daisy-1](/DAISY-1): __D7__
* [Terra](/terra) or [Terra-M](/terra) board: __D15__

##J3 pin-out

<table class="noborder" markdown='1'>
<tr>
<td valign='top'>
<img src="./j3.jpg"/>
</td>
<td valign='top'>

| J3  | Chip    | Function description            |
|-----|---------|---------------------------------|
| 8   | OUT1A   | Full-bridge A output 1          |
| 7   | OUT2A   | Full-bridge A output 2          |
| 6   | OUT1B   | Full-bridge B output 1          |
| 5   | OUT2B   | Full-bridge B output 2          |
| 4   | VSA/VSB | Full-bridge A and B power supply|
| 3   | GND     | Bridge A and B power supply GND |
| 2   | SW      | External switch input pin       |
| 1   | LED     | Led output for external led     |

</td>
</tr>
</table>

##SW1 dip-switch and P1 headers

<table class="noborder" markdown='1'>
<tr>
<td>
<img src="./p1.jpg"/>
</td>
<td valign='top'>

This dip-switch selects which SPI CS use for this board and if send the SDO back to the SPI interface: 

|   | Signal description      |
|---|-------------------------|
| 1 | Use SPI CS2             |
| 2 | Use SPI CS1             |
| 3 | Use SPI CS0             |
| 4 | Send SPI SDO to the CPU |

</td>
</tr>
</table>

#Stepper motor wirings

We tested the examples on this article with the following stepper motors:

##Mercury NEMA-17 stepper motor SM-42BYG011-25

<img src="./mercury_stepper.jpg"/>

* [Product datasheet](http://www.sparkfun.com/datasheets/Robotics/SM-42BYG011-25.pdf) 
* [Buy from Robot Italy](http://www.robot-italy.com/en/nema-17-stepper-motor-with-cable.html?___from_store=it)
* [Buy from Sparkfun](https://www.sparkfun.com/products/9238)

Wirings map:

| J3 pins on DAISY-2-V2 | Mercury wire colors | Function description |
|---------|---------|----------------------|
| 1   |       | |
| 2   |       | |
| 3   |       | GND power supply |
| 4   |       | VCC (12 volt) power supply |
| 5   | BLUE  | Bridge B output 2 |
| 6   | YELLOW| Bridge B output 1 |
| 7	  | GREEN | Bridge A output 2 |
| 8   | RED   | Bridge A output 1 |


##Wantai NMEA-23 stepper motor 57BYG621

<img src="./stepper_motor.jpg"/>

* [Product datasheet](http://www.phidgets.com/documentation/Phidgets/3307_0_Datasheet.pdf) 
* [Buy from Robot Italy](http://www.robot-italy.com/it/57byg621-nema-23-bipolar-76mm-stepper.html)
* [Buy from Phidgets](http://www.phidgets.com/products.php?product_id=3307_0)

Wirings map:

| J3 pins on DAISY-2-V2 | Wantai wire colors | Function description |
|---------|---------|----------------------|
| 1   |       |  |
| 2   |       |  |
| 3   |       | GND power supply |
| 4   |       | VCC (12 volt) power supply |
| 5   | BLUE  | Bridge B output 2 |
| 6   | RED   | Bridge B output 1 |
| 7	  | GREEN | Bridge A output 2 |
| 8   | BLACK | Bridge A output 1 |

#Schematic

* [DAISY-2-V2 schematic](/download/schematics/schematic_daisy2-v2.pdf)
* [ST L6470 product description](http://www.st.com/web/catalog/sense_power/FM142/CL851/SC1794/SS1498/LN1723/PF248592)
* [ST L6470 Datasheet](http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00255075.pdf)
* [dSPIN family communication protocol](http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00082126.pdf)
