20 July 2010

X Y table skew compensation in EMC

Of course, the junkplotter features a slight X - Y table skew (what else would you expect with sloppy quick visual alignment and a hot glue gun...).

EMC2 has a great user-contributed component that deals with skew compensation. It can be found here: http://wiki.linuxcnc.org/emcinfo.pl?ContributedComponents. Download millkins.c, compile and install it as per the instructions in the page. Do not yet edit your .hal file ! 


You need to get your axis scaling values right first. Stepconf roughs up the job for you, especially if you know the specs of the components you work with. This is not always the case with junk recycled stuff...
So draw a "square", typically 100 units (mm) and its diagonals. Most probably it should be looking like the drawing (1). Check the side lengths. Do interpolation to refine your scaling values. relaunch axis, draw a square again, check side lengths, rinse, repeat until you are satisfied with the result. You should end up with some four-sided parallelepiped with equal sides: a rhombus (drawing 2).
Check the diagonal lengths now: if they have equal lengths, you are in luck, your rhombus happens to be a square: no problem, you can stop reading here.

If the diagonals are unequal, you have to calculate the compensation value. You may apply Pythagoras theorem since in a rhombus the diagonals intersect at a right angle, to determine the angles of the corners. At this point I found some use to the the Rhombus geometry calculator: just enter the diagonal lengths and you get the angle a and the side length. If the calculated side length is very similar to the side length you  measured, the calculated angle a must be right. The value of the parameter you need to enter in the .hal file is 1/tan(a), as briefly stated in http://alastair.d-silva.org/desktop-cnc-milling-machine.

Restart axis, draw another square with diagonals, check lengths. You should have now something like the drawing (3). That's all, folks!

And now for the ritual plotter dance...

IT IS ALIVE!   ;-)




  • x axis: epson scanner carriage and bipolar stepper, driven by A4983
  • y axis: star micronics matrix printer carriage, bipolar stepper, driven by A4983
  • z axis: sony cd-rom mechanism, cable and stepper motor, driven by L293D and an Arduino duemilanove.
  • Home made breakouts,
  • Computer: salvaged P4 Compaq with 1 gig RAM that was being thrown out to the garbage

Software: (No stinkin' windoze!) Ubuntu 8.04 RTAI from http://linuxcnc.org/
EMC2/axis runs as silk.

Issues and lessons learned:
The y/z carriage is a bit too heavy (iron construction angle), too much for its plastic sliders.
The y stepper is too weak, lacks resolution and does not take up microstepping.
Epson definitely made better quality stuff in those bygone times.

Built to learn about CNC and to explain geometry to da kid.

To do: connect the limit opto-switches (will probably need inverted logic or pulldowns for the parallel port).

17 July 2010

Anatomy of a presumed parallel cable

The cable pictured blow (the bottom one) was being sold in eBay (UK) as "Parallel Printer 25M/25M Cable 3M - Switchbox DB25" by a professional dealer. I got one of these to drive some project, no joy, nothing worked at all. I even fried a NetMos paralell port pci card in the attempts.



Signals didn't happen where expected, spurious voltages and interference were all over the place, and the said cable looked suspiciously thin (5 mm diameter, bottom) when compared to some real, well worn and proven parallel port cable (7.5 mm, top). Time to rip up its plastic belly. O surprise, o wonders, what do we have here?

Inside only 11 teeny wires are to be found. These connect pins 2, 3, 4, 5, 6, 10, 11, 12, 13, 15 and 25. Nothing to do with IEEE 1284, and no way this would ever work.

BTW one may wonder which drugs the guys who "set the standard" for this mess were high on.

As for the incriminated cable, I am asking the seller for a refund.
I got from the usual sources a nice stock of used, well worn and well tested paralell cables. They are centronics ended though, so they will require some handling...

UPDATE: The seller was very quick and responsive, and issued a full refund. He started testing his (unlabeled) cable stock...

In the mean time, I retraced that particular cable pinout to a "Laplink cable". Seems everybody has forgot about those, hadn't seen one in more than 15 years!

01 July 2010

Where Koroviev gets his eggs painted

Seems a necessary milestone for anyone starting with robotics. Whatever...

Open source hardware (arduino), Adafruit's motor shield, and a lot of help from the many places dealing with stepper motors and servos, among them Tom Igoe's.



Disclaimer: more than one discarded printer and/or DVD rewriter was maimed and eviscerated during construction.

The pen up/down motion is controlled by a small (4g) servo. The latitude stepper is 1.8 degree per step (200 steps/turn), the longitude one is a geared down 7.5 degrees per step (48 steps/turn), both driven with half-stepping.

Lessons learned: use shielded and grounded twisted pair for cabling!
PWM for the servo and microstepping does produce interferences.
The spring drawing the pen to the egg is a bit too strong, so we lose some precision


More on this later. I started adapting someething inspired by one of the 5-D gcode interpreter from reprap, then I switched to building an x-y plotter...