Hebei Huali Machinery Company produces hand handwheel, knob, bakelite hand wheel, hinge, chain, handgrip, button and other Machine Tool Accessory,Tel 0318-2222299
Sign in  |  Register
河北华利机械配件有限公司

CNC System handwheel signal processing method

2015-10-09 13:33:00
Foreword
        CNC systems, tool fretting workpiece knife, table follower, machine zero point correction, etc. These functions are usually achieved through handwheel operation of this function to the machine operator to bring a lot of convenience, so handwheel NC machine is widely used. But when the handwheel slightly wavering, prone to shake, causing the output pulse allowed, leading to the machine malfunction, ranging from causing workpiece scrapped, while endangering the personal safety of the operator, so the machining process, precision and reliability is particularly important. Author in the actual application of numerical control system, summarized test a method of structured handwheel signal processing.
        1 hand wheel works
        Hand wheel, also known as the manual pulse generator, which is essentially an incremental encoder is a photoelectric position control element. In the hand wheel rotation, the grating disk with the rotation axis at the same speed of rotation, after detecting device composed by the light emitting element, which is the size of the angle turned into a pulse sequence containing the location and direction information, under program control can drive NC each machine axis. Each rotation of the handwheel to obtain a scale having a plurality of phase by 90 ° A, B signals, as shown in FIG. When the Forward, A phase leads B phase 90 °, when inverted, B phase leads A phase 90 °.
        2 handwheel Signal Processing
        Handwheel output signal processing circuit of discrete components, are many ways of ASIC, microcontroller, programmable logic devices. But for the purposes of multi-axis CNC system, the use of discrete components to perform a series of encoder signals including hand signals, including wheel, you will need more components, resulting in complex structure, increasing power consumption, decreased stability and other shortcomings. Now often used complex programmable logic device CPLD to implement the handwheel signal discriminator phase filtering function. It consists of a phase debounce circuit, delay circuit, 16 reversible counter constituting the output buffer and a data bus. The following be described for the function of each part of the circuit.
        2.1 phase phase circuit circuit principle role is to get the direction of rotation of the handwheel, produce the counter direction signal. Works seen by a hand wheel, in each signal cycle, A and B signals pulse signal pulse phase difference 90 °, the output signal shown in FIG. Handwheel direction information is defined as: If A leads B signal pulse signal pulse 90 °, handwheel positive direction; if A lags B signal pulse signal pulse 90 °, hand wheels move in opposite directions.
        2.2 handwheel signals
        Phase, Debouncers designed to eliminate interference due to various factors which led to clutter the output pulse with a hand wheel, to ensure the reliability and validity of the output signal must be carried out before the counter to shake process. Generally use two methods to improve the ability to filter out the clutter: First, when using a Schmitt trigger input pole, by the Schmitt trigger waveform shaping ability to filter out clutter; second is to use a multi-stage delay methods to accomplish filtering. Similarly, the phase can also be used common methods: D flip-flops and gate circuits. These methods are relatively simple to implement, but the anti-interference ability. Based on the above analysis, in order to better achieve the handwheel signal phase discriminator filtering work, we use a state machine plus sign discriminating approach.
        Through trial and error in the actual work, and that the use of this method to achieve the handwheel phase, to shake the work, is better than the conventional method. Figure 2 shows: rotate a scale, the ideal situation is A, B signal combining a total of four states, when forward, status BA is: 00 ※ 01 ※ 11 ※ 10; when reversing, BA state: 00 ※ 10 ※ 11 ※ 01. In order to facilitate the description, so S1 = 00, S2 = 01, S4 = 11, S3 = 10, FP and FN are used as forward and reverse the corresponding state flag, when after the completion of the previous one state to the next transition, the corresponding location 1. If the forward or reverse four consecutive complete state, there are a pulse output, namely Q = 1, and predetermined positive direction of rotation, the direction signal D = 1, then the anti-D = 0.
        The following description will be sub-hand wheel signal state transition diagrams, and to achieve using CPLD to illustrate the design process.
        S1 is the current status:
        (1) If the previous state of S1, set forward flag FP = 0001, FN = 0001, then Q = 0;
        (2) If the previous state of S3, and FP = 1111, then Q = 1, D = 1, the hand wheel forward one notch;
        (3) If the previous state of S2, and FN = 1111, then Q = 1, D = 0, the handwheel reverse a scale;
        (4) If the previous state of S4, this status is inactive, the reset FP = 0001, FN = 0001, Q = 0, the handwheel interference signal came, not counting.
        When the current state is S2:
        (1) If the previous state of S4, and FN = 0111, then set FN = 1111, FP is cleared, the handwheel signal S4 state to complete the transition from state S2, belonging to a cycle of intermediate process, handwheel does not occur change, Q = 0;
        (2) If the previous state of S1, and FP = 0001, then set FP = 0011, FN is cleared, the handwheel signal to convert from S1 to S2 state status, the results above;
        (3) If the previous state of S3, this status is inactive, the reset FP = 0001, FN = 0001, Q = 0, the handwheel interference signal came, not counting.
        When the current state is S4:
        (1) If the previous state of S3, and FN = 0011, then set FN = 0111, FP is cleared, the handwheel signal to complete the conversion from S3 to S4 state, belonging to a cycle of intermediate process, handwheel does not occur change, Q = 0;
        (2) If the previous state of S2, and FP = 0011, then set FP = 0111, FN is cleared, the handwheel signal S2 to complete the transition from state to state S4, belonging to a cycle of intermediate process, handwheel does not occur change, Q = 0;
        (3) If the previous state of S1, this status is inactive, the reset FP = 0001, FN = 0001, Q = 0, the handwheel interference signal came, not counting.
        When the current state is S3:
        (1) If the previous state of S1, and FN = 0001, then set FN = 0011, FP is cleared, the handwheel signal to convert from S1 to S3 state status, belonging to a cycle of intermediate process, handwheel does not occur change, Q = 0;
        (2) If the previous state of S4, and FP = 0111, then set FP = 1111, FN is cleared, the handwheel signal to convert from S3 S4 state to state, belong to the middle of a period, handwheel does not occur change, Q = 0;
        (3) If the previous state of S2, this status is inactive, the reset FP = 0001, FN = 0001, Q = 0, the handwheel interference signal came, not counting.
        2.3 delay circuit
        Works seen by a reversible counter, before the count, first determine the direction in which you can use the D flip-flop so that the hand wheel pulse signal direction retardation than one clock cycle.
        2.4 16 reversible counter
        16 reversible counter effect is to record the positive and negative direction of displacement of the handwheel pulses; the direction of the signal phase after as the forward and reverse count determination to go through the filter, clean signal delay after the count pulses.
        2.5 buffer
        The role of the output buffer is to prevent internal signal and external bus conflicts, protect the external bus.
        3 Conclusion
        The concept paper introduced the handwheel signal processing state machine, effectively eliminates jitter when the handwheel slightly swaying caused by the direction of the signal and provide accurate count pulse reversible counter, CNC system to ensure correct handwheel count. I have used this method HDL language, and used in the numerical control system, accurate handwheel operation, to achieve the desired results. The method also highly versatile and can be used to deal with other incremental encoder and encoder signals.