L6470 autodriver questions

I’m part of a project trying to use a stepper to test some samples, we are using the spark fun L6470 Auto-driver to drive the single stepper motor to cyclically cycle a part to failure. At the moment we have already blew one L6470 Auto-driver out from an over current event. The second one was hooked up in a test configuration with a small power supply and smaller motor to validate the L6470 auto-driver was in proper working order.

Using a power supply at 8.3 volts and 1.8 amps and hooked up to a red board Artemis for 3.3V logic. The program I loaded was SparkFunGetParamTest from the example code set from the library. The results are attached below. Within all of the failed tests two stand out right off the bat.

10:33:49.655 -> Config reg value: 5C10
10:33:49.655 -> Status reg value: F806

These two readouts are commented in the code to be;

// first check  board config register, should be 0x2E88 on bootup
&
// Now check the status of the board. Should be 0x7c03

Now this is where I got spooked in setting up this new board. The old board that blew smoke readout the same values for this as the new board currently is reading.

Checking the ]datasheets for the L6470 chip (https://www.st.com/resource/en/datasheet/l6470.pdf) it can be found that the CONFIG command should return 0X2E88 not 5C10.

Any information or feedback would be greatly appreciated.

Hi basco,

In order to get a better idea of what might be the issue here, can you please take a few photos of your motor driver and the circuit you have it in and attach them to your reply? Please do your best to make sure they are clear and well lit. Also, can you please either include your code or attach it to your reply? We have never tested this board with the Artemis so there may be some compatibility issues with the library or possibly something going wrong in the setup of the SPI bus. Finally, can you please provide information about the power supply and stepper motor(s) you are using with the L6470?

With a little more information and a good look at your circuit, we’ll be able to get started troubleshooting this issue.

I’m not allowed per orders of the boss to attach physical pictures but I can attach a diagram from Fritzing. The power supply used was a INSIGNIA AC Adapter set to 8.3V 1300mA for testing and reading data off the chip, no motor movement operations were attempted in this lower power state. The Redboard used was a Artemis. With an open log on Qwic connection to it.

Edit: Seems the Attachment upload is not working properly.

https://drive.google.com/file/d/19kCh0j … sp=sharing

Hi again basco,

Thank you for including that diagram but we would really need photos of the motor driver to identify if there are any hardware issues going on here. I understand your boss will not allow you to but without photos, it is very difficult to determine what the problem is. Can you please provide more information about how you are connecting the board? Are you using jumper wires or have you made wiring harnesses and using 2x3 shrouded connectors? If you are using jumper wires, have you soldered them in place on the L6470 or are you using some other connection type? Have you verified all your connections are sound and stable with a multimeter? What motor are you using with it?

That said, there is also an error in your diagram here. I’m not certain where your voltage for VDD on the L6470 is coming from as your wire in the diagram is tied to GND. There looks to be an edit or dashed-line connecting 5V and GND so are you using 5V here? If so, that would absolutely be an issue since the voltage provided over VDD sets the logic of the L6470. To use it with an Artemis (and again, as I mentioned in my previous post, the example code has NOT been tested on Artemis so testing with an Uno or other AVR-based microcontroller would be ideal here), the logic needs to be set to 3.3V. Please verify you are using the 3.3V rail to connect to VDD for the L6470.

Alright, I have a image of the hookup attached below. Went a bit busy with the crop tool. Currently using jumpers wires, ribbon cables and connectors for those are sitting off in the wings awaiting for troubleshooting to be done. Been using a Fulke 287 Multi-meter to check connection to and from the board as well as the functionally of the motor coils.

Somethings of note,

  • The yellow, red and black wires off the bottom of the image are disconnected but would normally go to a LCD backpack, haven’t gotten to the point of bringing that online.

  • Load cell amp was has its Data and Clock disconnected.

  • The lone blue terminal is set aside for later use of power delivery at a later date once we know everything else works.

The Rats nest line in the fritzing image is my fault, miss click of a wire in the breadboard view coupled with a bad flag in the schematic view. It is 3.3V powered rail for the breadboard in that image, revised attached.

I have also attached the breakdown of the data from the two error codes attached. See pages 47-54 of the dspin datasheet for more information. (https://cdn.sparkfun.com/datasheets/Robotics/dSPIN.pdf)

Attached image

Breadboard revised.

https://drive.google.com/file/d/1-J78WL … sp=sharing

Cropped System Image

https://drive.google.com/file/d/1CsDazh … sp=sharing

Bit loadout

https://drive.google.com/file/d/1to0CVz … sp=sharing

Thanks for clarifying how you are connecting it along with the photos. Everything looks wired up just fine so I’m curious if either something else in the circuit is causing problems or if the example code is not compatible with the Artemis since it is quite old and was written for AVR-based Arduinos. Does simplifying the circuit by removing the HX711 and OpenLog help anything? Also, if possible, do you have another Arduino like an Uno/RedBoard or other AVR-based board to test with the AutoDriver? That would help identify whether or not the source of the issue is the Artemis.

I will see if I can fish up an Uno R3 to run it, I know I have an older pre-qwic style red board on hand. Weekend project.

Great! Let me know what you figure out with an Uno R3 or with simplifying the circuit and we can continue troubleshooting.

Alright after a week and two weekends of crossing T’s and fighting with windows defender over the Artemis boot-loader, here is what I know.

The Red board Artemis is giving CONFIG: 5C10 and STATUS: F806 , with the solder pad set to 3.3V on the L6470

17:11:36.810 -> Config reg value: 5C10
17:11:36.810 -> Status reg value: F806
17:11:36.845 -> LoSpdOpt 0
17:11:36.845 -> !!! LoSpdOpt failed
17:11:36.878 -> Expected 1
17:11:36.878 -> Got 0
17:11:36.912 -> MinSpeed 0.0000000000
17:11:36.912 -> !!! MinSpeed failed
17:11:36.945 -> Expected 23.8418788910
17:11:36.979 -> Got 47.5999984741
17:11:36.979 -> StepMode 6
17:11:37.013 -> StepMode passed r/w test!
17:11:37.046 -> MaxSpeed 1983.6425781250
17:11:37.046 -> !!! MaxSpeed failed
17:11:37.079 -> Expected 152.5878906250
17:11:37.114 -> Got 305.1757812500
17:11:37.114 -> FullSpeed 1197.8149414063
17:11:37.148 -> !!! FullSpeed failed
17:11:37.181 -> Expected 160.2172851562
17:11:37.216 -> Got 312.8051757813
17:11:37.216 -> Acc 145.5201568604
17:11:37.250 -> !!! Acc failed
17:11:37.285 -> Expected 72.7600784302
17:11:37.285 -> Got 145.5201568604
17:11:37.320 -> Dec 145.5201568604
17:11:37.354 -> !!! Dec failed
17:11:37.354 -> Expected 72.7600784302
17:11:37.387 -> Got 145.5201568604
17:11:37.387 -> OCThreshold 0
17:11:37.421 -> !!! OCThreshold failed
17:11:37.455 -> Expected 1
17:11:37.455 -> Got 2
17:11:37.455 -> PWMFreqDivisor 16384
17:11:37.491 -> !!! PWMFreqDivisor failed
17:11:37.524 -> Expected 0
17:11:37.524 -> Got 8192
17:11:37.524 -> PWMFreqMultiplier 7168
17:11:37.558 -> !!! PWMFreqMultiplier failed
17:11:37.593 -> Expected 3072
17:11:37.628 -> Got 6144
17:11:37.628 -> SlewRate 0
17:11:37.628 -> !!! SlewRate failed
17:11:37.662 -> Expected 512
17:11:37.662 -> Got 0
17:11:37.662 -> OCShutdown 0
17:11:37.662 -> !!! OCShutdown failed
17:11:37.696 -> Expected 128
17:11:37.696 -> Got 0
17:11:37.696 -> VoltageComp 0
17:11:37.730 -> !!! VoltageComp failed
17:11:37.765 -> Expected 32
17:11:37.765 -> Got 0
17:11:37.765 -> SwitchMode 0
17:11:37.800 -> SwitchMode passed r/w test!
17:11:37.834 -> OscMode 0
17:11:37.834 -> !!! OscMode failed
17:11:37.868 -> Expected 8
17:11:37.868 -> Got 0
17:11:37.868 -> AccK 82
17:11:37.868 -> AccK passed r/w test!
17:11:37.901 -> DecK 82
17:11:37.901 -> DecK passed r/w test!
17:11:37.935 -> RunK 82
17:11:37.935 -> RunK passed r/w test!
17:11:37.969 -> HoldK 82
17:11:37.969 -> HoldK passed r/w test!
17:11:38.002 -> Passed? 0

A stock Uno R3 is giving out CONFIG: 2E88 and STATUS: 7C03, Status is correct in this instance.

17:00:55.081 -> Config reg value: 2E88
17:00:55.114 -> Status reg value: 7C03
17:00:55.114 -> LoSpdOpt 0
17:00:55.149 -> LoSpdOpt passed r/w test!
17:00:55.149 -> MinSpeed 0.0000000000
17:00:55.183 -> MinSpeed passed r/w test!
17:00:55.218 -> StepMode 7
17:00:55.218 -> StepMode passed r/w test!
17:00:55.253 -> MaxSpeed 991.8212890625
17:00:55.288 -> MaxSpeed passed r/w test!
17:00:55.322 -> FullSpeed 602.7221679687
17:00:55.322 -> FullSpeed passed r/w test!
17:00:55.356 -> Acc 1004.0891113281
17:00:55.388 -> Acc passed r/w test!
17:00:55.423 -> Dec 1004.0891113281
17:00:55.423 -> Dec passed r/w test!
17:00:55.459 -> OCThreshold 8
17:00:55.459 -> OCThreshold passed r/w test!
17:00:55.494 -> PWMFreqDivisor 8192
17:00:55.527 -> PWMFreqDivisor passed r/w test!
17:00:55.561 -> PWMFreqMultiplier 3072
17:00:55.596 -> PWMFreqMultiplier passed r/w test!
17:00:55.629 -> SlewRate 512
17:00:55.629 -> SlewRate passed r/w test!
17:00:55.663 -> OCShutdown 128
17:00:55.663 -> OCShutdown passed r/w test!
17:00:55.697 -> VoltageComp 0
17:00:55.730 -> VoltageComp passed r/w test!
17:00:55.763 -> SwitchMode 0
17:00:55.763 -> SwitchMode passed r/w test!
17:00:55.796 -> OscMode 8
17:00:55.796 -> OscMode passed r/w test!
17:00:55.830 -> AccK 41
17:00:55.830 -> AccK passed r/w test!
17:00:55.863 -> DecK 41
17:00:55.863 -> DecK passed r/w test!
17:00:55.896 -> RunK 41
17:00:55.896 -> RunK passed r/w test!
17:00:55.929 -> HoldK 41
17:00:55.962 -> HoldK passed r/w test!
17:00:55.962 -> Passed? 1

A stock older Red board had a CONFIG: 2E88 and STATUS: 7C03

16:14:38.137 -> Config reg value: 2E88
16:14:38.172 -> Status reg value: 7C03
16:14:38.172 -> LoSpdOpt 0
16:14:38.207 -> LoSpdOpt passed r/w test!
16:14:38.207 -> MinSpeed 0.0000000000
16:14:38.242 -> MinSpeed passed r/w test!
16:14:38.275 -> StepMode 7
16:14:38.275 -> StepMode passed r/w test!
16:14:38.309 -> MaxSpeed 991.8212890625
16:14:38.344 -> MaxSpeed passed r/w test!
16:14:38.378 -> FullSpeed 602.7221679687
16:14:38.412 -> FullSpeed passed r/w test!
16:14:38.412 -> Acc 1004.0891113281
16:14:38.447 -> Acc passed r/w test!
16:14:38.447 -> Dec 1004.0891113281
16:14:38.482 -> Dec passed r/w test!
16:14:38.517 -> OCThreshold 8
16:14:38.517 -> OCThreshold passed r/w test!
16:14:38.551 -> PWMFreqDivisor 8192
16:14:38.586 -> PWMFreqDivisor passed r/w test!
16:14:38.621 -> PWMFreqMultiplier 3072
16:14:38.655 -> PWMFreqMultiplier passed r/w test!
16:14:38.655 -> SlewRate 512
16:14:38.690 -> SlewRate passed r/w test!
16:14:38.723 -> OCShutdown 128
16:14:38.723 -> OCShutdown passed r/w test!
16:14:38.757 -> VoltageComp 0
16:14:38.791 -> VoltageComp passed r/w test!
16:14:38.825 -> SwitchMode 0
16:14:38.825 -> SwitchMode passed r/w test!
16:14:38.858 -> OscMode 8
16:14:38.858 -> OscMode passed r/w test!
16:14:38.891 -> AccK 41
16:14:38.924 -> AccK passed r/w test!
16:14:38.924 -> DecK 41
16:14:38.959 -> DecK passed r/w test!
16:14:38.959 -> RunK 41
16:14:38.959 -> RunK passed r/w test!
16:14:38.994 -> HoldK 41
16:14:38.994 -> HoldK passed r/w test!
16:14:39.029 -> Passed? 1

And lastly because it was on hand a Pro Mini clone board, CONFIG: 2E88 and STATUS: 7C03

16:52:39.380 -> Config reg value: 2E88
16:52:39.413 -> Status reg value: 7C03
16:52:39.447 -> LoSpdOpt 0
16:52:39.447 -> LoSpdOpt passed r/w test!
16:52:39.480 -> MinSpeed 0.0000000000
16:52:39.480 -> MinSpeed passed r/w test!
16:52:39.515 -> StepMode 7
16:52:39.548 -> StepMode passed r/w test!
16:52:39.548 -> MaxSpeed 991.8212890625
16:52:39.581 -> MaxSpeed passed r/w test!
16:52:39.615 -> FullSpeed 602.7221679687
16:52:39.650 -> FullSpeed passed r/w test!
16:52:39.686 -> Acc 1004.0891113281
16:52:39.721 -> Acc passed r/w test!
16:52:39.721 -> Dec 1004.0891113281
16:52:39.721 -> Dec passed r/w test!
16:52:39.754 -> OCThreshold 8
16:52:39.788 -> OCThreshold passed r/w test!
16:52:39.821 -> PWMFreqDivisor 8192
16:52:39.821 -> PWMFreqDivisor passed r/w test!
16:52:39.856 -> PWMFreqMultiplier 3072
16:52:39.890 -> PWMFreqMultiplier passed r/w test!
16:52:39.924 -> SlewRate 512
16:52:39.959 -> SlewRate passed r/w test!
16:52:39.959 -> OCShutdown 128
16:52:39.994 -> OCShutdown passed r/w test!
16:52:40.027 -> VoltageComp 0
16:52:40.027 -> VoltageComp passed r/w test!
16:52:40.060 -> SwitchMode 0
16:52:40.095 -> SwitchMode passed r/w test!
16:52:40.095 -> OscMode 8
16:52:40.128 -> OscMode passed r/w test!
16:52:40.163 -> AccK 41
16:52:40.163 -> AccK passed r/w test!
16:52:40.196 -> DecK 41
16:52:40.196 -> DecK passed r/w test!
16:52:40.231 -> RunK 41
16:52:40.231 -> RunK passed r/w test!
16:52:40.231 -> HoldK 41
16:52:40.266 -> HoldK passed r/w test!
16:52:40.266 -> Passed? 1

All of these were setup without the load cell amp and any extraneous components were removed from the setup.

Thanks so much for testing the board with those AVR-based Arduinos. It looks like this is probably an issue with the Artemis/Apollo3 Arduino Core’s compatibility with the AutoDriver library. In order to do some testing here, can you please provide the following information?

  • - Arduino IDE Version #
  • - Apollo3 Arduino Core version (if it is not the latest, please try updating to the latest release and re-test)
  • - Operating System
  • I will try and test one of these here with an Artemis RedBoard and will talk to the engineers working on the Apollo3 core to see if they have any thoughts on what may be causing the problem.

    We have tested it using Arduino IDE 1.8.10 with the Artemis 1.0.17 for the first round along with 1.0.14 and 1.0.12. Between fighting the import export control here to get them allowed, the results have been the same.

    Hmm, we just released a [new version of the Apollo3 core that has some improvements to the SPI library. I am not sure if that will fix the problem but I would recommend updating to v1.0.21 and see if that helps at all.](Releases · sparkfun/Arduino_Apollo3 · GitHub)