Monday 22 April 2013

Calibrating, and a new stepper motor library

Using the info from TriffidHunter and RichRap, I calibrated as follows:

X and Y stages: 1.5mm pitch (M10 threaded rod). 1.8º/step => 200 steps = 1 rotation. Total 200 / 1.5 = 136 steps per millimeter. Measured by running 13600 steps: 1 cm. Why am I off by an order of magnitude?

With a 10ms delay between each step, I get ~13mm. The Arduino stepper motor library appears to ignore all but the sign of the "number of steps" parameter.

It appears that what the library calls a "step" is just 1 of the 4 steps involved in a "real" step, as can be told by the two diodes turning on and off. But that doesn't explain why my 200-steps loop only does ~50 steps.

Odd. When I do 1 step at a time with a 1 second delay, it only changes LEDs every 4 seconds. With 4 steps per 1s delay, they change every second.

There is something I don't get about driving a stepper motor with this library, so I do the programmer thing: Use an abstraction interface. The AccelStepper library is not only much more advanced, it is also (gasp!) documented. Here is a minimal test program:



#include

AccelStepper stepper(AccelStepper::DRIVER, 4, 5);

void setup()
{  
   stepper.setMaxSpeed(1000);
   stepper.setSpeed(1000);
}

void loop()
{  
   stepper.runSpeed();
}

This just runs the motor at full speed (the library is currently limited to a max speed of 1000 since anything higher would use microseconds, and the author is concerned that those overflow after a matter of days). I will start with this because I don't need speed for calibration. The library also supports going to specific positions, which is nice. It gives a much better run, fast and even with little effort. I'm not sure that the acceleration part is really necessary here, but the basic example works smoothly, so I'll go with this, reading more documentation at home.

Quick test: Since the stepper motor driver is set to half-step, and the motor has 1.8º steps, 400 steps should be one rotation. And it is! Then 4000 steps should be 15mm... it is! Quite precisely. Y stage does the same. Z stage - I had some problems lifting the entire extruder + holder - but it, too, is precise. Beautiful.

Getting late now, so I'll calibrate the extruder motor and heater later. It seems the temperature "calibration" is just finding out what measurements melts the plastic, accurate measurements are apparently tricky, and there are variations in the thermistor.

Next time: extrusion calibration and tightening the Z stage holder: Just found that I can store the entire thing in its little corner without necessarily tilting the Z stage.

Sunday 21 April 2013

Make Munich report


Make Munich 2013!

The first maker faire in Southern Germany (or possibly in all of Germany) was Make Munich this weekend. I went Saturday, because I also wanted to start the sword fighting season this weekend. There was a lovely mix of 3-D printers, electronics kits, vintage computers, upcycling jewelry, guerilla gardening, textile hacks, and more. A very dangerous place to go, but I managed to not buy stuff for more than €80 - a POV spoke kit for my bike, some cute pieces for Mickey, and a tiny stepper motor driver. I was quite tempted by the LED strips, though, as you will see below.

The big star of the show was the 3-D printer, of course. It was everywhere, in all manner of styles. Fabbster was there with about 10 of their modular systems, which look very simple and useful. FabLab had a one-cubic-meter one that even I hadn't seen before, unfortunately new enough that it didn't work yet. The group shown on the left had a more-printed-than-usual RepRap, the little yellow one in the front.

There were also a number of companies who would print your things for you, shouldn't you not want to handle the care and feeding of new, mostly-experimental systems. What surprised me most was the number of different materials you can get prints in. On the right, i-Materialize's "Periodic Table of Materials", including steel, titanium and gold! These are essentially made by having a powder of the material, heating it to just below its melting point (so don't try this at home, kids!), then shining a fairly weak (couple of watts) laser at it to fuse a bit together. The amount of detail on these was quite amazing, one figure had a magnifying glass in front of it. On the lower right you can see a resin print in clear resin, very lovely surface, and the things in front are MineCraft-style models:)

Of course the main local maker space, FabLab München, was represented with a goodly chunk of the upstairs section. They showed off a lot of the things they'd done over time, but didn't bring that many 3-D printers (which was fine, since there were so many already). They brought Bazinga!, the 30W laser cutter they were lucky enough to get donated, and were able to let people use it. They also had a number of kid-oriented activities, which was quite cool.

Several small companies (or not-quite-yet-companies) were showing their products, from modular rail systems over kits to useful programs and services. One company was showing off their 3-D finishing product, which essentially ensured that a model was a proper volume by turning surface-defined models into volume-defined ones. A pretty specialized system, but from personal experience, I can say it's useful. Another company, Fritzing, provided low-cost PCB production, and demoed their program for PCB design. I quite like it, essentially you can work on the same model in a virtual bread-board, a logical diagram, and a PCB layout, and the other ones get updated appropriately. While still in beta, it looked quite useful, and their prints were just beautiful, lacquered white with black print.

There were many more things, like the local ham radio group, retro-computing groups, a Pac-Man board game, and what-not. The audience was extremely varied, with lots of families with little kids (some less-than-10-year-olds and their dads were soldering together). I managed to get interviewed twice, once by Welt am Sontag, once by a camera crew from I-know-not-where (if anyone sees it, let me know; I did it in my best German, which is not that good).

More pictures and descriptions on the photo album. Sorry about the image quality, I wanted to have my hands free to play with things, so I didn't bring my SLR.

Monday 15 April 2013

Calibration

Everything is wired up, I have a new powersupply, and I even remembered to give power to the heater (had forgotten that when building the shield). So now - calibrate!

First thing is the temperature sensor, arguably the most important part to calibrate. I just get a value from 0 to 1024, the meaning of which is mainly determined by the 1K resistor I put across the thermistor.

At first, the PWM is giving trouble, not heating. But measuring the stepper motor driver heatsinks is interesting: X is pretty cool (34º), Y is really hot (95º), Z is pretty hot (70º), and EX is medium (90º)

Turns out I had misread the wiring markings on the heater. Now it heats, but slowly when I pause the heating to do measurements. I should rather go for a number of specific readings and hold each of those for a while with a little hysteresis.

But first, I need to get the thermistor properly connected. The little wires next to the extruder are hard to get on a connector, so I soldered some larger wire on, and now at least it seems solid.

Looked a bit more at the little thermistor print board, and realized I only had the GND and 5V connections, where I should have GND, 5V and a measurement. Fixed that (with a fixed-mount measurement wire), and now I get reasonable temperature numbers.

Raised the Z stage to see if I could get better temperature measurements.

According to the hand-held thermometer, I have the following measurements:

55º at 680
64º at 800
75º at 890
90º at 900


At 900, the remaining plastic started flowing out - I don't think that happens at 90º.

When cooling down:

68º at 825
69º at 760

Monday 8 April 2013

Putting it all together

Didn't get to run The Monster last night, but fixed a few more things with the Arduino "shield", added connectors for the optional wires, mounted the extruder holder, moved the extruder stepper motor driver to where it wouldn't hit the ball bearings, added connectors to the wires to the shield, replaced the Cat5 wire to the extruder stepper motor driver with a flat cable wired up similar to the others, but some more organised connectors on the temperature sensor mini-board, and put everything in place, arranging the wires so they shouldn't get in the way of anything. This weekend I will try to get it running, so I can have it ready to show off (read "use as a warning tale") at #MakeMunich.

Sunday 7 April 2013

Arduino "shield"

After getting the extruder stepper motor driver and temperature sensor set up, I found myself with a bird's nest of wires. Four 10-wire strips that split off, crossing and re-crossing, plus several more for the sensor, plus power and other bits and pieces. The wires plugged into to the Arduino were apt to fall out, even with a proper connector on them, and I didn't know if there were shorts in random places (at least nothing smokes). So I decided to make a little "shield" for the Arduino, putting proper plugs onto the 10-wire strips (except I managed to again order the wrong size from Eibtron, their pages are really confusing). This is how it turned out (people who care about the æstethics of electronics might want to avert their eyes):

4-stepper-motor-driver shield mounted on Arduino.

Rear side of shield, with the fixed connections done in wire. From left to right to top-right: Z, Y, X stages and Extruder. Ground goes around the left and along the bottom.
Two ends were deliberately left loose, so I can later plug them in where I want them, if it turns out I need to have min/max for the X/Y stages or be able to enable/disable more of the motors. I have hardwired (literally) enable/disable and min opto endstop for the Z stage, since it will be idle most of the time and need be able to position itself right over the plate.

The pins for the Arduino are now:
  1. RX - used to program the Arduino.
  2. TX - used to program the Arduino.
  3. ExStep - Extruder Direction
  4. ExDir - Extruder Step
  5. XStep - X stage Step
  6. XDir - X stage Direction
  7. YStep - Y stage Step
  8. YDir - Y stage Direction
  9. ZStep - Z stage Step
  10. ZDir - Z stage Direction
  11. ZOff - Z stage Enable (off on high)
  12. Heat - Heater on
  13. ZMin - Z stage minimum opto endstop
  14. GND
Finally got the right crimp header for the four control wires for the extruder stepper motor driver, and soldered them on. Happy to see that the crimp pins were properly Murphyized[1]. My notes on this blog came in handy here, as I didn't have to re-test what the ordering of the wires should be.

Also trimmed a bit of the extruder-holding plate (which is a pain, as that requires unmounting the extruder, which is fiddly to remount) so as to avoid yet another collision with the edge of the Z stage. *sigh*

Decided to desolder the connector to the v. 1.1 stepper motor driver I got from +Tim Hatch - I would rather have all four driver connectors be of the same kind.

It's fun to sit here and hack on my little project while three Ultimakers are running full tilt in the background. I realize my Monster will never be as speedy or probably even as stable, but it's mine.

For next time (tomorrow?): Bring new power supply of my own, buy crimp-on headers locally if possible, and bring/buy some 10-wire strip. Then I can redo the old driver and mount it all together!