• Tidak ada hasil yang ditemukan

Program Interpretation and Validation

7. Control Algorithms for Open Architecture Control System

7.3. Program Interpretation and Validation

65

Table 10 can be used for the trial and error method to tune the PID controllers. However despite its simplicity the trial and error method is by no means the most accurate and efficient method of tuning control parameters. A more effective method used to tune controllers is the Ziegler-Nichols tuning method. It is however more complex and requires calculations.

The Ziegler-Nichols method was developed through experimentation by Ziegler and Nichols. They proposed a set of rules to determine the tuning parameters (Kp, Ki and Kd) using the transient step response of the controller [62], also known as the reaction curve. The first Ziegler-Nichols method is for controllers with no integrators or complex conjugate poles, whose step response or reaction curve is S-Shaped, with no overshoot. Figure 53 [62] shows a reaction curve for a step response of a controller as well as the critical points required for Ziegler-Nichols tuning.

Figure 52: Ziegler Nichols Tuning

Using the Ziegler-Nichols method and the reaction curve, if a tangent line is drawn at the inflection point of the S-Shaped curve, two key constants are generated, namely the delay time L, and the time constant T. These two constants are determined by locating the intersections of the tangent line with the X-Axis, as well as the time and the steady state of the response curve [62]. Once these two constants have been calculated, Ziegler-Nichols proposes setting new values for Kp, Ki and Kd based on the formulas in the following table:

Table 11: Ziegler Nichols Tuning Rules

Controller Kp Ki Kd

P / 0 0

PI 0.9 / 0.27 / 0

PID 1.2 / 0.6 / 0.6

66

Table 12: Reduced NC command Instruction Set

Function Address Example Units

Program Number P P00001 --

Block Number N N01 --

Preparatory Function G G01 --

Coordinate

(Translational Axis) X, Z X100, Z50 Mm

Coordinate

(Rotary Axis) A A25 Degrees

Feed rate F F100 mm/rev – mm/min

Spindle Speed S S1000 Rpm

The following code is an example of a part program (P001) consisting of 4 NC blocks. Each block consists of several words, and each word consists of an address and a number. A part program such as this example can be programmed into the GUI and is interpreted and validated.

P001;

N10 G01 X0 Y0;

N20 G01 X100 A25 F100 S1000;

N30 M00;

N40 M02;

The part program and the NC words can be described as follows:

 N10 and N20 are the current code block numbers

 G01 is a preparatory function, in this case a movement command, which commands the relative movement between the tool and workspace

Thereafter, the individual axis can be instructed to move to a desired location, as is demonstrated in this example.

 In the code block N10, the X and Y axes are commanded to move to the origin or zero point at the default feed rates

 In the code block N20, the X axis is requested to move to 100 mm towards the workspace from the origin or zero point and the rotary axis A, 25 mm clockwise from its origin or zero point

Finally, the F-code and S-code is entered, setting the feed rates for the axes and the spindle speed for the tool head module. As per the example for code block N20:

 The feed rate is set at 100 mm/rev;

 The spindle speed is set to 1000 rpm;

 The “;” is the end of block character.

Code blocks N30 and N40 demonstrate the movement start and stop commands. The flow chart in Figure 53 illustrates the sequence of events followed for text interpretation and user program validation. Once the user has entered in the program, and the program is saved, the text interpretation and program validation routine is called. The routine opens a .dat file and updates it as

67

the interpretation and validation is processed. Each code block is read sequentially and each word is verified. The words are checked to see if they can be classified as:

 M or G code words

o Preparatory functions for modes or machine commands

 Coordinate commands

o Verification against the limits of the respective axis, depending on the current axis position to ensure that the MRMT can carry out this command

 Feed rates

o Verification to ensure that the feed rate is less than the lowest feed rate of all the axes on the MRMT.

 Spindle speeds

o Verification to ensure that the speed commanded is within the range of operation

 End Of Block (EOB commands)

o Signals end of the current code block

As each line of code is read, interpreted and verified, it is saved in the .dat file for machine operation.

During the verification, if NC code block fails to be interpreted or verified, the user is presented with an error message, signalling that the code block is invalid. The text interpretation and validation routine is then terminated and the .dat file is deleted. Sample code for the text interpretation routine is attached in Appendix D.

The text interpretation is implemented for the reduced instruction set. Depending on the MRMT requirements, a more complex text interpretation can be implemented on the OACS. If required, the OACS can be modified by simplify editing the text interpretation routine only, ensuring that the pointers to the input data and output data in the routines follows the conventions of the original text interpretation routine. Changing this routine does not affect the performance and operation of the rest of the OACS, thus making the OACS reconfigurable and customizable as per the user requirements.

68

Figure 53: Text Interpretation and Validation Flowchart

End of Program

Updatej.dat fileJ End of word

Error "Unable td operate at thisj feed rate. feed L - - - 1 ' ---.! rate must be lower

than the lowest feed rate of all

axes"

69