Shop OBEX P1 Docs P2 Docs Learn Events
Gauging interest - Prop driver for DRV8711 stepper drive chip? — Parallax Forums

Gauging interest - Prop driver for DRV8711 stepper drive chip?

Mark_TMark_T Posts: 1,981
edited 2015-04-19 21:36 in Propeller 1
I have existing code for Arduino to configure this chip, wondered if there was enough interest to
motivate me to write a Propeller version.

Its a flexible microstepping driver that uses external MOSFETs to allow high current handling
(5A or more easily). TI do a sort of breakout board for this:

http://www.ti.com/tool/boost-drv8711

It needs various SPI registers setup correctly after reset to work with any particular motor, but
otherwise is a step/direction driven stepper driver supporting various decay modes, microstepping
to 1/256.

It can also be configured as 2 H-bridges.

The MOSFETs on that board are dual MOSFETs CSD88537ND, with 12 milliohm on resistance,
substantially more capable that the best single-chip stepper drivers which have DMOS MOSFETs
on-chip of 200 miiliohm or more.

Comments

  • Mark_TMark_T Posts: 1,981
    edited 2015-03-23 07:00
    For completeness here's my initial code (Arduino library) https://github.com/MarkTillotson/DRV8711
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-03-24 18:34
    Mark_T wrote: »
    I have existing code for Arduino to configure this chip, wondered if there was enough interest to
    motivate me to write a Propeller version.

    Its a flexible microstepping driver that uses external MOSFETs to allow high current handling
    (5A or more easily). TI do a sort of breakout board for this:

    http://www.ti.com/tool/boost-drv8711

    It needs various SPI registers setup correctly after reset to work with any particular motor, but
    otherwise is a step/direction driven stepper driver supporting various decay modes, microstepping
    to 1/256.

    It can also be configured as 2 H-bridges.

    The MOSFETs on that board are dual MOSFETs CSD88537ND, with 12 milliohm on resistance,
    substantially more capable that the best single-chip stepper drivers which have DMOS MOSFETs
    on-chip of 200 miiliohm or more.

    Hi Mark, I see that you have posted some code too, so it's not just a question then :)

    What would be nice is if you could give us some feedback on the operation of this chip, it's pros and cons if you like. I've used other chips and there are definite limitations with them although in certain applications they work fine.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-03-24 21:27
    Mark_T wrote: »
    I have existing code for Arduino to configure this chip, wondered if there was enough interest to
    motivate me to write a Propeller version.

    I'm interested in a Propeller version.

    Do you think the boards TI sells for $25 are a good deal? I see the DRV8711 chips are $7.29 at Mouser but I haven't check the price on the MOSFETs.

    http://uk.mouser.com/Texas-Instruments/Semiconductors/Power-Management-ICs/Motor-Motion-Ignition-Controllers-Drivers/DRV8711-Series/_/N-41dumZ1yxyu8uZ1z0zls6

    I've got some NEMA 23 steppers I want to drive but the drive board I purchased a year and a half ago doesn't appear to be working correctly (or at all).

    http://hackaday.io/project/4793-propeller-based-cnc-router-controller

    I'm using some cheap L298N drivers to test my control code (just to see if the motors spin) but I'm sure I'll want to use a better driver chip once I install the steppers into the machine.

    I'm wondering if the TI boards are worth the price or if I'd be better off making my own PCB.
  • idbruceidbruce Posts: 6,197
    edited 2015-03-24 21:49
    Duane

    Looks pretty nice :)
  • idbruceidbruce Posts: 6,197
    edited 2015-03-24 21:57
    Hey Duane

    Not trying to prevent any future sales for Mark, but if you really want to get that thing going, get some of those G251Xs I have been talking about. I believe that would do the trick for you. I use them for both NEMA 17s and 23s, and I have used a bunch of them.
  • Mark_TMark_T Posts: 1,981
    edited 2015-03-25 07:47
    Hi Mark, I see that you have posted some code too, so it's not just a question then :)

    What would be nice is if you could give us some feedback on the operation of this chip, it's pros and cons if you like. I've used other chips and there are definite limitations with them although in certain applications they work fine.

    Expanding on what I said:

    Its a flexible microstepping driver that uses external MOSFETs to allow high current handling
    (5A or more easily). You could in theory do > 20A with the right MOSFETs, it supports various
    drive levels and dead-time for external MOSFETs, although I can't remember what gate drive
    voltage it uses (the chip works from 8V to 50V or so).

    It needs various SPI registers setup correctly after reset to work with any particular motor, but
    otherwise is a step/direction driven stepper driver supporting various decay modes, microstepping
    to 1/256. 6 decay modes supported, adaptive blanking time, etc etc.

    It can also be configured as 2 H-bridges - for driving DC motors - still get a range of decay modes.

    Senses over current on the MOSFETs directly.

    Produces a 5V rail from the high voltage supply with only a few capacitors. No external diodes
    needed.

    Has windowed backEMF sensing and a stall detection circuit that uses it. The backEMF is also
    output on a pin.

    The datasheet has more.

    The typical one-chip stepper driver has integrated DMOS bridges with 0.2 to 0.4 ohms on-resistance
    per MOSFET, limiting usable currents to 1.5A (without heatsinking), perhaps 2.5A with (DRV8825
    for instance). They run very hot, and none of them can sensibly handle a large NEMA23 low-impedance
    stepper motor.
  • Mark_TMark_T Posts: 1,981
    edited 2015-03-25 08:09
    idbruce wrote: »
    Hey Duane

    Not trying to prevent any future sales for Mark, but if you really want to get that thing going, get some of those G251Xs I have been talking about. I believe that would do the trick for you. I use them for both NEMA 17s and 23s, and I have used a bunch of them.

    Yes, but 4 or 5 of them is quite expensive. And they won't fit on the footprint of the back on a NEMA17 motor (42mm square) AFAICT
    The chip is exactly what I was looking for a few years ago and didn't exist - integrated stepper driver using external MOSFETs.
    If only it had EEPROM internally for the settings it would be a world beater. Compare the high component count on that Gecko
    board with the dozen or so needed for the DRV8711.

    Expect in the future stepper motors to have integrated driver electronics using chips like this:
    CAT5 or similar to carry drive signals to opto-isolator, and DC motor supply wiring.
    Much less RFI/EMI, robust, you get the right motor driver for the motor, and adding
    an encoder is easier... How things should be done (except for very extreme environments
    of course!)
  • Mark_TMark_T Posts: 1,981
    edited 2015-03-25 13:21
    OK, had a session with this and have working first code.

    You can configure a few things like current and microsteps but most of the decay mode
    settings are hard-wired - it drives a 1.7A motor if 0.05ohm shunts are used, seemingly
    smoothly.

    [ BTW I connect only to GND, #sleep, reset, step, direction, MOSI, MISO (with pull-up to 3.3V), SCLK and SCS ]
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2015-03-25 14:46
    Mark,

    I'm following along to see how you develop this. The $25 TI demo board seems to be a pretty good bargain to learn about this, so I've ordered one from Mouser. The DRV8711 itself seems quite straightforward, SPI interface to the 8 control registers, and you've already got that wrapped up. What's next? It seems like it would quickly become application specific.
  • Mark_TMark_T Posts: 1,981
    edited 2015-03-26 07:59
    Mark,

    I'm following along to see how you develop this. The $25 TI demo board seems to be a pretty good bargain to learn about this, so I've ordered one from Mouser. The DRV8711 itself seems quite straightforward, SPI interface to the 8 control registers, and you've already got that wrapped up. What's next? It seems like it would quickly become application specific.

    You might want to look at these links: http://www.cnczone.com/forums/stepper-motors-drives/247622-anyone-attempted-roll-stepper-driver-using-ti.html
    http://forum.arduino.cc/index.php?topic=295471.0
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-03-26 09:37
    I ordered a couple of the boards today.

    Thanks for the information Mark and thanks for the code.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2015-03-26 10:51
    I see you've been a prime mover on that CNC forum thread, including the nice circuit board you made for post #22, and the web-based setup utility. Are you thinking building up more of those PCBs for sale?
  • Mark_TMark_T Posts: 1,981
    edited 2015-03-26 11:21
    I see you've been a prime mover on that CNC forum thread, including the nice circuit board you made for post #22, and the web-based setup utility. Are you thinking building up more of those PCBs for sale?

    Its not impossible, but only on a hobby use basis. I can make design(s) available, and I've also
    mentioned the possibilities to Adafruit, but not had definite interest from them.

    I am open to suggestions...
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-03-30 21:37
    I received two of the TI "Boosterpack" boards today from Mouser. There was a ridiculous amount of packaging but I suppose that's better than too little packaging.

    I've looked at the code Mark. I think it will be relatively easy to incorporate into my code. Thanks again for sharing.

    I will likely continue testing my code with the cheap L298N boards until I've got the code working reasonably well. My present code generates the individual coil pulses but it will be easy to change it to step and direction output. The main challenge I've had writing the code is getting the axes to accelerate together and appropriately (which I think I have successfully accomplished (though I haven't tested it yet)). I'll move to the DRV8711 boards once I'm ready to run my code on my CNC router.

    I'll add an update here once I get my router up and running using the DVR8711 boards (and your DVR8711 code).

    Thanks for letting us know about these chips and thanks for porting your code to Spin.
  • Mark_TMark_T Posts: 1,981
    edited 2015-04-03 08:00
    Glad to help out - I notice a recent posting on the cnc forum (see my #11) by Jerseyguy1996 pointing out an issue at 48V with the
    TI Boost board (and probably in general) that may require some gate resistors for low-side drivers to suppress
    spurious pre-driver faults. I currently can't power above 30V so haven't seen any issue.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-04-03 08:33
    Looks interesting for applications that require steppers large enough that they pull to much current for a ULN2803. That is as long as it can do full step mode well, and quickly.

    So far I have yet to use that big of a stepper for any of my projects (the largest being Nema 17 that are easily driven through a ULN2803).

    Though it sounds like it requires external devices to achieve the high load anyway, just the same as any current driver, and it is more complex than just using a ULN2803 (because you have to deal with SPI, stepper interface is much simpler).

    I have a intellectual interest. May or may not ever use one, do not know.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-04-08 20:02
    Mark,

    Have you tested your program with the Prop?

    The program appears to successfully set the registers in the DRV8711 but when it reads the registers they appear to return zero.

    Here's the output of your program.
    ts = -857431937 .
                     SPI lock claimed is 0
                                          cog = 2 .
                                                   reset
                                                        0 $0
                                                            1 $0
                                                                2 $0
                                                                    3 $0
                                                                        4 $0
                                                                            5 $0
                                                                                6 $0
                                                                                    7 $0
                                                                                        0 $0
                                                                                            1 $0
                                                                                                2 $0
                                                                                                    3 $0
                                                                                                        4 $0
                                                                                                            5 $0
                                                                                                                6 $0
                                                                                                                    7 $0
    

    Are you getting the same output?

    While I haven't been able to successfully read the registers, I can set the registers using your "setup_DRV8711" method. I've experimented with changing the number of microsteps and this appears to work well. I don't understand the other parameters so I haven't tried to change them.

    I'm using my DRV8711 boards (I'm only used on so far) with NEMA 23 steppers and they appear to work well. Thanks for suggesting these drivers and thanks again for posting your code.

    If you get a chance to check on the register reading part of the program, I hope you let us know.

    If I feel ambitious, I may dig out my logic analyzer and try to compare the traces with what I can read from the datasheet.
  • Mark_TMark_T Posts: 1,981
    edited 2015-04-09 04:25
    Duane Degn wrote: »
    Mark,

    Have you tested your program with the Prop?
    Yes

    The program appears to successfully set the registers in the DRV8711 but when it reads the registers they appear to return zero.
    You have pullup resistor on MISO? My board does that - you need it for all chip outputs since they are open drain.
  • Mark_TMark_T Posts: 1,981
    edited 2015-04-09 04:31
    So far I have yet to use that big of a stepper for any of my projects (the largest being Nema 17 that are easily driven through a ULN2803).
    I doubt you've gone for speed then, a 1.2 ohm bipolar stepper can't be driven by an ULN2803 and can get to many
    1000 rpm with current drive. For CNC applications you want as much speed as you can get for rapids via lead-screws.
    Even 1000's of rpm only gets you a few inches/second with cheap leadscrews.

    Higher impedance 8/6/5 wire motors can be driven unipolar with 2803, but the large inductance means a severe limit
    to top speed - you can drive belts resonably, but not leadscrews.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-04-09 04:38
    Mark_T wrote: »
    I doubt you've gone for speed then, a 1.2 ohm bipolar stepper can't be driven by an ULN2803 and can get to many
    1000 rpm with current drive. For CNC applications you want as much speed as you can get for rapids via lead-screws.
    Even 1000's of rpm only gets you a few inches/second with cheap leadscrews.

    Higher impedance 8/6/5 wire motors can be driven unipolar with 2803, but the large inductance means a severe limit
    to top speed - you can drive belts resonably, but not leadscrews.
    You are correct in that I have not needed that level of speed. I am happy with up to 45 RPM as that is to fast for my 3D printer, thousands of RPM is way beyond what I would need.

    I could see using fine thread drive screws that you may need better speed. Though I have decided to use pulley style drive on my 3D printer.
  • Mark_TMark_T Posts: 1,981
    edited 2015-04-09 04:52
    I could see using fine thread drive screws that you may need better speed.
    Not even fine pitch, standard acme 16mm diam leadscrew has a 3mm pitch, so
    1000 rpm == 50mm/s

    More expensive multi-thread ballscrews can get you a pitch more like 10mm, but
    then you need more motor torque for cutting... Rapids just need the speed so people go
    to high voltage supplies like 80V or more - steppers can go astonishing speeds driven right.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-04-09 06:39
    Mark_T wrote: »
    Yes

    You have pullup resistor on MISO? My board does that - you need it for all chip outputs since they are open drain.

    I had just read that in the datasheet. And no, I don't have pullups on the pins.

    Thanks.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2015-04-12 19:42
    I got one of the TI Boost demo boards last week too and finally and got it wired up today. No joy yet with reading the registers though. Unlike Duane's, mine kicked back all $FFFs.
    ts = 674109133 .
    SPI lock claimed is 0
    cog = 2 .
    reset
    0 $FFF
    1 $FFF
    2 $FFF
    3 $FFF
    4 $FFF
    5 $FFF
    6 $FFF
    7 $FFF
    0 $FFF
    1 $FFF
    2 $FFF
    3 $FFF
    4 $FFF
    5 $FFF
    6 $FFF
    7 $FFF
    
    The TI board does have a 3.3kΩ pullup installed on its SDATO line, but on the 'scope I saw no activity there.
    Prop_SPI_MOSI
    > Boost_SDI
    > DRV_8711_SDATI
    and
    DRV_8711_SDATO
    > Boost_SDO
    > Prop_SPI_MISO
    The clock and chip select (high) looks okay on the 'scope and it appears that the correct commands are being sent from the Prop. I did try reversing the sense of MISO and MOSI, thinking I might have goofed that up, but then it came back all zeros.

    I'm not in a location where I can try it with motors. I think though that the SPI activity should be okay regardless.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-04-12 20:01
    The TI board does have a 3.3kΩ pullup installed on its SDATO line, but on the 'scope I saw no activity there.

    If you getting all 1's ($FFF) the line must be pull-high but I noticed the pull-ups are powered from the 3.3V which needs to be supplied from an outside source.

    The chip has a built in 5V regulator but not a 3.3V regulator. You need to connect 3.3V to the Boost demo board.

    Based on what you're seeing I'm guessing you already know this.


    The chip might not work without a motor attached. It senses the coils before sending pulses (or something like that).

    Did you attach motor power? If not the chip wasn't getting any power. It has an internal 5V reg and has to be powered through "VM." The 3.3V input is just to power the pull-ups, LEDs and pot.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2015-04-12 21:29
    I did have the motor power attached. 12V. I noticed that indeed the fault light comes on if the motor power is too low, like 5V. I hadn't realized that the logic power is derived from the motor power though.
    attachment.php?attachmentid=113870&d=1428898927
    I'll check the wiring again tomorrow. It does not seem like it should test for the presence of motors before the operation registers are set. Are you now able to read the registers and changes?
    240 x 320 - 23K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-04-13 00:25
    Are you now able to read the registers and changes?

    I haven't used my DRV8711 boards since my previous post.

    I've been working on wiring up some hardware so I can test the boards without a PC.

    attachment.php?attachmentid=113871&d=1428908895

    As you can see, I have the x and y axes drivers wired up but I'm waiting for my z-axis board to arrive from Mouser (it should arrive later today (Monday)).

    I was quickly running out of I/O pins so decided to add some shift registers to both expand the output and also expand the input of the Propeller. I'm using the '595 shift registers to control the chip select, reset and sleep pins of the DRV8711 boards. I was surprised to find I still have P0 through P12 Propeller I/O pins free. I may use some of these pins to control a larger screen.

    The fault and stall pins will be monitored using the '165 chip. The '165 chip (or chips (I'll probably add a second one)) will also monitor the limit switches.

    I was able to add a MCP3208 ADC chip without using any additional I/O pins. The MCP3208 shares the control pins used with other SPI devices and the CS line of the MCP3208 is controlled with on of the channels of the '595 shift registers.

    I removed the original screw terminals and replaced them with pluggable screw terminals. I added the new connectors to the bottom of the boards in order to make it easier to add a heatsink to the MOSFET chips. I'm not sure if I'll want/need to add heatsinks or not but if I do, it will now be easier to do so.

    I just finished soldering all the various parts today and I haven't powered up the Propeller since making these changes in hardware.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2015-04-19 21:36
    I left this project with doubts, but this weekend had a bit of time to try it again. Now it is working fine, reading and displaying both the default and updated register contents, driving a NEMA23 stepper. The only thing different now is that I soldered stubs of wire onto the SPI interface pins, to allow connection of the logic analyzer. That did the trick, maybe I had a bad connection before.

    Here is output from the Saleae during the process of setting up the DRV8711 with Mark's demo.
    attachment.php?attachmentid=113940&d=1429504021

    I did make one small change to DRV8711_SPI to make the Salae happy. In the setup_pins method,
    or      outa, SCK_PIN
    
    to initialize the SCK pin high. The DRV8711 does not need that, but the Saleae is picky.

    attachment.php?attachmentid=113941&d=1429504526
    648 x 374 - 44K
    394 x 272 - 47K
Sign In or Register to comment.