CNC Terms

Both optical and magnetic (similar to magnetic tape) encoders produce a quadrature wave form and and index pulse that lets the receiving electronics keep track of the position of a rotating shaft or linear position (linear position most often has an index pulse every so often and may have a home position output as well. An improved version uses gray-coded encoding (see below).

A Rotary encoder's quadrature waveform output


A schematic of a Rotary encoder's quadrature encoding disc


A Rotary encoder's quadrature encoding disc

Gray coded encoders 
Gray codes instead of having a two bit output as in a quadrature encoder, have instead a binary word encoded with 3, 8, 16 or even more bits printed on the optical plate. Instead of using normal binary counting, the code increments with a system so that only one bit changes at a time when moving over each position. With normal binary counting several bits can change at once (i.e. 01111 + 1 = 10000), but in the real world there one bit will always lag the others creating transient erroneous codes. Gray coded encoders still repeat (there is often an index bit at the full cycle) but the possibility of over running a count, as sometimes happens on quadrature encoders is eliminated. Gray coded encoders are not often used due to their higher costs.

A gray code encoding disc


8 bit gray encoder

A system that uses a transformer with three windings - A reference winding that rotates (rotor) and sine and cosine stator windings that are 90° from each other on the circumference of the housing. A sine-wave is fed in to the rotating reference winding and the amplitude and polarity of the outputs reveals the quadrant and position with in the quadrant. The sub quadrant position is based on the ratio of the sine vs cosine voltages. SIN θ / COS θ = TAN θ, where θ = shaft angle
Similar to the resolver (see above) but with three stators 120° apart.

Hi-speed motion for laser cutting and engraving

There are a number of inexpensive Chinese CO2 cutting machines that have a proprietary interface. I am interested in converting one to EMC and gathering some information. One source told me that it probably had to move too fast for engraving etc and that EMC with a PC's latency would not be able to keep up.

It turns out that there are cards that can output a chain of pulses at a particular frequency - called Universal Stepper Controllers or "rate generators" Which produce constant-width pulses of varying frequency.

There is also somewhat different type of card called a Universal PWM Controller Instead of generating constant-width pulses of varying frequency, it makes varying-width pulses of constant frequency, to directly drive a PWM power output stage. With this system there are no steps anywhere in the system. EMC2 sends out a PWM output command, and reads encoder position from the board's counters. With this, I can drive both DC brush motors and brushless motors, using the appropriate drive units.

There are also at least three EMC compatible cards that will provide analog velocity mode control - g


There is no problem as far as pulse train and maximum velocity is concerned. The motors as I recall have a max velocity of 2500 RPM at 200 full steps per revolution, and set to 32 micro steps per step, which works out to a maximum step rate of just under 270,000 pulses per second. The 7i43 or 5i20 is clocked at either 33 or 100Mhz, which is over two orders of magnitude above the max step rate.

The update rate of the 7i43 parallel port is limited to about 400 microseconds however, which affects the rate at which the position (velocity actually) can be changed. With the 5i20, 200 microseconds is easily achievable. I should also add that I have created a special smp kernel for the Atom 330 processors I am using, which pins the real time tasks to one core and everything else to the other. With this kernel, I am able to set the servo period to 200 microseconds or faster, excepting the limitation on the 7i43 mentioned above.

A further limitation is in the EMC kinematics which has a maximum rate at which position data can change. This is not a problem for me, because with the materials I am using and the power of the lasers, to get any depth when doing 3D engraving it is not practical to run faster than 200 fpm or 40 ips, and often less than that.
In effect the EMC kinematics will slow the head in complex areas where Z changes very frequently and speeds up to the set feed rate in areas where it does not, so I have added a component which adjusts the laser power in proportion to the instantaneous velocity defined by X and Y.

Top Page wiki Index


This information may have errors; It is not permissible to be read by anyone who has ever met a lawyer.
Use is confined to Engineers with more than 370 course hours of electronic engineering for theoretical studies.
ph +1(785) 841-3089


(C) Copyright 1994-2017, Transtronics, Inc. All rights reserved
Transtronics® is a registered trademark of Transtronics, Inc.
All trademarks are the property of their respective owners.