Skip to content
Snippets Groups Projects
v0-1.md 5.9 KiB
Newer Older
Jake Read's avatar
Jake Read committed
# MachineKit Stepper Driver

Uses TMC2130  
Uses ATSAMD51  

Has AS5047 backpack ?  

# IC Spec'ing

### Step Driver

I like the Trinamic TMC2130 and TMC262 - the 2130 has h-bridges built in and is suited to NEMA17 size motors - fairly common. The TMC262 is a very similar chip, but only has pre-driving circuitry for external bridges. This means I can use very similar layouts for two 'sizes' of driver - however, they have different register tables, which is a bit of a bummer. I would be writing twice the software (ish). The other option is to roll a board with the TMC626, using very tiny external mosfets and then later very trivially using much larger mosfets, in the rare case that I want a, say, NEMA 34 or 42. Also, I can roll one off the bat that will be solid for NEMA 23s - normally about 2.5 amps of current. This should be no problem.

OK: so - TMC262 w/ external fets, here we go.

![tmc262](https://gitlab.cba.mit.edu/jakeread/mkstepper/raw/master/images/tmc262.svg)

## Mosfets

I also need: **Mosfets** then, as I'm going for external option. 8 per board: 2 full bridges. I'll look for arrays - like two or four in a package, this should help keep things small. I like two, for each h-bridge... There is a nice [4.1A continuious / 14A peak DirectFet in a small package](https://www.digikey.com/product-detail/en/infineon-technologies/IRF7665S2TRPBF/IRF7665S2TRPBFCT-ND/4695505) - this might be appropriate for a big driver. As it turns out, there's [this](https://www.digikey.com/product-detail/en/on-semiconductor/FDMQ86530L/FDMQ86530LCT-ND/3847309) appropriate-looking full H-bridge in a small package that will drive 8 Amps at 60v. That's enough for even fairly large steppers... It's got a reasonable RDSon and pretty tiny gate charge... so I feel OK about this as a first shot. Bueno. I am ready to get a schematic going and build library parts.

## Sense Resistor

Sense resistors generally need to scale with the expected motor current - so I want to find a package size that I can use for large and small motors...

### Microcontroller

This stepdriver is part of another project on networked machine control (I am calling this MachineKit, although I may have to change this as I am now realizing that machinekit.com is taken). My favourite new microcontroller for those endpoints is the ATSAMD51, so it's the stand-in. I would also consider the ATSAMD21 (these are both very well supported by 'the community') and the 51 is newer, faster, etc, at a price increase from $2 -> $4. But, in the interests of only dealing with one set of registers, bootloaders, packages, etc - I am just going to not think too hard and pick the ATSAMD51 for this bb, as well. Future firmware-writing self will thank me.

### To Encoder or not to Encoder?

[Mechaduino](http://tropical-labs.com/index.php/mechaduino) is a really excellent project that Sam and I are fond of. They use an AS5047 encoder to resolve more-steps-than-should-be-possible-with-a-stepper. In combining this with the fancy drive technology in the TMC chip, we can basically arrive at a low cost closed-loop motion control solution, so that's pretty rad. I'm familiar with this chip and use it in my brushless motor controller, so it's feeling quite likely I will implement it here as well. My one quam is the added complexity, etc. I could mount it right in dead-center of the board, use side-mount leds for indication and then have a nice clean backplate... (I am trying to avoid a two sided board). I had also thought I would perhaps have the possibility for an external encoder-only board... but, again, less complexity the better. Backplate mounter. OK.

## Form Factor

A-la [Mechaduino](http://tropical-labs.com/index.php/mechaduino) and many other solutions, this beckons to be mounted on the arse-side of the motor it is responsible for... that way, it looks neat, and we can just glue a magnet on the back of the shaft to read position with our encoder. In the future, I really want to also control NEMA8 and NEMA11 motors (because they're cute as heck) but for the immediate future NEMA17s are OK and I can always use a laser-cut adapter to mount the same board onto a NEMA23. OK, again, simplicity wins, we go for the NEMA17 board, but spec drivers to NEMA23 size.

# Board Design

OK, I only have two major footprints left to draw / place - the AS5047D and the sense resistors.

Done, now schematick-ing ...

Done that...

![schematic](https://gitlab.cba.mit.edu/jakeread/mkstepper/raw/master/images/schematic.png)

Now routing - tricky! The H-Bridges are tight for space and I have to route signals around a big GND and VCC bus, while leaving a nice exit path for the motor coil lines. This took some real fanangling. Here's an early shot at it

![routing-begin](https://gitlab.cba.mit.edu/jakeread/mkstepper/raw/master/images/routing-begin.png)

And finally resolving one of the bridges in a satisfactory way...

![routing-one-bridge](https://gitlab.cba.mit.edu/jakeread/mkstepper/raw/master/images/routing-one-bridge.png)

These sense resistors are huge. 

Then I have the big, dubious challenge of picking a network interface port for this whole next rev of work. Oh my. Then I will be doing schematic layup and will be on my routing way. Hurray.

I choose JST SH connectors, seem to be actually fairly common, cheap, etc, to check: can I get assemblies on digikey?

OK, nice, things resolved OK. Done with this. Will do a double-check and then ship these out along with a few others to kick of IAP...

![routing-complete](https://gitlab.cba.mit.edu/jakeread/mkstepper/raw/master/images/routing-complete.png)

# Erratta, Next Steps

Just discovered the TMC2660 - the chip I should have used. Welp. Has 2.6 amp drive with integrated mosfets, and costs less. Same set of SPI registers, so I can swap it in software wise, which is nice. I still feel OK that I went through with the TMC262, now it's easy to make a new chip for ~ 6-8A drives a-la NEMA 32 ++ , and next time I can probably pretty easily drop in the TMC2660 for NEMA17 and 23's. OK.