Troubleshooting possibly-dead L6470 AutoDriver boards

Hi Sparkfun Support Team,

My team is running into issues with the L6470 AutoDriver board, and I’m looking for assistance determining whether we’ve really killed the boards, or whether we’re just making some obvious mistake in hooking them up that is impacting communications. Here’s our situation:

  • Bought 3 AutoDriver boards to drive [these motors , using a RedBoard for command generation.

  • Colleague hooked all three boards up following the [multiple board example. I wasn’t here for this, so I can’t speak to whether they modified the connections between the boards (or the pin assignments in the example code) correctly.

– They were using a variable power supply ([this guy) set to 30V. Unfortunately, I believe the current limit was set to 30A - so if the board asked for more than it could handle, it got walloped.

– They reported that the first time they tested the three-motor system, they heard a THUNK, and then nothing. Suspect this was one of the motors moving and then stopping.

  • Later, when trying to debug why the program seemed to be frozen at Line 15 in SparkFunwantYouGone, they noticed smoke coming from the charge pump diode on one of the boards, similar to what [this user reported. At this point, they stopped their experiments and called me.

I’m now trying to ascertain whether one or all of the boards are in fact fried (and if so, whether I can fix them) - or if I’ve just goofed up the hookups and am simply preventing communications between the RedBoard and the AutoDriver. Here’s what I’ve done so far:

  • Created a single driver setup following [this diagram from the hookup guide

  • Powered the AutoDriver from a Rigol DP821 power supply set to 36V with a 1A current limit

  • Used the SparkFunGetSetParamTest example code, with the following important modifications (only pasting in the parts that I’ve changed):

AutoDriver board(0, 10, 7);
String name = "";
unsigned long temp;
boolean tempBool;
byte tempByte;
float tempFloat;
int tempInt;
int tempInt2;
boolean pass = true;

void setup()
{
  Serial.begin(9600); 
  // Start by setting up the pins and the SPI peripheral.
  //  The library doesn't do this for you! 
  pinMode(7, OUTPUT);
  pinMode(MOSI, OUTPUT);
  pinMode(MISO, INPUT);
  pinMode(13, OUTPUT);
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);
  digitalWrite(7, LOW);
  digitalWrite(7, HIGH);
  SPI.begin();
  SPI.setDataMode(SPI_MODE3);

Note that I downloaded the library from [this repo because it was more recently updated - not [this repo, which is linked to in the hookup guide.

I’ve also attached photos of my complete setup, so you all can check my wiring.

What I’ve observed so far:

  • All three of the boards fail all of the tests - they report Config and Status reg values of 0, all other tests report 0 and fail, etc.

  • The board that had the magic smoke let out of the charge pump diodes also let smoke out of its 10uF capacitor!

  • As expected, none of the boards seem to do ANYTHING to the motor. I’ve scoped the motor output pins, and nothing shows up.

So - what are my options here? Am I correct that all of my boards are likely smoked (pretty sure the one is…) - or did I make a hookup mistake? What do you recommend for repairing these if so?

Thanks, all!

Julian](GitHub - sparkfun/L6470-AutoDriver: BabyDriver stepper board. SPI driven 3A 8-45V, based on L6470 part from Linear)](GitHub - sparkfun/SparkFun_AutoDriver_Arduino_Library: Arduino library support for the SparkFun AutoDriver board based on the ST Micro L6470 stepper driver.)](https://cdn.sparkfun.com/assets/learn_tutorials/5/5/8/autodriver_single.png)](https://forum.sparkfun.com/viewtopic.php?f=107&t=54160)](Amazon.com)](https://learn.sparkfun.com/tutorials/getting-started-with-the-autodriver---v13?_ga=2.151932537.1728160400.1660165186-1334715767.1635174352&_gac=1.221196522.1658331937.Cj0KCQjwz96WBhC8ARIsAATR250vqKlSibCLj-pqp5nvQO7Q6E4Z99xqWYugxeFd9ywHDm9IqXjvr1MaAkIDEALw_wcB#single-board-example)](https://www.automationdirect.com/adc/shopping/catalog/motion_control/stepper_systems/single_shaft_stepper_motors/stp-mtr-23055)

Were the Motor input power supply side(s) wired in parallel, or were all three boards/motors pulling power from one AutoDriver? It sounds like the latter, which (in my head) likely tried to push 6a through one board, 4a through 2nd board, etc…so maybe one of the boards might still be good? (3a max)

Try the simpler sketch https://github.com/sparkfun/L6470-AutoD … ryTest.ino and see how that goes (must send a character for a note to be ‘played’)…potentially need to try with all 3 autodriver boards :-/

Okay - so, I wanted to close the loop here, a) because I’ve learned a LOT about how the L6470 works (or is supposed to be used), and b) I’m honestly kinda pissed at SparkFun for providing such a garbage hookup guide which makes it so easy for people to smoke their boards - per the comments, I’m not the only person who’s been in this position.

A few things I’ve learned:

  • - First of all, the SparkFun example code [u]turns off the overcurrent safety limit on the drivers[/u]. (See in SparkFunsupportFunctions.ino - line 45). I cannot for the life of me figure out why they released code with this parameter set this way.
  • - Second, SparkFun's code handwaves past part of what (at least, in my naive ME's understanding) makes the L6470 so powerful: the fact that it controls on voltage instead of current - but consequently needs a more detailed model of the motor's electromechanical parameters to perform this control. The biggest place this comes up is in the KVAL parameter. SparkFun's code just says "uhh...don't worry about this" - probably assuming that this is basically a gain of some sort. It turns out that it's not. If you read [[this app note from STM](https://www.st.com/resource/en/application_note/an4144-voltage-mode-control-operation-and-parameter-optimization-stmicroelectronics.pdf), it actually defines what voltage should be applied at low speeds to produce the required drive current. If you have a high-inductance, low-resistance motor like mine, this parameter winds up being **tiny** - about 14 at my bus voltages, a long way away from the 128 specified in the code. The SparkFun hookup guide's explanation here is simply wrong - this isn't a current limit, it's a voltage limit, and it has nothing to do (as near as I can tell) with power consumption efficiency. (Side note - this STM whitepaper is an awesome document - gives instructions on how to do all of the experiments you need to in order to calculate the KVAL parameter, along with a ton of other performance tuning techniques that I haven't dug into yet).
  • [/list] Anyway - I'm pretty sure this combination (turning off a bare-minimum safety function, and completely misstating what a critical motor parameter does) is why I now have a stack of FOUR dead AutoDrivers (three thanks to my employee, one that I did figuring this all out). I've forked the original repository and am going to be updating it to fix these errors, along with some other changes (better examples, clearer hookup documentation, useful helper functions, etc.) Hopefully this will help folks in the future. The AutoDriver is a really cool product, and I'm glad SparkFun makes it - but I really, really wish they'd released better docs for it.](https://www.st.com/resource/en/application_note/an4144-voltage-mode-control-operation-and-parameter-optimization-stmicroelectronics.pdf)