Tuesday, June 2, 2020

The Spice Must Flow Gets Servomotors

This is an update to my often-updated sand table project, The Spice Must Flow. 


Different types of motors for different uses


Stepper motors provide lots of low speed torque and high precision positioning without the need for closed loop control. Those characteristics make them great for machines like 3D printers because they don't have to go too fast, they can deliver the precise positioning that 3D printing requires, and open loop drivers are cheap. Stepper motors operate in clicky detented motion, so they tend to vibrate and make noise. Better drivers can microstep them to get smoother motion.

A sand table isn't a 3D printer. While it needs positional control, it doesn't need the high precision positioning of a 3D printer because sand is a low resolution medium. What it needs is speed (well, mine does) and quiet operation more than resolution. I've been trying to make The Spice Must Flow sand table run both fast and quiet, neither of which are characteristic of stepper motors. 

There is another type of motor that can deliver positioning control, speed, and quiet operation. They are called servomotors. Servomotors integrate a brushless motor (smooth and quiet operation) with an encoder to monitor shaft position and driver electronics to provide positioning control at high speeds. 

At the suggestion of someone on the Duet forums, I decided to try installing iHSV servomotors in The Spice Must Flow. I took a look at the range of those motors- they go from 52W NEMA-17 size motors up to 660W NEMA-34 beasts. Without knowing much about them, I chose to stay with NEMA-17 size motors because I couldn't imagine needing a NEMA-34 motor to move a little steel ball around in sand. Based on my experience with steppers (even the NEMA-23 steppers I used in the sand table were rated for only about 12W- rated voltage x rated current x 2 coils) I figured a NEMA-17 sized motor ought to be able to get things moving. There are 52 and 78W motors available for almost the same price, so I chose to go with the higher powered motors, "just in case". In hindsight, the 52W motors would probably have been more than adequate. 

Another big difference between a stepper and a servomotor is the price. You can buy a microstepping driver and NEMA-17 stepper motor for about $25-30. The servo motors I used are "integrated" meaning they come equipped with a driver and encoder so that (mostly) all I have to do is treat them like steppers and provide step/direction/enable signals. Each motor cost about $100 shipped from China. 

Torque Specs


Another big difference between a stepper and a servomotor is the way torque is specified. The servomotors I used are specced for 0.185 Nm torque. That translates to 26 oz-in. A stepper motor with a 26 oz-in torque spec is a small stepper.

One thing I have learned from experience with steppers is that torque is proportional to motor length, all other things being held constant.

Ada Fruit 28 oz-in stepper


Now compare that motor's length to the servomotor:
Servo motor- 83 mm long
This is the servomotor, NEMA-17 size, but the length of the motor is 83 mm.

How can it be that a servomotor that is 83 mm long can have a little less torque than a stepper that is 34 mm long? I have to admit I was skeptical about whether such a low torque motor could be used to drive the sand table. With a little time spent researching the issue, I learned that the difference has to do with the way the torque is specified.

Stepper motor specs include something called "holding torque". Here's a simple explanation: https://www.motioncontroltips.com/faq-whats-the-difference-between-detent-torque-and-holding-torque/

"A stepper motor’s holding torque is the amount of torque needed in order to move the motor one full step when the windings are energized but the rotor is stationary. Holding torque is one of the primary benefits that stepper motors offer versus servo motors, making stepper designs a good choice for cases where a load needs to be held in place.

Stepper motors can hold a load against an external force when the motor is stationary.
Image credit: Oriental Motor U.S.A. Corp

Holding torque is typically higher than running torque, and is limited primarily by the maximum current the motor can withstand. From a practical standpoint, holding torque is the sum of the magnetic force exerted by the coils to hold the motor’s current position, plus the detent torque. Once the motor is moving, the torque available at low speeds equals the holding torque minus two times the detent torque (because the motor has to work against the detent torque)."

The running torque mentioned above is actually called pullout torque. It is the torque that the motor can deliver to a load at any given speed. As speed increases, the pullout torque decreases. Like this (from: https://www.orientalmotor.com/stepper-motors/technology/speed-torque-curves-for-stepper-motors.html)

Exact behavior of stepper pullout torque is a function of the driver characteristics and applied voltage, but the trend is for the pullout torque (the useful kind) to drop as speed increases. Servomotor torque is the continuous torque that the motor delivers at specified maximum operating temperature. At lower temperatures, and intermittently, it can deliver more torque.

servo motor speed-torque curves
This is typical servomotor torque vs speed behavior. Note that peak torque is much higher than the continuous torque. 
iHSV42-40-07-24 speed-torque curve
This is the nearly useless speed/torque curve of the servomotor I used, taken from the motor manual. Notice relatively low, but constant torque right up to 3000 rpm. 0.185 Nm is about 1890 g-cm, or 26.2 oz-in which is about the same as the holding torque of a small stepper.


There's some interesting information about selecting a servomotor for any given application based on the speed/torque curve here: https://www.linearmotiontips.com/how-to-use-torque-speed-curve-to-select-servo-motor/

One thing near the end of that page has proved to be important in The Spice Must Flow: "A servo motor’s maximum torque is limited primarily by heating (due to the amount of current required to produce high torque), while its maximum speed is limited by the motor’s back EMF (voltage produced as a result of motor rotation, which opposes the supply voltage and reduces motor speed). It’s important to note that the application’s maximum torque and maximum speed must fall within the intermittent duty zone. If either value exceeds the motor’s intermittent curve, damage to the motor or drive could occur."

In all the testing I've done so far, the motors haven't even warmed up. I did run into the back-EMF issue when running speed and acceleration tests on The Spice Must Flow, as you'll see later.

So, in summary, a stepper's torque spec, holding torque, is the most torque you can ever expect to get out of it, and torque while it is running will be lower the faster the motor spins. Servo motor torque spec represents the average torque, and it can deliver much more torque on demand, at least intermittently.

Acceleration


How much acceleration might a measly 0.185 Nm torque be able to produce? Some basic physics helps here. Isaac Newton determined that Force = mass * acceleration. The motors I used produce a constant torque of 0.185 Nm (and should produce higher peak torque). I use a 16 tooth pulley to drive the mechanism, the radius of which is about 5.5 mm or 0.0055m so the force available to drive the mechanism is 0.185 Nm/0.0055m = 33.6 N The mass of the X axis, including the belt, pulleys, magnet and carriage is somewhere between 0.5 kg- 1 kg. Plugging 1 kg into F=M*a gives a = 33.6N/1kg = 33.6 m/sec^2. The acceleration of objects near the earth's surface due to gravity is 9.8 m/sec^2, so the acceleration available to the mechanism is 33.6/9.8 = 3.4 G. All this ignores the motor's inertia, hard-to-estimate losses like stiction, friction, and drag/inertia of the sand, so the real value will probably be a bit below 3.4 G, but even if it's only 1/2 of that value, it's still higher than the sand table should need and 17x more than was available from the stepper motors.

The ball is coupled to the sand table's XY mechanism by a magnetic field. Ball movement is resisted by its own inertia and by the sand. At some level of acceleration and/or speed, the inertia of the ball and/or the resistance of the sand will cause the ball to be left behind (or thrown!) by the magnet. That value of acceleration will vary a lot with ball diameter/mass and sand depth/density, and strength of the magnet, so the actual acceleration used has to be determined experimentally. I was using acceleration of 1000 mm/sec^2 with the steppers because I found that the mechanism tended to stall out on some patterns at and above 2000 mm/sec^2.

What does all that mean? It means acceleration is more likely to be limited by the ball and sand than the servomotors. In my tests I have pushed acceleration as high as 20,000 mm/sec^2 at which point the power supplies sometimes reset because the motors try to draw too much current. With higher current power supplies, I'm pretty sure the servomotors would be happy to deliver even more acceleration.

Speed


My speed goal for the table is "soft". Most sand tables are smaller than mine, and run at speeds <100 mm/sec to keep them as quiet as possible, or because the speed is limited by the motors, drivers, or structure of the mechanism. Even though they run slowly, the small size of the table means that patterns will finish reasonably quickly.

The Spice Must Flow is a large table, and I like to run detailed patterns, so if I run it slowly, it takes a long time to finish each pattern. That may be OK under some circumstances, like if it's sitting in my living room and I don't want it to hear it running, but I take the table to Maker Faires and other public events (at least I did pre COVID). People don't want to watch a pattern being generated slowly. They want to see speed! Noise doesn't matter, or even enhances the experience. Screaming motors and sand flying around is fun and exciting! A table that's capable of running fast is also capable of running slow, so if it's built to run fast, it's more versatile.

In practical terms, there are three limits to be concerned about- the speed limits of the sand table, the controller, and the motor. When there were steppers in the machine, they defined the maximum speed because of their limited performance. Based on my experience, 500 mm/sec seems to be the upper end of the speed range for drawing the patterns and still having enough detail that they look nice. Of course, the Duet2 controller applies acceleration and deceleration to all the motion, so if the speed is set to 500 mm/sec, it will only actually be reached if the acceleration setting is high enough, and the line length is long enough to allow it. If the ball runs much faster than that, it starts throwing the sand around and some of it ends up stuck to the underside of the polycarbonate top cover and starts interfering with the view of the pattern. I don't want to have to keep cleaning the top off, so the next iteration of the table design will have a glass top located higher above the sand. At some too-high combo of speed and acceleration the magnet will either leave the ball behind or throw it.

As for the motors, with 16 tooth drive pulleys, the magnet/ball moves 32 mm/rev. Moving at 500 mm/sec will require the motor to spin at 500 mm/sec / 32 mm/rev = 15.625 rev/sec which is 937.5 rpm. That wouldn't work with a stepper, but is well below the 3k rpm upper limit of the servomotor.

At 32 mm/rev, if the motors run at their maximum specced speed, 3000 rpm, the ball will move at 1600 mm/sec - far beyond what is possible when trying to leave a nice pattern in the sand, or maybe even leave the sand and ball on the table, depending on the ball size and depth of the sand.

The Duet2 WiFi controller can only produce so many (120k) step pulses per second. The motor driver (on the motor) can be jumpered for different steps/rev just like a stepper driver. The lowest steps/rev setting available is 800. If I were to run at 120,000 pps, and drive the motors at 800 steps per rev, that would put an upper limit of 150 revs per sec = 9000 rpm- far beyond the motor's limit of 3000 rpm. So the Duet2 controller's 120k pps limit isn't going to limit the sand table speed.

The motor specs show constant torque up to 3k rpm. As we learned from lineramotiontips.com, the upper speed of the motor is limited by the back EMF the motor generates. For the iHSV motor I used, exceeding 3k rpm will cause the motor to generate voltage higher than the supply voltage which could potentially damage the driver (and Duet controller). Later we'll see that I did drive the motor fast enough for the Duet2 board to report "overvoltage condition".

So the limiting factors for speed are, in order from most to least important, the behavior of the ball and sand on the table, the motors, and the Duet2 WiFi controller.

Resolution


If the target speed is 937.5 rpm (= 15.625 revs/sec) to run the table at 500 mm/sec, and using the maximum 120k pps from the Duet2 board, 120,000/15.625 = 7,680 steps/rev. So any setting of 7,680 steps/rev or less should allow the table to hit the target speed of 500 mm/sec.

Sand is not a high resolution medium, especially not at 500 mm/sec or more. Let's say we used the 7,680 steps/rev calculated above. Since one motor rev moves the ball 32 mm, that 7,680 steps/rev translates to 7,680 steps/rev / 32 mm /rev = 240 steps/mm. That resolution is 2 orders of magnitude higher than needed in a sand table and 1 order of magnitude beyond what's needed in a 3D printer. More realistically, the sand table probably doesn't need more that 1 step per mm resolution.

The minimum settable steps/rev value of the motor is 800. 800/32 = 25 steps per mm, still far more resolution than needed in the sand table. At 800 steps/rev, the controller will have to generate 800 steps/rev x 15.625 rev/sec = 12,500 pulses per second- a very leisurely pace for the Duet2 controller board. Any steps/rev setting in the motors between 800 and 7,680 will provide more than enough resolution and allow top speeds of at least 500 mm/sec.

The motors have 1000 line encoders to monitor the rotor position, so I have been using them set for 1000 steps/rev. At 1000 steps/rev, the Duet should be able to drive the motors well beyond their 3k rpm limit, meaning more than 1600 mm/sec.

Yet Another Redesign of the Sand Table Mechanism


I started at the motor mounts and worked my way through all the other parts. I changed the pulleys to larger diameter, stacked F625 bearings with printed flanges to try to eliminate the squeaky noises that the 3D printer pulleys with the tiny bearings were making. Changing the pulleys required redesign and printing of the corner pulley blocks and the Y axis bearing blocks. I kept the magnet carriage as-is and designed the other parts' pulley spacing to try to keep the belts parallel to the guides.

Corner Pulley Blocks


New corner pulley block
One of two corner pulley blocks. Pulleys are stacked F625zz bearings with printed flanges (green) and orange TPU "tires". These are much quieter and longer lasting than the 3D printer pulleys with tiny bearings I used to use. The blocks are printed in four pieces, the base, top cover, and two cylindrical spacers. Pulley axles are 5mm diameter steel pins that are captured in holes in the top and bottom of the block. The block is held in place with two t-nuts.


The bases are screwed to the table's frame with screws and t-nuts, then the pulley shafts, pulleys, washers, and spacers are added, and finally the top cover is screwed down.

Motor Mounts


I designed the motor mounts the usual way - start with a solid block and carve away just enough material to allow everything to fit properly. The result is a very solid design that doesn't flex perceptably under belt tension even though it is made of plastic. The motor mounts are designed to fit the inside of the t-slot rails just like the old mounts, only now, with the low torque but high speed servomotors, I'm using 16 tooth drive pulleys to maximize the force available to move the mechanism. One change I made was to add F625 bearings to the motor mounts to support the ends of the motor shafts against the belt tension. Testing found runout in the motor shafts and the bearing made it a little noisy, so I ended up not using the extra bearings.

The mounts are designed so that the vertical spacing between the belts will be 4 mm using the centerline of the t-slot as the reference for positioning the pulleys. That 4mm spacing between the belts is maintained throughout the mechanism.

One of the new motor mounts
One of the new motor mounts. I ultimately removed the bearing from the housing because the motors had a bit of runout in the shafts and the bearing made it noisy.


As in the original and all subsequent designs, the motor mounts have tangs that fit into the t-slot and are held in place with screws and t-nuts. The belts are tensioned by sliding the motors in the slots until the belts are tight, then tightening the screws to hold them in place.

I printed the motor mounts and all the other parts using ABS with 30% triangular infill. The motor mounts print with bed-surface-only support material supporting the underside of the t-slot tangs. I used modifiers in PrusaSlicer to make the two main mounting holes solid under the screw heads for maximum strength and resistance to being crushed by the screws.

Assembly is easy- put the drive pulley on the motor shaft with a drop of loctite on the set screws, loop the belt around the pulley, then screw the motor to the mount. Add the mounting screws and t-nuts and it's done. Once the rest of the mechanism is installed and belts have been routed, the motors are positioned to tension the belts and square the X and Y axes. Finally, the optical endstop mounts are glued to the motor mounts.

A motor
A-motor, cables, and optical endstop. The 6 yellow wires carry the step/direction/enable signals from the Duet2 expansion board. The heavier green and red twisted pair provides 24VDC to the motor/driver. The DIP switches under the power cable set the steps/rev of the motor, currently set to 1000, and a few other things that I haven't played with yet.



B motor
B-motor, cables, and optical endstop. The yellow part (upper left) with pulleys is one of the Y axis bearing blocks.


one of the Y axis pulley blocks
One of two Y-axis bearing blocks. This block is printed as a single piece. You can see the UHMW bearing in the t-slot, just behind the belts. The outer belt twists to ensure that only smooth belt surfaces touch pulleys (except the drive pulleys, of course).


Wiring


Using external motor drivers with the Duet2 controller board is most reliably accomplished by adding an expansion board that cost about $30. It has multiple ports with buffered differential step/direction/enable outputs to connect to external motor drivers.

I installed the Duet expansion board in the sand table, and made cables to connect the step, direction, and enable lines from the expansion board to the motors, and power cables for the motors. Wiring was straightforward- I simply connected all six leads from the expansion board port (step + and -, direction + and -, and enable + and -) to the matching inputs on the motors.


This is the wiring I used to connect the Duet 2 expansion board to the servos (upper half of the diagram- the lower half is for wiring alarms which I did not do). This was taken from page 42 of the motor manual.


I started out with one, 150W power supply powering the table because that's what I used for the steppers. I quickly discovered that servomotors motors will suck a lot of current from the power supply to try to keep up with the input signals. Trying to use too high acceleration, jerk, or speed during a few tests caused the power supply to self-protect which caused the Duet2 board to reset itself.

I replaced the 150W power supply that was originally in the sand table with one that was good for 200 W (the next biggest size I had handy), but too high jerk and acceleration settings still pulled the power supply down. I finally connected both 24V power supplies- the 150W supply powers one motor and the 200W supply powers the other motor, the controller board, and the LED lighting.

I added optical endstops of the same type I used in UMMD so I wouldn't have to hear the switches clicking when the machine homes itself.


sand table wiring diagram
The wiring diagram of the sand table as built.


Configure the Motors... or Don't


Servo motors use pretty complicated drivers that require configuration in order to optimize the motor/controller system's performance in any specific application. The drivers have some automatic configuration procedures built in that will apply different signals to the motor and make measurements and try to arrive at an optimal setting. The settings in the drivers are changed by connecting to the drivers via a serial port and running some manufacturer provided software. I haven't run any of that optimization yet- just used the default factory settings so far.

Ugreen USB to RS232 adapter cable
This Ugreen USB to RS-232 adapter cable is the sort of thing you need to let your computer talk to the motors.  It uses a PL2303 chip to provide the necessary RS-232 voltage swings.  These sell for about $10 on amazon.com

Configuring the Duet2 controller board


I had some problems when I first installed the servomotors- I was getting inconsistent motion- I'd tell it to move 100 mm and it would move somewhere between 80 and 120 mm or so. I had to tweak the timing of the drive signals coming from the Duet2 board a little to make it work reliably.




iHSV servomotor timing diagram
Timing diagram for iHSV motor driver. Use this information to set controller pulse timing parameters in M569 statement in the config.g file

Here are the necessary tweaks to the config.g file (this applies to reprap firmware only- if you use some other firmware, you may have to do something different)

M584 X5 Y6  ; remaps the X and Y motor drives to the Duet expansion board
M569 P5 S1 R1 T4.0:5.0:6.0:11.0 ; sets the timing parameters for the X motor servo drive signals
M569 P6 S1 R1 T4.0:5.0:6.0:11.0 ; sets the timing parameters for the Y motor servo drive signals
M92: X31.25 Y31.25 ; sets steps/mm for motors using 16 tooth drive pulley and 1000 steps/rev
M350 X1 Y1 ; sets Duet to output full steps (microstepping is handled by the servomotor drivers)
M201 X20000 Y20000 ; set maximum acceleration limits for each axis
M204 T10000 ; set travel move acceleration (applies to all moves in the sand table except homing)
M566 X200 Y200 ; set maximum jerk speed for each axis
M203 X1600 Y1600 ; set maximum speeds for each axis

I set the motors for 1000 steps/rev because the motors have 1000 line encoders and it seemed like a good idea. In a sand table that doesn't require high accuracy or precision, it probably doesn't really matter.

When testing for maximum speed, I used M203 X3000 Y3000 both beyond the motor rpm spec limit. After testing was done, I set M203 to X1600 Y1600 to ensure the machine couldn't exceed the 3k rpm spec limit of the motors. Speed of any given pattern is set in the pattern file with a G01 FXXX statement at the top of the file. For speed testing purposes, I used G01 F500 or F1000 to set the speed at 500 or 1000 mm/sec in the pattern files, then used the speed % slider on the Duet Web Control page to adjust the speed up to 300%=3000 mm/sec. Also for testing, I used the M204 command to set different accelerations while patterns were running on the table. In the sand table, all movement looks to the controller like travel moves- there are no "printing" moves because there's no extruder. If I were going to make a plotter that set a pen up or down, or started and stopped an airbrush, I'd probably set up the pen servo or paint valve as an extruder, so then I'd need to set a printing move speed in the M204 command.

If, for some reason, 1600 mm/sec isn't fast enough for what you want to do, you can always put larger pulleys on the motors. I chose 16 tooth pulleys because they have the smallest available radius which meant that they'd deliver maximum force to the mechanism to move it. I was concerned about the low torque spec of the motors. Now I know better. 20 tooth drive pulleys would allow a maximum speed of 2000 mm/sec, and 32 tooth drive pulley would allow 3200 mm/sec without exceeding the motor's maximum rpm spec.

Here is a test of the mechanism running a pattern with acceleration set to 10,000 mm/sec^2, speed set to 2000 mm/sec (which exceeds the 3k rpm spec limit of the motors), and jerk speed set to 30 mm/sec.



Once it was working reliably, I got an idea to try something different... The mechanism can go much faster than it will ever need to go to draw in sand, but there may be other uses for that high speed motion. I put an LED and coin cell battery into the magnet carriage, turned the whole table on its side, set up the camera, and did some "light painting":

LED and coin cell for light painting

The light painting "brush"- a modified blue LED and coin cell inserted into a piece of packing foam stuck into the magnet holder. The LED had a lens that narrowed the beam. I clipped it off so it would look bright to the camera at all positions on the sand table.


Light painted pattern took about 3 minutes to complete. I pointed the camera at the table and focused, then put the lens cap on, homed the table, opened the shutter, removed the lens cap and started the pattern. When the pattern was finished, I replaced the lens cap and closed the shutter. The stray light in the lower left is from the power supply, controller board and motor LEDs.


It looks like I need to do a better job of connecting the LED to the coin cell...






These patterns took 3-5 minutes each to complete with speed set to 2000mm/sec, acceleration set to 10k mm/sec^2, and jerk set to 200 mm/sec. This could make a nice display if one were to move a UV LED over the surface of a glow-in the dark sheet of plastic or paper. It could also be used with an airbrush to paint a pattern on a piece of paper, wall, or floor.



Back to drawing patterns in sand...


After playing with the new setup for a while it was time to put the sandbox back onto the table and try drawing some patterns. At the old settings- speed 500, acceleration 1k, and jerk 20, the table ran pretty quietly- quieter than it did with steppers, even at 256:1 ustepping. Part of the noise reduction came from the pulley replacement- much less clattering and no more squeaking. There wasn't any motor vibration noise. The remaining noise seems to be from two main sources - the magnet sliding on the bottom of the table and the X axis clanking when the magnet carriage reverses direction.

I have fixes for both of those noise sources in mind- I'm going to be rebuilding the table with a thinner bottom (currently 1/2" thick plywood) which should allow me to put an air space between the magnet and the bottom of the table. The X axis problem will be solved by spring loading one or both of the Y axis bearings to keep both ends of the X axis firmly in contact with the Y axis frame rails.

I ran some of my previously generated patterns on the table - I was lucky- the newly designed pulley blocks and motor mounts left me with the same drawable dimensions as the old parts so I didn't have to regenerate the patterns. I started playing with the jerk and acceleration settings. The Duet2 controller is nice because it allows me to tweak all those settings on-the-fly while testing. I was quite surprised to find that the table could run patterns with acceleration set to 10k, which sped things up considerably, but also reduced quality of the final pattern because at high acceleration, the ball throws sand at the start of each segment, partially burying previously laid down lines.10k acceleration is definitely not for detailed patterns, but might be good for erase patterns, or patterns with a lot of spacing between lines.

Compare these two photos to see what happens as you increase acceleration and drawing speed.


This pattern was drawn at 500 mm/sec with 1k acceleration. Most of the short segments probably never got much over 100 mm/sec at that low acceleration. Lots of detail is visible.

The same pattern drawn at 1500 mm/sec with 10k acceleration. In this case most segments probably were drawn at >1k mm/sec. Note loss of detail due to sand being thrown around at high acceleration.

I was surprised that 10k acceleration didn't just leave the ball behind on the table. I tried cranking the speed up, too, to see how high I could make it run. Here's a pattern running at high and increasing speeds and accelerations:




I ran more tests at different speeds and accelerations. I found that at very high speeds, the ball throws the sand so much that the bottom of the table actually gets exposed in the lines that the ball leaves behind. Also, the ball tends to wobble a lot right after a direction change, similar to ringing in a 3D printer so lines that are supposed to be straight are wiggly with sand piled along the areas where the ball wobbled. Also, at very high speeds, the track left in the sand by the ball gets even wider than the diameter of the ball. Definitely not good for fine detail in patterns.




Drawn using stepper motors at 1 or 2k acceleration and 500 mm/sec speed.


Wide lines, loss of detail due to excessive acceleration and speed (10k and 1500 mm/sec).


After running a pattern on the table at "normal" speed and acceleration to make sure everything was working reliably, I started experimenting with speed and acceleration settings of an erase pattern. At 15k acceleration, when I set the speed to 2000 mm/sec I start seeing messages from the controller about "overvoltage condition". At 2000 mm/sec, the motors are spinning at 3750 rpm, well above the spec limit of 3000 rpm. I suspect the motor(s) are generating back EMF that exceeds the supply voltage. I made one attempt to run the ball at 3000 mm/sec and the ball flew away from the magnet at the end of a line and then the controller reset, probably due to the overvoltage.

Here's an erase pattern running at 2000 mm/sec:




Now when I generate patterns using Sandify, I use the start custom gcode block to home the machine and set appropriate speed and accelerations for the pattern. I also put an M84 (disable motors) command in the custom end gcode section. Disabling the motors stops the whiny squeaky sounds that come from the motor drivers while the motors are stopped. I may be able to eliminate that noise by tweaking the motor driver parameters.

Conclusion


The stepper motors were always running right at the limits of their performance and I had to run many patterns to figure out "safe" settings for the acceleration, jerk, and speed. Installing the servomotors eliminates any concerns about the motors being able to keep up with any settings for speed, jerk, and acceleration I might care to use when drawing patterns in the sand, or any physical changes I make to the mechanism. That makes the whole mechanism more reliable and opens up many new possibilities with regard to using the mechanism to do things besides drawing patterns in sand.

That said, if you build a small table, and/or you're content to run patterns at lower speeds, there's no reason to go to the trouble and expense of using servomotors.

I'll probably run the table at acceleration of 3-5k and set the speed to 400-500 mm/sec most of the time. It will slow things down a bit but still deliver detailed patterns. If I am going to demo the table at a Maker Faire (will there be any more of those?) I can run a few super fast patterns for the amusement of show goers.

I am planning one more redesign to use a glass top mounted higher above the sand to minimize thrown sand from sticking to it, quieter operation by finally fixing the X axis problem, and a slightly smaller size that will make it easier to transport and to use as a piece of furniture.

At some point in the not too distant future, I will probably try the servomotors out in UMMD, my corexy 3D printer. More posts to follow...

Update:

 I added a sprung bearing to one of the Y axis bearing blocks and eliminated the clunking noise it was making when the X motion reversed direction:







Friday, May 29, 2020

Aeropress Coffee Maker CAD Model

The Best Coffee Maker


I love my Aeropress coffee maker, and the coffee I make with it. I love it so much that over the last 7 or 8 years I've replaced it two or three times when the rubber seal gave out. Well, it's done it again. I decided to spend some time researching my replacement options. I figured that some company in China has to make a copy of the Aeropress that costs about $5. But after an extensive search, no such luck. Then I checked amazon.com by searching "aeropress rubber" and bingo!  There were 5 or 6 listings for new rubber seals for the Aeropress for $5-7 which is a lot more attractive option than shelling out $30 for a whole new Aeropress.

Then I thought about making my own seal. I checked thingiverse.com and youmagine.com for models and found none. So I decided to make my own model and then try printing a new seal with TPU. Now I know what you're thinking. Is it going to be safe to drink coffee that's contacted the TPU that's been 3D printed? You know, I don't know for sure, but then again, I have no idea about the safety of the original or the replacement rubber seals either. I know this- when I took the old rubber seal off the plunger I found about 2 years worth of coffee residue under it. I doubt my little TPU plunger seal is going to be any more unhealthy than that.

I proceeded to measure and model everything that normally comes with an Aeropress. That will make it easy to design storage racks, etc.  

CAD rendering of the models
The yellow seal is the printable version, the black one is the original.


The CAD model can be downloaded here: https://a360.co/2TP0ZWn
Note: the model isn't perfect- the little tabs on the filter cap are actually ramps so that as the cap is screwed down, it fits tightly and seals. In my model, those tabs are flat. There may be a similar taper in the receptacles in the barrel where the cap tabs contact, but I can't measure it if it's there.

It took 3 iterations of the plunger seal to make one that works reliably. The yellow one in the CAD file is the final version of the printable part. I used TPU filament, 4 perimeters, 0.2 mm layers, 6 top and bottom layers, and 10% triangular infill.  Be sure to set the seam as "random".  No support material is needed.  The nice thing about the orange TPU I printed it with is that it's semi transparent so I can see if there's a bunch of coffee residue under it.


The printed TPU seal in place



I'm going to go make a cup of coffee...

Update- the very next day


Well, my printed seal isn't so great. It isn't very compliant and the inner diameter of the barrel isn't constant and maybe not even perfectly circular, so sometimes the plunger is easy to push, sometimes it's hard to push, and sometimes the seal leaks a little.  I think I'll buy one of the rubber replacement seals...

Update a couple days later


I bought this replacement seal and it works great! It's made of a nice, compliant rubber and seals well in the barrel. We'll see if it lasts...

Update November 29th, 2020


The rubber seal is still looking and working like new. Definitely worth the $6 invested.

The tube hasn't developed and fissures in the walls like the old ones did (I wish I had taken some pictures- they looked like lightning with lots of random twists and turns). I think I read something a couple years ago about the manufacturer changing the plastic they use to prevent that. 

Thursday, May 7, 2020

More This is What You Can Do With a (Tall) 3D Printer

Another Lamp!


Ever since I made the first lamp that my son took to his dorm room in college, my wife has been after me to make one for her. COVID-19 isolation has granted me some time to get caught up on projects like this...


First, The Shade


I created the pattern using ChaosPro and saved a sequence of images. The shape is a power 3 Julia set fractal with one of the parameters swept from a negative to a positive value. I imported the image sequence from ChaosPro into ImageJ and saved it as an STL file, then loaded the STL file into PrusaSlicer and scaled and sliced it to fit on UMMD.  It was printed in 0.25 mm layers using transparent PETG, with 6 solid bottom layers, 3 perimeters, and no infill or top layers. If I recall correctly, it took about 24 hours to print. It is 503 mm tall and weighs 430 grams.


One of the images from ChaosPro that was used to make the lamp shade.



The shade is 503 mm tall, transparent PETG.

The top of the shade.


The surface of the shade has a very interesting texture that results from the limited resolution of the math that generates the fractal shape. There were a LOT of very fine cob-web like hairs because I used PETG to print. I pulled/clipped off the larger ones and "disappeared" the finer ones with hot air from a heat gun. There's still a little cleanup left to do.

After printing I cut a hole in the bottom of the shade to match the diameter of the LEDs on the circuit board from the light bulb. 


The hole in the bottom of the shade matches the diameter of the LED board from the light bulb.


A test using this shade with a long warm white LED bulb.  It has a nice look to it, but will need some work on the base.  I may make some of these.


The Light Source


I used a wi-fi controlled Feit Electric multicolor bulb that was rated for 1600 lumens. I took apart the bulb and found the usual two-circuit-board construction- one for the control electronics and the other for the LEDs. The base of the bulb is made of aluminum and acts as a heatsink for the LEDs.


This is the bulb I used.  On sale for $17 when I bought it.




LED board from the lightbulb. This board plugs into the controller board using the two 4 pin sockets on either side of the slot. The slot is for the wifi antenna that stands off the controller board. The blob of putty was covering the controller board- I suspect it was intended to be thermal insulation to protect the controller from the heat of the aluminum heatsink in the base of the bulb. The six big LEDs around the slot provide all the colors, the rest are for white light.



Inside of the bulb, putty and LED board removed - the controller board fits in the plastic covered aluminum base.  The white thing in the center is the wifi module. This board connects to the LED board via the two sets of four pins above and below the wifi module.


I wanted the light source to reside at the very bottom of the shade, pointing straight up, so the entire shade would be lit, and so that the light shining through the open top of the shade would make a nicely shaped pattern on the ceiling. That meant I had to separate the circuit boards from the light bulb and figure out how to mount them in some sort of base for the lamp. I also had to figure out how to fit some form of heat sink into the base so the LEDs wouldn't burn up.


The Base


The base was designed to hold the two circuit boards and heatsink.  It is designed in two pieces- a top plate to which the LED circuit board and heatsink mount and the bottom that holds the control board and power switch so the lamp can be turned on and off even if wifi isn't working properly. The bottom of the base is open to allow some air flow, though there probably won't be much. Time will tell if the heatsink I made is adequate.


Prototype of the base to check fit.  I printed this while I waited for delivery of the white PETG that I intended to use for the final design.

Top plate prototype.

The top plate has a hole that's just big enough for the LEDs to fit. The LED circuit board is trapped between the printed top plate and the aluminum plate heat sink. I put a couple dollops of heat transfer compound on the LED board before final assembly. 


The final base with LED board in place.  Notice the brown spots where the printer deposited charred blobs of PETG. Fortunately, they are covered by the shade.

Underside of the base.

Wiring between the controller and LED boards.  The aluminum plate is the heatsink for the LED board.

Clean looking back of the lamp.  I think the power switch came from a coffee maker.

Here it is.  The shade is attached to the base with some clear silicone.


The LED board has two four pin sockets to connect to pins on the controller board. I soldered wires to the controller board pins, covered them with heat shrink tubing, and then inserted the stripped wires into the appropriate connector holes on the LED board. Then I squirted a drop of hot-melt glue on the back of each connector to keep the wires from pulling out.


The Result


I am very happy with the way this turned out, but I'm already thinking of some improvements I can make in future projects like this one. First, PETG is good material to use for the shade, but white PETG is not so great for the base.  PETG has an annoying tendency to build up on the nozzle and then leave charred globs on the print at the worst possible locations, usually on the front of the print where it will be seen. Maybe I need to work on that nozzle wiping project a bit more... I think dark colors should be OK. I want to add some weight to the base to improve stability, too.







I'll probably print with the appropriate sized hole in the bottom of the shade for the next one, instead of cutting the hole after-the-fact.





The image projected on the ceiling by many LEDs shining up through the opening at the top of the lamp shade.



The lamp makes a very nice pattern on the ceiling as expected, and lighting from the very bottom really does light up the entire shade.  When set for white light at full brightness, it's almost too bright.  Fortunately, you can dim it via the wifi app for iPhone and Android.