Monday, December 5, 2022

Some minor updates to UMMD

Several months ago I noticed that the white overhead lights in UMMD were flickering. It wasn't a high priority so I let it go for a while. I recently got the urge to fix it, hopefully permanently, so I ordered some 12V LED bars to replace the old 24V LED strips that were in there.

The old LED strips, looking up at the "ceiling" in the printer; some dead LEDs, and some flickering. The front of the printer is at the bottom. The aluminum bracket with green clips is the top-down UV lighting.


I found some 12V, 6000K LED bars at amazon and ordered them, pulled the old white LED strips off the ceiling, and installed the new LED bars. I used some Wago lever nuts to connect the bars together and to 12V.

The new 12V LED bars came with mounting hardware. They are good for about 3W each.


The new LED bars installed in the printer. 

One thing I didn't like too much about the printer was the way I had to cut notches in the upper front cover to accommodate the XY stage belts because the motors are mounted outside the printer enclosure. I always thought it looked sort of ugly. I thought about it a little and realized I could just print some pieces to fit on the frame, then cut nice square notches in the front cover and it would probably look nicer, and might even seal a little better to keep the heat inside the enclosure.

Here's the B motor with notches cut in the front cover for the belt and the bolts that hold the XY stage together.

I got to work in Fusion360 and came up with two parts to print that look a little neater. I thought about printing a single piece to fit across the width of the front panel, but realized that unless I printed it vertically, the bed wasn't big enough to make it as a single piece. So I split it into two pieces.

The new print (yellow) at the A motor. There's a rectangular hole through the print for the belt, and a 5mm deep groove on the top and side to accommodate the front cover. There are also holes in the print to cover the two bolts that stick up. The front cover now has clean, rectangular cutouts on the two sides. The printed parts are held in place by tangs that fit into the t-slot on the left and right side and t-nuts and screws on the bottom.


That's it. No big deal.





Wednesday, November 30, 2022

Ikea Frakta (Blue) Bag Handle

 I live about a 100m walk from the garage where my car is parked to my door. I don't like to shop frequently, so I tend to load up, and that means getting multiple bags of groceries from my car to my condo. Someday I'll get some sort of collapsible cart to roll the stuff to my door. Until then I use a different means to schlep the groceries from the car to my door.

I keep two, blue, Ikea Frakta shopping bags ($1 at any Ikea store) in my car to carry multiple bags of groceries, or a bunch stuff to take to and from the makerspace, all at once. The only problem is that if the load is heavy, the bag's sewn-on cloth handle crushes my hand. Ouch!

I could have simply cut a slot in a piece of PVC pipe to make a handle, but PVC is hard and slippery, so it might be uncomfortable with a heavy load in the bag. To a hammer, everything looks like a nail, and to a man with a 3D printer, everything looks like a 3D printing project. I immediately thought to use TPU filament so it would feel softer in the hand than PVC pipe, and the ridges from the printing process would make it easy to grip. 

It took about 10 minutes to design the handle and prep it for printing- it looks like a piece of pipe with a slot cut in it! I used generic TPU, a 1 mm nozzle, printing in 0.5 mm layers with 1.2 mm line width at 30 mm/sec with 15% triangular infill, 2 perimeters, and 2 mm top and bottom thickness. It takes about an hour to print and uses 66g of filament.


CAD rendering of the handle. Pretty simple- draw the C shape, extrude, fillet the vertical edges, chamfer the top and bottom perimeters.


This is the handle printed in red TPU. It's rigid, but has just enough give to keep it comfortable. It's 120 mm long and 35 mm in diameter, which might be a little big if you have very small hands.


The handle in place on the bag. It takes a little effort to attach it to the cloth handles, and a little effort to detach it, too, which is good. 


An alternative location to store the handle- use it to hold the bag so it doesn't unfold when you don't want it to.

This handle should work with any other bag with a cloth handle and even dog leashes.

You can download the STEP file here.


Sunday, November 13, 2022

Arrakis 2.0

Arrakis 2.0 made it's public debut at the Maker Faire Milwaukee on October 22, 2022, and got a nice write-up in Make magazine.


I liked Arrakis, but found some problems after living with it for a while. 

  1. The bottom of the sandbox was made of 1/4" Baltic birch plywood covered with a sheet of black EPDM rubber to keep the ball-rolling noise down. Most of the time it was fine, but with some patterns where the ball passes over the same area repeatedly, the sand would be pushed away revealing the black rubber. I didn't like that so much.
  2. An even bigger problem was that the plywood warped depending on the weather, enough to close the air gap and the magnet would drag on the underside of the sandbox, making noise and producing wood dust. I put a lot of effort into making it run quietly, so this really bugged me.
  3. Running the table at high speed causes the ball to throw the sand, so in the original design I separated the top and bottom as much as possible so I wouldn't have to keep cleaning sand off the underside of the glass top cover. It worked, but I decided that the bottom of the sandbox, where the drawings appear, was just too far below the top cover, requiring uncomfortable seating to view the drawings. 
  4. In packing up for the Maker Faire I found lots of PTFE dust in the mechanism- PTFE isn't ideal for sliding bearings for this reason.

In the interest of keeping this post relatively short, I won't go into too much detail, but will use lots of photos to show what changed.


Arrakis 2.0
Iced latte! See! I really use it as a coffee table.



Sandbox redesign and build

First, the legs were lengthened to raise the XY mechanism higher. Then I built a 45 mm t-slot frame to hold a sheet of 4.7 mm thick tempered glass (same size as the top cover!) and covered the glass with cloth-backed white vinyl. LED strips were mounted in aluminum C channel stock that was screwed to plastic strips that fit into the t-slots in the sandbox bottom frame. A decorative frame, made from prefinished white polystyrene molding, drops into the sandbox on top of the LED C channels. Side panels are made from 1x8" wood and simply bolted to the t-slot frame using t-nuts and countersunk M6 flat head screws.


Sandbox glass bottom sprayed with glue. The glass is the same size as the top cover and is 4.7 mm thick.



Cloth backed white vinyl glued to the sandbox bottom glass. The excess material was trimmed from the edges with a sharp razor knife.


This photo shows the two types of plastic inserts used in the sandbox bottom frame. The black one on the left side just covers the slot and sits flush with the surface of the aluminum. The one on the right side is for holding a plastic sheet, or in Arrakis 2.0, the glass sandbox bottom. When I bought the t-slot at a scrap yard I was careful to grab as many of the plastic strips as I could and they have proven very useful.



Glass sandbox bottom installed in 45 mm t-slot frame. There are black plastic strips filling the slots in the frame. LED strip brackets will eventually be screwed to those plastic strips. This frame is larger than the XY frame by about 6 mm in width and length.


View of the magnet carriage under the glass sandbox bottom. You can see the shadow of the ball. There's approximately 3mm air gap between the magnet and the glass.


Sandbox frame sitting on top of XY stage frame. There are some 5 mm thick printed TPU spacers between the two frames. The sandbox frame is about 6 mm larger than the XY frame in X and Y dimensions. Wood side panels bolt to the sandbox frame using t-nuts and M6 screws. The LED strip brackets screw to the black plastic strips that fit in the slots in the frame.



Bottom side of the LED strip frame showing 3D printed corner pieces. The frame is made of prefinished polystyrene foam, and the corner pieces are 3D printed PETG. All of it is solvent welded together using ethyl acetate (works for both PETG and polystyrene).



White LED strip frame positioned as it will be in the sandbox. The frame prevents direct view of the LEDs. It's made of dense polystyrene foam. I printed some corner pieces (under the frame) and solvent welded them together using ethyl acetate (sold as "MEK Substitute"). The frame is made about 2mm smaller than the inside of the sandbox to allow it to just drop into place.


The side panels are bolted to the sandbox t-slot frame. I haven't yet decided if these will be final and how they will be finished. As designed, the LED strip frame just drops into the box and sits on the LED strip brackets. It lifts out for easy redistribution or removal of the sand.


Original oak wood framed glass top in place. It all fits nicely together, simply by stacking the different parts. The XY frame stands on the floor, the sandbox on top of that, the LED strip frame inside the sandbox, and the oak top cover frame on top of the sandbox and the top glass drops into the oak frame.


One corner of the table showing the screws that hold the side panels on the sandbox t-slot frame. There's room for Ms.Kitty to go under the table now, so I'll be adding a cardboard cover to the bottom of the XY frame to keep her away from the belts. I have not sealed the sandbox with silicone and may not bother- it doesn't seem to "leak" much, if any, baking soda.


Electronics updates

A while back I got a deal on a bunch of 5m long RGB LED strips with IR remote control, controllers, and power supplies. Each controller has sockets for two LED strips, and each socket has 4 wires- +12V, red, green, and blue LED grounds. I resoldered the wires in the controller for one of the LED strips so that they will light up in different colors. The remote control allows adjusting brightness and selecting some color cycling modes that I'll probably never use. There's no way (yet) to control the color from within the pattern files.

The original electronics used five power supplies- one for each motor and one for the controller board and two buck converters to power the LED strips. Arrakis 2.0 now uses a single, 24V, 350W power supply, one buck converter, and adds two ReDump protection circuits and an LED controller driving 12V RGB LED strips. I remounted the electronics and added hinges to the panel so it can be stored out of sight under the table when I'm not doing maintenance on it.



The LED controller wiring for single color operation and rewired for two color operation. If you select white, all the LEDs light up in both strips. Any other color selection yields two different colors.




LED strip controller PCB before rewiring for two color operation. There are 2x 4-wire cables on the left. I rewired one of them, swapping the order of the wire connections, so that the LED strips would (almost) always light up in different colors.





Electronics mounted on hinged plate. The hinges allow the plate to be stored out of sight under the table and swung down for easy access if I need to service any of it. I haven't worked out how it will latch in the up position under the table yet. The buck converter and LED controller are stuck to the power supply using some industrial adhesive tape.




Arrakis 2.0 wiring diagram





Arrakis, the original.




Arrakis 2.0.
I haven't decided how to finish the side panels yet, and I'll have to reprint the feet in some less offensive color now that they are visible. Maybe I'll do something to make the legs look better, too.



One of the new color combos made possible by the RGB LED strips.





This is how the five layers stack from bottom to top: coreXY mechanism, glass bottom sandbox, LED strip cover, oak wood top cover frame, top cover glass. 


The biggest problem with the table now is that Ms. Kitty thinks it's hers, and throws everything I leave on it to the floor. I guess she likes it to be clear so she can chase the ball without crashing into anything.

Bearing replacements


 After I brought the table back home from the Maker Faire, it ran fine for a few hours then suddenly started making some terrible grinding noises when the Y axis moved. I surmised that the bearings were worn through and the mounting screws or metal pins were scraping on the aluminum t-slot.

I originally used PTFE for the sliding bearings in early iterations of The Spice Must Flow and Arrakis because I was pushing the stepper motors to their limits and wanted the lowest possible friction. The servomotors have much more "grunt" than the steppers did so I can afford a little more friction in trade for better wear resistance. I milled new bearings from some UHMW PE stock I found at the Makerspace and installed them in the Y axis bearing blocks and the magnet carriage. It runs quietly again, and hopefully the bearings will last longer than the PTFE did. 

Cat Proofing


Now that there's no "skirt" around the table, I needed to protect the belts and wiring from Ms. Kitty, who likes to chew on things she shouldn't. I cut a large piece of corrugated board from a TV box to fit the bottom of the table and used packing tape to hold it on the frame. Then I added a couple screws and t-nuts with a piece of fishing line to hold the hinged electronics panel up so it would be mostly out of sight.

underside of the table with the corrugated board in place.



View from the top side. If you look very closely you might see the fishing line that is holding the hinged electronics panel up.



CAD File


For those who are interested, you can download a Fusion360 STEP file here










Sunday, July 17, 2022

The CoreXY Belt "Tuning" Myth

I have seen uncountable forum posts, comments, emails, etc., about the need to "tune" belts in a corexy mechanism. The comments usually involve something about phone apps that read the frequency of a plucked belt and how you have to precisely match the tensions of the belts. The concept seems to scare off many would be corexy DIYers, thinking that there is some sort of voodoo required to get corexy machines to work properly. 

It's all nonsense.

There is one primary goal in setting the belt tension. It is to set the tension so that the X and Y axes are square. If they aren't square your prints won't be square- i.e. they will be distorted. What is more important to you, getting perfect middle C from the belts, or getting undistorted prints out of your machine?

It is apparently not obvious why tensioning the belts can affect the squareness of the axes so I have prepared some diagrams, below, that illustrate the concept. They are based on a diagram I have used a lot in the past so they may look familiar. I used UMMD's stacked belt layout, but the same concepts apply to any other belt layout you may use.

Fundamental assumption- you built the machine so that the X and Y axes are square when there are no belts on the mechanism. Don't assume you can use belt tension to correct for sloppy construction! If your axes aren't square without the belts, no ifs, ands, or buts, it's wrong. Fix it.


There are different ways to tension the belts, but adjustment must always be done on each belt, independently. If you move P3 or P4 in the Y direction, you tension both belts. That's not what we want to do. I illustrate tensioning by moving the motors. You could tension this belt by adjusting the attachments at the extruder carriage, or by having pulleys pressed against the belt between P3 and P4 or between the A motor and P4. 

Note: In the examples I use moving the motors to tension the belts because that's how I do it in my printer. It doesn't matter how you tension each belt- screw adjustments at the extruder carriage, moving motor, etc., the effect of the increased tension on the belt will be the same on the X axis.

When you move the A motor, P1 and P2 will experience forces created by the tension in the belt. There will be X and Y components of the forces at those pulleys, but we can ignore the X components because they don't affect the position of the X axis. The Y components of the force, illustrated by the green arrows are equal and in opposite directions. That is what causes the X axis to tilt out of square with the Y axis.

If everything is made of metal and bolted together tightly, how can the X axis possibly rotate out of square with the Y axis? Let's see... the Y axis bearing blocks to which the X axis rail is attached are not perfectly rigid and will deform slightly. The Y axis rails and whatever they are mounted on will also flex a little (especially if they are end-supported round rails). The X axis itself will also flex a little. All those little imperfections add up and will allow the X axis to tilt relative to the Y axis. Don't believe it? Try this experiment before you put belts on the mechanism:

Hold one end of the X axis against one of the mechanical stops at one end of the Y axis. Now grab the opposite end of the X axis and try to move it along the Y axis. Of course it moves. The X axis acts as a long lever arm against the opposite, fixed end of the axis. A little force applied at the free end turns into a big force at the opposite end of the axis, causing all those little flexures to occur. Notice that it doesn't take a lot of force to move the free end of the X axis. 

Also note, if you stood any of the pulleys up on their axles like fence posts, the mounts will flex, especially if they are anchored in printed plastic brackets. The printer's frame, if it's made out of thin materials such as plywood or 20mm square t-slot, will also distort, so you want to build your printer to minimize these problems- design pulley supports to hold the axles at the top and bottom, and build a rigid frame for the printer or at least its XY stage. The diagrams below ignore these problems.

Now imagine what adding the second belt is going to do:



2nd belt in place before it is tensioned...

Now tension the 2nd belt by moving the B motor.

Notice the forces created (red) are opposite those created when the first belt was tensioned (green). Also notice that the arrows representing all the forces are longer because tensioning the second belt (red) increases tension on the first belt (green).

The X axis rotates back into square with the Y axis and your printer will now be able to make undistorted prints.

 If your printer's mechanism were built with absolutely perfect mechanical symmetry, the belts would be equal in tension when the axes are square. No one builds printer mechanisms with perfect symmetry, therefore when the axes are square, the belts tensions will not be exactly equal. It doesn't matter. Belt driven linear positioning mechanisms work well over a wide range of belt tensions. 

I've put the above illustrations together into an animated .gif file:



Some manufacturers, such as Gates, have phone apps to set the belt tension based on the type and size of belt, the length of span, etc., so you can use it to set the tension to the manufacturer's specified optimal tension value (assuming you know what that value is, and can convert it to frequency). I wouldn't assume that all belts have the same optimal tension, so if you're using no-name Chinese belts and adjusting them to Gates specs, you may or may not be getting what you are expecting. OTOH, it's nice to have some objective indication of belt tension, even if it isn't optimal. The good news is that belt tension isn't critical al long as you set it high enough that the belts don't flop around but not so high that they cause excessive wear on the bearings in the motors or binding of the mechanism. "Tight, but not too tight" applies.

I hope this clears up some of the silliness that the internet always seems to provide a home for..


Sunday, May 8, 2022

Bank Account Protection Circuit for Servo/Stepper Motors

Update 6/11/22

The parts I ordered from Mouser finally arrived, after 6 months of delays in getting the connectors. Here's one of the boards, fully assembled, using the 1W wirewound resistors and including the connector:




If you decide to build some of these circuits, you can skip the connectors and just solder the power in and out wires to the board.

Now back to the original post...



Prologue:

I wrote most of this post a couple months ago but didn't publish it because I was waiting for the connectors I ordered from Mouser Electronics. When I first ordered them, one piece was out of stock and due to be back in stock in a couple weeks. In a couple weeks I got an email informing me that the back ordered parts wouldn't be in for another month. A month went by and I got notice that the backordered parts were in stock but one of the other pieces was now out of stock. They're telling me that the parts should be in stock at the end of May. 

I decided to try using the servomotors in my corexy 3D printer, Ultra MegaMax Dominator and wanted to have protection for the controller board and all the other stuff that connects to the power supplies that power the XY motors, so I went ahead and wired in the protection circuits without the In/Out connectors.

Next time I order parts, I guess I'll have them ship as they arrive in stock instead of holding shipment until all parts are available.


Why Does My Bank Account Require Protection?

A while back, when I was working on the Arrakis sand table, I discovered that one really needs to take some special precautions when driving servomotors (or steppers) at high speed and acceleration. I had a Duet controller board, a couple buck converters to power LED strips, and servomotor, all connected to a single 200W 24V power supply. I made the mistake of driving the mechanism into the end of an axis at 1500 mm/sec. The sudden stop caused the motor's kinetic energy to be converted to electrical energy which ended up on the power supply line, blowing up the controller board, power supply, and buck converters, about $200 worth of electronics, hence the title of this post.

Motors generate voltage that opposes the voltage trying to make them turn. Under certain conditions, they can generate more voltage than the driving voltage. Those conditions include driving them at excessive speed, manually turning them (such as when sliding around the extruder in a 3D printer by hand), and slamming into physical stops while they are moving at high speed (like I did). In the Arrakis sand table, a simple error in generating the pattern file that's a little bigger than the actual table dimensions (combined with an incorrect axis maximum definition in the config file) can cause such a sudden stop. In servomotors like the iHSV series parts I used in Arrakis, the specified maximum rotational speed, 3,000 rpm, is limited by the self-generated voltage. When generating a pattern file for Arrakis, it's easy to make a mistake that will drive the motor beyond the 3,000 rpm limit.

Protection can take different forms. In Arrakis, which runs RepRap firmware on a Duet WiFi 3D printer controller board, I can program speed, acceleration, and travel limits in the Duet's configuration files. In theory, the fault condition should never occur. However, all that assumes that the controller hasn't lost its mind, that there are no mechanical failures, and that the dumbass (specifically, me) experimenting with the mechanism remembers to set the correct software limits in the controller.

What is really needed is a device that will protect my bank account from my stupidity, an insane controller board, or a mechanical failure in the mechanism. Preferably it will be a circuit that will sense a fault condition and keep it from damaging the electronics that might be sharing a power supply with the motor.

Someone on a web forum pointed out a protection circuit in an app note from Gecko Drives, a company that makes stepper and servo motor drivers. 




The circuit is pretty simple- the 1,000uF cap absorbs small current spikes that may occur under normal operation of the motor. Normally, motor current from the power supply goes through the diode to the integrated motor/driver. In the event of a sudden motor stop due to hitting the limit of an axis, or a bearing seizing up, or some object blocking the motion, the motor will put a reverse current spike on its power line. That will cause the voltage on the capacitor to rise above the power supply voltage, reverse biasing the diode (switching it off) which will turn on the transistor, dumping the current coming from the motor to ground via the 33 Ohm resistor. The power supply and anything else connected to it will never see the voltage/current spike from the motor.

I ran a simple simulation in LTSpice to see how it works. The voltage source on the left is the 24V power supply and the current source on the right stands in for the motor.


It's not much of a model, but it roughly demonstrates what happens in the circuit:



The green trace is the current in the motor. It starts at -3.4A, which represents the loaded motor current supplied by the 24V power supply (V1). When the current reverses direction (the fault condition) the voltage across the motor (blue trace) rises. Current through R3 (33 Ohms) starts at about zero because the transistor is off. When the voltage across the motor rises above 24V, the transistor turns on and current through R3 (red trace) rises. The power supply voltage is the light blue trace- notice it barely moves.

I decided I needed to build some of these circuits as I have 4 more of the motors waiting for projects (in addition to the two that are in Arrakis). I thought about hay wiring them, but it didn't seem like a good idea, so I needed a printed circuit board. I asked around the makerspace and a couple people recommended KiCAD, so I gave it a try.


Parts Selection

When you lay out a PCB, you need to know exactly which parts you're going to use in order to select appropriate footprints. The app note doesn't say too much about the parts so I made some calculations of basic specs then went shopping. I decided to use through-hole mounting for all the parts because they're easy to handle and solder.

The motor current normally flows through the diode so it has to be rated to handle it. The data sheet on the motors seems to indicate that the nominal load current for the motor is 3.4A  (3.4A x 24V=81.6W, and the motor is advertised as a 78W motor, so the current seems about right) and that the driver will alarm (and hopefully shut down?) at 300% of that. 300% of 3.4A is 10.2A, so I chose a 15A 100V Schottkey diode (SMC 15SQ100). In normal operation, with 3.4A going through the diode and voltage drop of 0.5V, the diode will have to dissipate about 1.7W, so it's going to get warm/hot (assuming the motor is loaded and drawing full current).

In the "Arrakis Incident" the motors were brought to an abrupt stop which is what caused the voltage/current spike that blew up the power supply and other electronics. If there had been a protection circuit like the one here, after the stop and current spike, the motor might have started up again (the power supply wouldn't have been dead) and run until it slammed into another hard stop. And it might have kept going, over and over. Hopefully, I'll be there watching it and will shut off power before the repeated slamming around does any damage.

The iHSV motor's integrated drivers appear to monitor the motor speed and/or supply voltage and will shut down the motor/driver if you try to drive it so fast that the self generated voltage exceeds the power supply voltage by some unknown amount. Other motor and driver combos may not do that.

If you try to drive a motor beyond it's spec rpm limit, the voltage at the motor will rise, Q1 will shut off, and the motor will slow down or stop until Q1 turns off again, and then the motor speeds up again repeating the cycle (again, the iHSV motors don't seem to do this). In some mechanisms it might keep doing that until someone notices that something is wrong and shuts down the machine. That means R1, R2, R3, and Q1 will all be working to dissipate energy from the motor on a repeated basis.

I point out the different types of faults because it affects the component selection. When Q1 is off, the normal state, R1 and R2 have very tiny current passing through them. In a fault condition, the current goes up and depends on the magnitude of the voltage/current spike produced by the motor. A 20V rise will cause 20 mA to go through R1 and R2. A 76V rise (which puts us up to 100V, the rating of capacitor C1) will drive 76 mA through them. 20 mA will dissipate 0.4W and 76 mA will dissipate 5.8W. Unfortunately, I can't really predict how the iHSV motors behave. There's no way to know what the voltage/current spike will look like under different fault conditions, and I'm not prepared to risk destroying a motor to find out. I chose to use 1W resistors for R1 and R2 and hope that will be sufficient. I used wire wound resistors because they can tolerate power surges better than other types. The ones I used are good for 10x their rated power (=10W) for 5 sec.

The app note specifies a TIP147 Darlington PNP transistor, so I chose one in a TO-220 package. Does it need a heatsink? This also depends on the magnitude and duration of the fault. I think it will only operate for a few seconds at a time under fault conditions, so I think it is safe to dispense with a heatsink.

This is a relatively high current circuit, so I chose a 4 pin Molex MegaFit connector rated for 23A per pin. I also ordered crimp terminals and shell for the plug that mates with J1.

I put together a BoM with part numbers from Mouser and Digikey here. You can make all sorts of substitutions and find the same or similar parts from other dealers. Prices in the BoM are approximate, of course. 


Designing the PCB

I watched a few youtube tutorials on using KiCAD, and dove in. One thing I found out is that if you're going to have PCBs made by OshPark or other board maker, it's best to set up the board maker's design rules before starting the board layout. 

I went to the OshPark website and looked up their design rules and checked them against the defaults in KiCAD. It turns out there were no issues so I didn't really have to change anything. A more complex board or using surface mount parts might require some of the changes.

Next I drew the schematic diagram:


Once the schematic was entered, I selected footprints for the parts. I checked data sheets for part dimensions and selected appropriate footprints from the KiCAD libraries. Then I just dragged the parts into position, paying attention to the net connections, defined the outline of the board, placed mounting holes, and started putting down traces. I used a filled area on the top of the board for a ground plane and put the rest of the wiring on the bottom of the board.

I had to change the connections to the connector a few times before arriving at the final pinout. Some pinouts led to difficult arrangement of the components on the PCB that required jumpers, etc. I found that by playing with the connector pinout I could create a very simple layout for the board.

The diode will carry the full motor current under normal operation, so the metal traces on the board need to be pretty wide to ensure low resistance and heating. There are a bunch of on-line PCB trace width calculators that will give a pretty good idea of the required trace width for any given current, trace length, and temperature rise. I used this one. I put the diode very close to the connector pins to minimize the high current trace lengths and used 10mm wide, filled areas for those connections for the same reason. They should be able to handle the fully loaded motor current and even the peak current without burning up, even with 1 oz copper.



The capacitor and transistor CE loop are the only other places that are likely to see much current so I used wider traces for those to minimize resistance/heating.

The final steps before ordering the board are to run a design rule check, fix any problems that it reveals, and then export Gerber and drill files.

This is the final layout which I have named REDump for "returned energy dump":

The board layout just before design rule check. The outline of the connector extended beyond the edge of the board so I had to edit it back to pass DRC.


The board is relatively large, 60 x 65 mm, due to the large sizes of the capacitor, 33 Ohm resistor and the connector. I used 4 mm mounting holes set at 50 and 55 mm spacing. I kept the edges of the board clear so that it could be mounted in slots in the walls of a case instead of using the screw holes.

I deliberately hung the connector beyond the edge of the board so that if I print a case for it the connector can protrude through the wall and mechanically support the connector. This overhang was flagged during the design rule check so I edited the footprint silkscreen layers so they wouldn't be drawn beyond the edge of the board.

I ordered a prototype run of 3 of the boards for about $30 from OshPark.

You can download the gerber and drill files in a zipped archive here if you just want to order boards, or the entire set of KiCAD project files is here if you want to do some editing for other parts/footprints.

And here it is:


I probably should have used bigger holes, pads, and pad spacing for the diode and the 1K resistors. When I order more boards I will make the changes to the files.


Assembly

There are no tricks- just put the leads through the holes and solder them down. Pay attention to polarity of the diode and capacitor, and make sure you put the transistor in the right way- the heatsink tab should be toward the connector. 

Note- the 1W resistors and connector are all still back-ordered after about 4 months, so I built it using 1/2 watt resistors and no connectors.


Testing

I did some static tests to verify operation- first just applying supply voltage to the input and making sure it appeared at the output with a resistor substituting for the motor. Then I applied a voltage to the output to make sure sure the diode turned off and the transistor turned on. 

Finally, as I was preparing to install the servomotors in UMMD, I made a test video that indicates the protection circuit will indeed protect the power supply and other circuits from a voltage spike generated by the servomotor.



Installation

When you connect potentially high current wires it's best to avoid ground loops. That means each ground wire should go all the way back to the power supply. That's how I wired this into UMMD. The REDump board ground has a wire back to the power supply ground, and the ground from the motor goes back to the supply ground, not to the REDump board ground.

That means a 3 wire cable is required at the REDump connector. The crimp terminals listed in the BoM are for the plug that fits the jack on the PCB, and are for 14 or 16 gauge wire. If you're going to use some other gauge you'll need to order a different part number for the crimp terminals.

It's also a good idea to twist high current wire pairs, so when I installed the REDump boards in UMMD, I twisted the ground and supply leads from the REDump board back to the power supply, and twisted the motor ground lead around the supply wire from the REDump board together, then continued twisting the ground lead from the motor around the ground and supply leads from the REDump board back to the power supply.

In the future I'll be installing these boards in Arrakis so I can start experimenting with really high speed drawing without having to worry about what might happen if there's a mechanical failure.