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:







12 comments:

  1. Fascinating information. Thank you for taking the time to do the experiments and writing up your findings. I hope to start construction on a tabletop prototype in the near future. I shall be relying upon your blog posts heavily. :)

    ReplyDelete
    Replies
    1. Great! You can skip all my mistakes and go right to the stuff that works.
      Keep me posted on your progress.

      Delete
  2. That was a nice write-up on the design specs. I enjoyed your progress. The "wrrr" sound reminded me of the noise of a HP Plotter we had at work. The head would zoom across.

    What type of sand did you use? It seem to maintain the pattern and not blow over the other curved area too much. I think the weight of the magnet ball and the strength kept it well in the pattern. The erase pattern seem to sway some in the straight path. I also read others talking about the outer edge would gather sand and would have to push it back in from the side area. I dreamed of a wiper blade to run across to flatten the total area. I think starting with a constant depth would be best for the next pattern to form precisely.

    I look forward to the next images and changes.

    ReplyDelete
    Replies
    1. The sand is sodium bicarbonate (baking soda) sand-blasting media. It's pure white so works well with the colored lights. It doesn't attract insects, doesn't get sticky. I get some minor lumping if the table sits unused for a couple months, but running a few patterns breaks them up.

      The photos of the patterns are very small for some reason. I think they made some recent changes to blogger that have screwed up a few things.

      I've been thinking about a cylindrical eraser that's made from window screen and rolls across the table. It will flatten things out and break up any lumps every time it runs (not that lumps are a problem), but the ball tends to push the sand toward the edges of the table, so over time it gets thinner and thinner and I have to manually push the sand back toward the center of the table and redistribute it. I don't know how I'd automate that.

      Delete
    2. If you added a vibration motor the sand should act like a liquid and self level. I like your projects!

      Delete
    3. It's a great idea, but unfortunately, it would probably be noisy and wouldn't fix the problem of the sand getting pushed to the edges of the table.

      Delete
  3. Do I understand right that you don't need any stepper drivers on board itself?

    ReplyDelete
    Replies
    1. That's right, no stepper drivers are needed if you use the iHSV servomotors. The motors have drivers built in. You give them step/direction/enable signals just like you do with the input side of stepper drivers.

      Delete
    2. So, in theory, I should be able to use them with any board with something like that?

      https://a.aliexpress.com/_eOR1cp

      Delete
    3. If you can get step/direction/enable signals out of it, and you can tweak the pulse durations to match the motor requirements, it should work.

      Delete
  4. This is absolutely amazing !! Love the dune reference for the table as well. I had a good laugh about that. It would be pretty cool to see some sort of worm sign reinacment go down on this table by the way hahaha !!

    I had a thought about the cylinder eraser idea. Perhaps a corner could have a parking position for the magnet ball(tool 0/X), or some area where a notch in the frame could be for the ball to "exit" the drawing area and sit temporarily.

    Then you could have a second set of motors for another gantry that's always stationary on one side. This would be(tool 1/W axis. Use duets axis remapping function for a second XY, like a coreXYUV works. and for erasing, use UV as the XY , with tool 1/W axis to drive the cylinder eraser back and forth a few times with the ball in parking position.

    Once erasing complete, the cylinder would go back to the one edge. And then you would select tool 0, with duets axis remapping in the tool0 config. So it would go back to using the first gantry for XY and the magnet ball as tool0!

    I just learned about the duet axis mapping and driver mapping functionality while I was researching rrf3 and the duet3. I came across it as I've been looking for ways of how to make idex machines and multi gantry machines. Perhaps it would be a good method to use for your project!

    remap axis X & Y from the UV back to XY drivers. Duet uses numbers to assign to drivers. So XY would be 1&2, and UV would be 3&4. With tools on 5&6. XY would be mapped to drives 1&2. UV would be mapped to 3&4.

    You could actually go simpler I guess.and have a parking spot notch for the ball as tool0, and then just have a cylinder mounted on its own carriages, or a squigy even. Have the magnet x carriage select it and drag it back and forth to erase. Park it back on the side, deselect, and go back to the magnet ball to draw some more!!

    Just throwing out ideas. I am really amazed by this project . I have never thought about making a sand table like this before and it's really exciting !! Thank you very much for posting this project. I learned a great deal about servo motors and using them with duet here as well! And those patterns thooo....

    PS. I showed my father the light drawing and he nearly had a fit he was so excited to see it hahaha!! Amazing work mate!!

    ReplyDelete
    Replies
    1. Thanks for all the kind words and ideas for the eraser. I am currently in the redesign stage for the table and will likely rebuild without an automatic eraser as the final table will end up in my living room as a coffee table and won't be run very often or for very long. I'll just make it easy to get at the sand so I can manually redistribute it, and clean the underside of the glass top.

      Delete

Leave comments or a questions here and I'll try to post a response as soon as I can.