Thursday 30 July 2009

Lessons from the A3977

Having established that I want to move to a stepper driven extruder I set about designing a new extruder controller for HydraRaptor. I fancied using one of the Allegro micro-stepping chopper drivers.

With these chips there are a few things you can adjust by changing component values, like the off time, minimum on time and percentage fast decay. The data sheet explains what they do and gives the formulas but it's not obvious what you should set them to for a particular motor.

Not having any previous experience with Allegro drivers I decided I needed to knock up an evaluation circuit. Fortuitously Zach had sent me some PCBs a long time ago that were his first version of the Stepper Motor Driver v2.0. They used the PLCC version of the A3977.

PLCC packages were a bit of a halfway house between through hole and surface mount. They have leads which come out of the side and then curl underneath.

They are handy for programmable devices because you can either surface mount them or put them in sockets (which can be either SMT or through hole). The problem with them in this application is that using a socket is not recommended for current and heat dissipation reasons.

That makes the package a worst of both worlds solution. It is big and bulky like through hole parts but still difficult to hand solder because the pins are underneath. The surface mount version of the A3977 is a fine pitch (0.65mm) TSSOP with a heat slug underneath, so again not easy to solder by hand, it really needs to be done by the solder paste and oven / hotplate method.

Zach moved to the A3982 on subsequent versions, which is easy to hand solder because it is in a SOIC package with 1.27mm pitch. It also has a lower external component count. The down side is that it does not do micro stepping and is only 2A rather than 2.5A. I will probably use the A3983 (which is like the A3982 plus micro stepping and in a TSSOP package).

I managed to hand solder the PLCC at my second attempt. My first attempt had a short, which damaged the chip. I damaged the board removing it (with a cutting disk), so I had to start again on a second PCB. Lots of cursing! The lesson is always to meter a PLCC for sorts before powering up as you can't see shorts underneath it.

Here is my test lash up: -

I can set the step rate with a signal generator, vary the supply voltage from 8 to 35V, see the temperature of the chip and look at the current waveform on a scope .

The initial results were disappointing due to a couple of problems: -

The first was that the chopping occasionally had glitches in it. With the motor stationary I could hear it clicking, and with a scope I could see some cycles shorter than they should be. It got worse with higher supply voltages. At low speeds it did not make much difference, but it did lower the maximum speed. I tracked it down to a lack of high frequency decoupling on the 12V rail. I added a 220nF de-coupler close to the chip and the problem went away. Adding it further from the chip actually made it worse.

The next problem was that the microstepping was very uneven. I had noticed that same effect with the z-axis of my Darwin using the $800 microstepping drivers (that I got cheap) that I use on HydraRaptor. At the time I put it down to the small, large step angle tin can motors I was using at the time not being very linear. When I moved to larger 7.5° tin can motors I still had the same problem, and even with the Keling NEMA23 1.8° motors it did not seem right. This puzzled me because they are very similar to the NEMA23 motors on HydraRaptor, which work well with the same drivers. The shaft encoders have the same resolution as the ×10 microstepping and they are always spot on or one count out, so pretty linear.

With the A3977 it is easy to get an idea of the current waveform of the motor by measuring the voltage on the sense resistors. It should be a stepped sine wave like this: -

Regardless of which way the coil is energised, the current flows to ground through the sense resistor, so the waveform looks like a full wave rectified sine wave. The current only flows in the sense resistor when the chopper is in the on state though. In the off state the current is circulating through the coil and the bottom two transistors of the H-bridge, so the current in the resistor is zero. That is why there is a bright line along the X-axis. On the falling edge of the wave you can see the sense current goes negative. That is because the chip switches to fast decay mode. When the chopper is in the off state, instead of short circuiting the coil, it reverses the voltage on it, causing the current to flow backwards through the sense resistor onto the supply rail. It only spends part of the switching cycle in fast decay so you see positive current, a lot of zero and some negative current, hence the relative brightness of the lines. This is a case where an analogue scope gives you more information than a digital one.

Initially the waveform looked like this, it was somewhat distorted: -

The current rises too quickly at the start of the waveform. The chopper has a constant off time (20uS in this case) and varies the current by changing the on time simply by turning it on until it reaches the target value. But, there is a minimum on time of about 1.4uS, called the blanking period. During that time it ignores the current sense signal to avoid false readings due to ringing on the switching waveform. That means there is a minimum mark space ratio of 1.4 : 21.4 in this case. That sets a minimum current, which also depends on the ratio of the supply voltage to the motor voltage. If this minimum current is more than the lowest microstep value (19.5% of the peak for 1/8 steps) then you get a distorted waveform as above, and the steps are uneven.

To fix it you can lower the supply voltage, raise the current setting or increase the off time. The latter reduces the chopping frequency. If it is below about 15 kHz it will be audible when the motor is stationary. It can also start to beat with the stepping frequency when running at high speeds, particularly when micro stepping, as the step rate is n times faster.

This form of distortion is analogous to crossover distortion on a class B audio amp. You can also get the equivalent of clipping if you use a high voltage motor on a low supply voltage. If the current setting is set to a value which is more than the motor will draw when connected to the supply, then the top of the waveform is flattened off and again the microsteps will be uneven.

Yet another form of distortion occurs when running at high speed: -

Here the back EMF from the motor acting as a generator is preventing the current from falling fast enough to follow the sine wave. This can be fixed by increasing the Percentage of Fast Decay, set by the voltage on the PFD pin. If there is too much you get excessive ripple as shown here: -

For a particular speed and motor there is a sweet spot which sounds audibly quieter: -

So setting up a microstepping drive is not straight forward unless you have an oscilloscope. You can tune the PFD by ear though, as this video demonstrates: -

Tuning PFD from Nop Head on Vimeo.

You can also see the other forms of distortion if you attach a long pointer and step it round slowly.

Another lesson is that you cannot simply just set the current to accommodate different types of motor. You really need to be able change the off time and the PFD as well, especially if you use different supply voltages.

So I solved the mystery of why microstepping does not work well with the expensive drives on my Darwin. They are rated at 7A but I am only using them at 1A, I am also using low voltage motors on a 36V supply. I bet it is a constant off time chopper and the minimum current is too high.

Wednesday 22 July 2009

Thoughts on rafts

Erik asked me for details of how I do the rafts so here are my thoughts.

I am not totally happy with the way they are currently and keep fiddling about with them. At the moment they hold well and give a good flat surface on the bottom of the object, but they can be difficult to remove. I use a blunt penknife to remove them.

I use the long blade to remove the raft from the bed and the object. The smaller blade is handy for clearing out strings from internal areas.

It needs to be not too sharp otherwise it tends to cut into the object, or the bed, rather than prizing them apart, or scraping off strings.

I have developed a thick callous on my thumb while making the Darwin parts, and I frequently stab myself, another reason for not having it too sharp!

I think most people use more sparse rafts than I do. They will be easier to remove, but I find that gives a ribbed base on the object.

My rafts are orthogonal to the axes and the infill is at 45°. I find that convenient because you can tell where the raft ends and the object begins.

The bed I use for ABS is, I think, Foamex PVC foam board. It is a solid dense foam 3mm thick, not the type that is soft foam laminated with paper. I glue it to a piece of wooden floor laminate with Evostick contact glue. Now that Evostick has gone solvent free / water based I find it takes much longer to dry than it states on the tin. Blowing it with a gentle breeze from a fan makes it dry much faster.

Even when it is glued down, I find the warping force is strong enough to lift the edges, so I have a frame around the edge that is screwed down. The foam board is reusable over and over again. I only have to replace it when I have had an accident that makes the raft impossible to remove (head too low, or temperature too high).

Other people have reported good results with Acrylic sheets and of course an ABS sheet will work. I have yet to try these. For HDPE I use a PE-LLD chopping board from Ikea that is 10mm thick.

I find that I need at least three raft layers. I.e. each of the three layers has a definite function.

The first layer of the raft has to stick well to the bed but still be peelable. It also has to be thick enough to cope with bumps and troughs that develop on the bed with use and slight errors in the z-calibration.

The filament diameter I use for the base layer is twice the nozzle diameter or 0.8mm, whichever is the biggest. The height of the head is 0.7 times that. The pitch of the zigzag is 3 times the diameter. The head is relatively low, so that it gives a wide filament pressed against the bed. It is widely spaced so that when the bed has a bump it can spread further without merging. It is extruded at the maximum rate that the extruder will do, which works out at only 4mm/s with 1mm filament through a 0.5mm nozzle. The temperature is 225°C for ABS and 215°C for HDPE. The other layers of the raft are extruded at 240°C to bond strongly to the layer below.

The middle layer's function is to give the raft some strength and bridge the ridges created by the bottom layer. The filament diameter is 1.5 times the nozzle aperture. The height of the nozzle above the layer below is again 0.7 times the nozzle. The pitch is 1.2 times the diameter, so that gives closely packed threads that tend to merge.

The top layer aims to present a flat platform to the object but still be discrete threads so they can be picked off one by one. The diameter is the same as the nozzle and the height is 0.8 times that. The pitch is 1.8 times the diameter.

The raft is cooled back to room temperature with a fan before the object is placed on it. The first layer outline of the object is done at half the normal speed (8mm/s for ABS, 4mm/s for HDPE) and at a temperature of 215°C for ABS and 230°C for HDPE. The first layer infill is done at full speed and at 195°C for ABS and 205°C for HDPE. The rest of the object is 240°C.

One annoying thing is that when I peel the raft most of the top layer is left stuck to the object not the middle layer. This is despite the fact that it was bonded to the middle layer at a high temperature, and to the object with a low temperature. I think the reason is that the contact area is 100% against the bottom of the object, but the top of the middle layer is quite wavy so has less contact area. I think adding another dense layer between the middle and the top will fix that, but waste more time and plastic. It is on my very long list of things to try.

As Erik suggested, small objects do not need to be bonded as strongly to the raft as large objects. Something else I mean to try is some logic like this: -
If the length or the width is > 30mm and the height > 5mm then use a strong raft else a weaker one.

Tuesday 21 July 2009

Production issues

Since the beginning of the year HydraRaptor has been fairly reliable. I optimistically thought that I could get the 100 hours of printing done in a week. I set one build off before I go to bed and another before I set off for work. I use these slots to print the large parts, in multiples if possible. I use the evenings and weekends to print the many smaller parts while I am around to remove them.

I have a script that can print multiple copies of the same object. It works out how many can fit on the bed and spaces them out so that the head can get in between them. It then prints them, one at a time. I have to remember to tweak the script whenever I change the extruder shape. It simplistically works out the bounding box of the object and then uses the object height to decide how fat the extruder is at that height and spaces the objects so the extruder clears their bounding box. A more sophisticated approach would be to do collision detection between 3D models of the extruder and the object. That would get them a bit closer together in a lot of cases, but I don't consider the gain worth the extra complexity.

I could get a lot more on the bed if all the objects were printed one layer at a time. The easiest way to do that is to load them all into a CAD program, place them like a jigsaw and then join the bases with a very thin membrane that is too thin to actually print, but makes them into one object so they can be sliced together. The reason I don't do that is that the chance of a breakdown in a build that would take tens of hours, possibly days, is too high at the moment. Also, if it did go wrong it could waste a lot of plastic. The objects would also end up with a lot more string on them as the extruder has to flit between them on every layer. Perhaps when the system is more reliable, and ooze control is better, I will switch to this approach.

Right from the start things did not go to plan and in the end it took two weeks to complete the build and used almost all of my free time during those two weeks. Not something I would choose to do again until I can get it much less labour intensive.

The first time I made these parts the extruder kept breaking due to parts wearing out: the flexible drive cable, the JB-Weld, the 6V GM3 motor, the PTFE barrel and the bearings. Having eliminated all those causes, the breakdowns were more due to human error and bad luck.

This is the extruder I used: -

A recurring problem I had was the extruder jamming due to the heatsink getting too hot, allowing the plastic to melt inside causing the plug effect I have detailed before. It can then no longer be pushed forward, so I have to remove the pump parts and pull it backwards while it is hot.

I have disassembled it and reassembled it so many time that the M3 threaded rods started to lose their threads. I keep meaning to make a wider extruder with M5 bolts but never get round to it. Once the extruder has broken you can't print new parts so you have to fix it some other way, then you don't need the new parts! I should really keep a spare working extruder.

When the threads had stripped, rather than replacing them, I swapped the bottom two wingnuts for threaded brass spacers. They have a much longer thread engagement area, so get round the problem. They are also blind, so they only go on so far. I found with them fully on, I got the right spring tension for ABS using a pair of M4 nuts as spacers. For HDPE I added a second nut each side. Being able to reset the tension consistently each time I put it back together was a big bonus.

The reasons it got too hot were various, but fundamentally it needs a better heatsink or a fan to give more margin between the running temperature and the glass transition of the plastic. The new extruder controller I have built but not tested yet has a second fan drive and a second thermistor input to allow the cool zone to be regulated. A simpler solution in the case of HydraRaptor would be to make the extruder base / clamp out of aluminium. That would conduct the heat to the z-carriage, which is all aluminium, so could dissipate hundreds of watts .

I eventually tracked down the first reason for over heating to a bad four pin connector in the wires to the heater and thermistor. They are rated at 3A in the Maplin catalogue, but I have had problems with them on the extruder controller before and I am only putting 2A through them. The connections go high resistance for no apparent reason. If it is the heater connection then the heater cools down and the connector gets hot. I have had one de-solder itself from the board.

This time the thermistor connection intermittently went high resistance causing a low temperature reading. I also had the extruder motor stop during a build, again it appeared to be due to its connector failing. I don't know why they do this. If I re-seat them then they work for a while and then fail again. Perhaps they are not rated for the number of insertions they have had due to constantly rebuilding the extruder for 2 years! I have built my new controller with Tyco connectors rather than these unbranded ones.

I switched from the 0.3mm nozzle I have been using recently to 0.5mm so that I could use the same g-code I made the first set of parts from. I can do that because I only use the g-code for tool path information. All the machine settings like temperature and feed rate are in my script.

After the nozzle swap, molten plastic started oozing out of the side of the extruder. The bolts which clamp the compression joint had worked themselves loose after many heat cycles. Changing the nozzle broke the seal and let the plastic out. Tightening them again fixed it.

With the older 0.5mm nozzle I had trouble getting its PTFE cover to stay on. This is essential for making the nozzle wipe work and prevents burnt bits of plastic getting incorporated into the parts leaving brown marks. I had a daft idea of taping it on with Kapton tape. That did not work, but when putting it on I forgot the thermistor wires round back and broke one off.

I had to drill another hole and stick a new thermistor in with Cerastil, a 24 hour job. Worse than that I must have mixed the Cerastil with too little water because it started to come out a day later. Because it was out of sight I did not notice, but the objects started to get very hard to remove from the raft and the raft from the bed. It was only when I broke a hole in the surface of the bed that I realised. So another 24 hours of repairs!

I fixed the PTFE cover with two tiny set screws into indentations in the nozzle.

Other times the heatsink seemed to get too hot for no apparent reason, the hot weather did not help. Generally it failed near the end of a large object, very annoying. In the end I used a mains fan about 1m away to keep the heatsink cool.

Apart from the reliability problems the other issues I had were as follows: -

The corner blocks have hair line cracks through the narrow bits half way up the middle of the vertical edges.

This happened on some of the blocks on my original Darwin and does not seem to matter. I think it was worse this time round because the rafts I used held them down better, leading to less curl up of the bottom corners, so more stress through the edges. I made these with 90% fill, rather than 25%, to ensure they were strong enough. It made absolutely no difference to the cracking but added 8 hours to the print time. It makes the thin bits stronger, but it also increases the warping forces by the same amount.

The rafts I use at the moment are very well bonded. On the up side that reduces warping by holding the object down, but it is quite difficult and time consuming to remove. The only object that pulled away from its raft was the extruder drive block.

This is the worst case in the set because it is both wide and thick. Fortunately it does not need to be flat.

This part came out a bit bockety where it gets thin near the top: -

The problem is the layer is so small it does not have time to cool before the next layer arrives on top. I fixed it by adding some logic which halves the extrusion speed if a layer would take less than 10 seconds at full speed. You can see it completely fixed the problem: -

It was not sufficient for the very thin opto tabs though, so I also cooled them with a fan. Here are the with and without fan versions side by side: -

I won't be printing another set until I get my own Darwin up and running. I hope to double the extrusion speed and reduce the ooze with a stepper driven extruder. The bed is much bigger so perhaps it will only need two batches taking about 1 day each.

Monday 20 July 2009

HydraRaptor's second child

Back in March I had a visit from Marcin Jakubowski, the founder of Open Source Ecology. He was over here in Manchester presenting at a conference and asked if he could come and see HydraRaptor, as he wants to use RepRap machines on Factor e Farm. Like RepRap, his project also aims to change the world.

He asked lots of questions and made a couple of videos of my answers for his blog, which you can see here.

I volunteered to print a set of Darwin parts to help get Factor e Farm up and running with 3D printing. I was confident that I would have my Darwin running in time to churn out the parts. However, because I spent a lot of time experimenting with extruder designs in an attempt to get something more reliable, I ran out of time and had to print the parts on HydraRaptor.

Here they are, all 109 of them: -

All the parts were printed with 0.5mm filament at 16mm/s with 32mm/s moves. Most were sliced with Skeinforge set to 25% fill and larger objects have double outlines to maintain strength.

Here are some stats: -

Build time Plastic volume Quantity required Total build time Total plastic Weight Cost Percentage of total

Corner bracket @ 90%
02:44:44 29.1 cc 8 21:57:49 233.1 cc 291 g $5.83 29%
Diagonal tie bracket-chris

00:27:00 4.8 cc 20 09:00:06 96.4 cc 120 g $2.41 12%
Bed corner
01:32:06 15.5 cc 4 06:08:25 62.1 cc 78 g $1.55 8%
01:23:12 14.6 cc 4 05:32:47 58.2 cc 73 g $1.46 7%
X motor bracket
03:56:35 37.2 cc 1 03:56:35 37.2 cc 46 g $0.93 5%

03:51:39 40.2 cc 1 03:51:39 40.2 cc 50 g $1.00 5%
Y housing
00:56:36 9.9 cc 3 02:49:47 29.8 cc 37 g $0.74 4%
Extruder drive block
02:30:44 26.5 cc 1 02:30:44 26.5 cc 33 g $0.66 3%
X idler bracket
02:28:06 25.4 cc 1 02:28:06 25.4 cc 32 g $0.64 3%
Y motor bracket
01:51:06 19.6 cc 1 01:51:06 19.6 cc 25 g $0.49 2%
Bed constraint
00:43:20 7.5 cc 2 01:26:39 15.1 cc 19 g $0.38 2%
Bed clamp
00:21:39 3.7 cc 4 01:26:36 14.7 cc 18 g $0.37 2%
Extruder base
01:13:19 13.1 cc 1 01:13:19 13.1 cc 16 g $0.33 2%
00:14:21 2.6 cc 4 00:57:26 10.2 cc 13 g $0.26 1%
Opto bracket @ 50%
00:19:00 3.1 cc 3 00:56:59 9.4 cc 12 g $0.23 1%
00:10:46 1.9 cc 5 00:53:50 9.5 cc 12 g $0.24 1%
00:43:50 7.6 cc 1 00:43:50 7.6 cc 9 g $0.19 1%
00:13:24 2.3 cc 3 00:40:11 6.9 cc 9 g $0.17 1%
00:38:10 6.6 cc 1 00:38:10 6.6 cc 8 g $0.17 1%
00:12:35 2.2 cc 3 00:37:44 6.7 cc 8 g $0.17 1%
Bolt plug
00:04:36 0.8 cc 7 00:32:11 5.8 cc 7 g $0.14 1%
Tall foot
00:14:27 2.6 cc 2 00:28:54 5.3 cc 7 g $0.13 1%
Y motor coupling
00:25:02 4.5 cc 1 00:25:02 4.5 cc 6 g $0.11 1%
00:24:12 4.1 cc 1 00:24:12 4.1 cc 5 g $0.10 1%
Short foot
00:11:21 2.1 cc 2 00:22:42 4.2 cc 5 g $0.10 1%
Fan base
00:22:29 4.0 cc 1 00:22:29 4.0 cc 5 g $0.10 1%
Y belt clamp
00:03:43 0.7 cc 4 00:14:50 2.6 cc 3 g $0.07 0%
00:15:48 2.8 cc 1 00:15:48 2.8 cc 4 g $0.07 0%
X-motor washer
00:15:27 2.8 cc 1 00:15:27 2.8 cc 3 g $0.07 0%
00:13:00 2.3 cc 1 00:13:00 2.3 cc 3 g $0.06 0%
Bearing 360 run
00:02:47 0.5 cc 4 00:11:09 2.0 cc 3 g $0.05 0% HDPE
Extruder PCB holder
00:09:45 1.7 cc 1 00:09:45 1.7 cc 2 g $0.04 0%
00:08:45 1.6 cc 1 00:08:45 1.6 cc 2 g $0.04 0% Black ABS
00:08:39 1.1 cc 1 00:08:39 1.1 cc 1 g $0.03 0% HDPE
00:07:43 1.4 cc 1 00:07:43 1.4 cc 2 g $0.03 0% Black ABS
Bearing 360 jam
00:02:49 0.5 cc 2 00:05:38 1.0 cc 1 g $0.03 0% Black ABS
00:04:43 0.8 cc 1 00:04:43 0.8 cc 1 g $0.02 0% Black ABS
00:04:26 0.7 cc 1 00:04:26 0.7 cc 1 g $0.02 0%
00:03:20 0.6 cc 1 00:03:20 0.6 cc 1 g $0.01 0%
00:01:26 0.3 cc 2 00:02:53 0.5 cc 1 g $0.01 0%
Bearing 180-x
00:02:38 0.5 cc 1 00:02:38 0.5 cc 1 g $0.01 0% HDPE
Bearing 180-z
00:02:03 0.4 cc 1 00:02:03 0.4 cc 0 g $0.01 0% ABS

109 74:28:04 778 cc
973 g
$19.47 100.00%

The times and weights are calculated, and don't include the raft time, which is significant, or the time waiting for temperature changes and raft cooling. I weighed the parts on kitchen scales and they came out at 931g, so pretty close to the calculation. The cost shown is on the basis of ABS at $20 / Kg.

I save all the rafts for the day when we get recycling working. I weighed them in at ~ 200g, that is about 20% wastage and will bring the actual printing time up to about 100 hours.

I also wasted 150g in failed prints, for silly reasons, more on that later. It gives a measure of the reliability I am achieving at the moment, i.e. 8 parts failed out of 117 prints so 93% success rate. Of course the bigger the part is, the more chance something will go wrong, so by weight and time it is much worse .

I used plain ABS for most of the parts because it seems to bond better than coloured. I used black for the opto tabs. No guarantee that they will be opaque to IR, but I think black ABS usually is. The green parts are just ones I had left over from experiments.

I made some of the bearings in HDPE as that should be a better bearing material than ABS, lower friction and longer lasting. The black ones are "jam" bearings so I left them in ABS as they want maximum friction.

Some of the parts are my own design. Most significant are the z-axis parts described in the previous post. Here is a list of the other design tweaks, with links to the article describing them:- simplified diagonal tie brackets, X-motor washer, x-carriage bearing and the feet.

Some parts I had never printed before. The Pinch wheel extruder: -

The nozzle wiper assembly has appeared in the latest Darwin release but I can't find any assembly instructions. I leave it as a puzzle for Edward Miller, the guy who is actually going to build this machine.

Similarly the new adjustable z-opto flag assembly: -

I aimed to print these parts over the course of a week, three batches a day, but the machine had other plans and it actually took me two weeks. I will give more details tomorrow.

Sunday 19 July 2009

$8 Z-axis

About a year ago I blogged an alternative Z-axis for Darwin using four tin can steppers instead of one expensive stepper and a belt drive. The only thing missing was a source of cheap motors to make it economically viable. Some time ago Forrest Higgs pointed out a source of cheap 15° motors for $2.50 made by Airpax. I also found them available for $2 at Surplus Shed. That makes a z-axis for $8 possible, which is much cheaper than original motor, let alone the belt.

They are surplus stock, so when they are gone they are gone, but there does seem to be a lot of them around. Unfortunately it costs more than $40 to ship them from the US, so the economics don't look nearly so good this side of the pond.

They are 12V 0.4A per coil, so four wired in parallel will take 1.6A, well withing the 2A capability of the RepRap electronics. They are six wire unipolar motors, but they can also be driven from a bipolar drive by using the red and orange wires as one coil and the green and brown as the other.

The pull in rate seems to be about 200pps, which would give 200 × 15 × 1.25 / 360 = ~10 mm/s with M8×1.25 threaded rod.

The boss on the back of the motor is a bit bigger than the motors I used before so I have updated the bracket design accordingly. The motors come with a spiral drive screw on the shaft. I could not find a way of getting it off, so I made a new coupling piece that clamps over it. It has a pointer so that it is visually obvious if the motors get out of step with each other.

I have uploaded both of these to Thingiverse. The other parts needed are shown below: -

And this is how they go together: -