technique called approxi mation has to be used to simulate

in the illustration – technique called approxi mation has to be used to simulate the curve by a se ries of very short lines The shorter each line is, the more ac cu rate the sim u la tion, but at the price of a lon ger stan dard pro gram Length of

the pro gram is not a con cern in macro, since the loop ing func tion will al ways have the same size

The first step to take is to define the for mula math e mat i cally Since it is a trig o no met ric sine

curve, the SIN func tion will be used Math e mat i cally, the for mula angle machine to cal cu late the Y is:

Y = Amplitude  sinX

In many math books, the sine curve for mula is listed as Y = sinX This des ig na tion is the same

as Y = 1  sinX, con sid er ing the un spec i fied am pli tude as hav ing the value of 1 Oth er wise, the am pli tude must al ways be spec i fied The defined pe riod of the curve has to be seg mented into

small an gle in cre ments for best fit The first an gle in cre ment will be used to cre ate the notching machine first lin ear

mo tion, the sec ond in cre ment will be used to cre ate the sec ond lin ear mo tion, and so on, un til all

360掳 have been cal cu lated in equal in cre ments The ma chined re sult is the re quired sine curve


Assignment of variables in the sine curve macro call O8009 is short and angle shearing machine simple:

Am pli tude

assigned letter A (variable #1)

Angular increment

assigned letter I (variable #4)

Cutting feedrate

assigned letter F (variable #9)

The macro call will con tain only three vari ables:

G65 P8009 A1200 I50 F2500

Note that the cur rent units must be used (met ric shown) and the an gu lar in cre ment must con –

form to the min i mum pro gram ma ble in put of 0001掳 In the ex am ple, the sine curve will be ma –

chined as a lin ear mo tion – a se ries of straight lines in in cre ments of 5掳 De crease the in cre ment

for more ac cu racy, in crease the in cre ment for less ac cu racy Z-axis mo tions must be ap plied in the main pro gram The macro will be a sin gle level loop, us ing a coun ter of the cur rent in

Tags: ,

r der for each nest ing level is shown

r der for each nest ing level is shown

here in a sim pli fied form ( Sn is the start level num ber, En is the cor re spond ing end level num ber): S1 E1

Single level

S1 S2 E2 E1

Double level

S1 S2 S3 E3 E2 E1

Triple level

Copyright 2005, Industrial Press Inc, New York, NY – FANUC CNC Custom Macros


Chapter 13

Each listed digit in di cates the cur rent nest ing level, and the or der of dig its rep re sents the or der

of pro gram flow from one nest ing level to an other and then back This is the angle machine nest ing struc ture as it

should be Un for tu nately, mis takes do hap pen, and in macro loop ing, the most com mon mis take

is cross ing the lev els when more than one level is programmed

Cross ing the WHILE loop be tween nest ing lev els is not al lowed, for ex am ple, the fol low ing

WHILE struc ture (and struc tures that are sim i lar) is wrong – Fig ure 25:

WHILE [ Condition 1 is true ] DO1

Start of WHILE loop 1

WHILE [ Condition 2 is true ] DO2

Start of WHILE loop 2


End of WHILE loop 1


End of WHILE loop 2

Figure 25

Common macro looping error – major structure problem (compare with previous formats)

Er rors of loop ing, in any num ber of nested lev els, may not al ways be the eas i est ones to find,

par tic angle shearing machine u larly in long or com plex mac ros That is the main rea son why al ways main taining or der

and con sis tency in macro pro gram de vel op ment is so important For some macro pro gram mers, a

flowchart is a man da tory tool, for oth ers, they can de velop a macro very well with out a flowchart

How ever, a well de signed flowchart is im por tant for the be gin ner, as well as for the sea soned pro –

gram mer – it helps punching machine to design the macro logic dur ing the de vel op ment stages and re trace the macro

flow at a later date

Conditional Expressions and Null Variables

Ear lier in this hand book, the im por tant sub ject of re turn val ues of var i ous ex pres sions and cal –

cu la tions was in tro duced – one of the el e ments was a null vari

Tags: ,

the same null variable and its relationship to con ditional expressions

able (an empty vari able or a va cant vari able) In this sec tion, the same null variable and its relationship to con ditional expressions will

be evaluated Make sure to un der stand this sub ject well, it can help in many trou ble shoot ing sit u a –

tions Con di tional ex pres sions used with the IF and WHILE func tions (ex plained ear lier) al ways

com pare two val ues, us ing com par i son op er a tors such as EQ, NE, GT, LT, GE, and LE If a null vari able is com pared with an other value, the re turn value may be ei ther TRUE or FALSE, de pend –

ing on the ex act sit u a tion Com paring to a zero value is also shown, for more in-depth ref er ence

Copyright 2005, Industrial Press Inc, New York, NY –

FANUC CNC Custom Macros



A null vari able is dif fer ent than a vari able with a value of zero! As both the IF and the WHILE

func tions share the same logic, only the IF func tion is shown in the fol low ing ex am ples, be cause

the WHILE func tion uses the same for mat:

2 Comparing a null variable to a null variable:

#1 = #0

#1 is defined as null (that means #1 is vacant)

IF[#1 EQ #0]

Returns TRUE

IF[#1 NE #0]

Returns FALSE

IF[#1 GT #0]

Returns FALSE

IF[#1 GE #0]

Returns TRUE

IF[#1 LT #0]

Returns FALSE

IF[#1 LE #0]

Returns TRUE

2 Comparing a zero to a Dished Head Punching Machine null variable:

#1 = 0

#1 is defined as zero (that means #1 is equal to 0)

IF[#1 EQ #0]

Returns FALSE

IF[#1 NE #0]

Returns TRUE

IF[#1 GT #0]

Returns FALSE

IF[#1 GE #0]

Returns TRUE

IF[#1 LT #0]

Returns FALSE

IF[#1 LE #0]

Returns TRUE

2 Comparing a null variable to a zero:

#1 = #0

#1 is defined as null (that means #1 is vacant)

IF[#1 EQ 0 ]

Returns FALSE

IF[#1 NE 0]

Returns TRUE

IF[#1 Angle Punching GT CNC Angle Line 0]

Returns FALSE

IF[#1 GE 0]

Returns TRUE

IF[#1 LT 0]

Returns FALSE

IF[#1 LE 0]

Returns TRUE

2 Comparing a zero to a zero:

#1 = 0

#1 is defined as zero (that means #1 is equal to 0)

Tags: , ,

mental degrees compared with the final angle

 mental degrees compared with the final angle, such as the 360 sed in the ex am ple:


#25 = 0

Set initial counter for degrees increment

WHILE [#25 LE 3600]

Loop for each linear segment until 360 degrees are machined

#26 = #1 * SIN[#25]

Calculate current Y-location

G90 G01 X#25 Y#26 F#9

Make a linear motion to the calculated XY location

#25 = #25+#4

Increase the counter by specified increment


End of loop


End of macro


If re quired, the start and fi nal an gles can be also in put as vari ables, if only a por tion of the sine

curve is needed The sine curve macro can be very eas ily changed into a co sine curve macro, by

shift ing the sine curve 90 to the left, or mov ing the Y-axis 90 to the right

Copyright 2005, Industrial Press Inc, New York, NY –

FANUC CNC Custom Macros


Chapter 13

Clearing Common Variables

One very use ful and prac ti cal ex am ple of a sim ple WHILE loop is the de vel op ment of a macro

that can be stored in the con trol mem ory per ma nently, to be used by notching machine any pro gram or from MDI

This macro clears the 500+ se ries of com mon vari ables, which can only be cleared by us ing

macro func tions The CNC op er a tor may clear all the vari ables at the con trol, in MDI mode, one

by one Much better so lu tion is to have a pro gram handy that cov ers all vari angle shearing machine ables in the range, and

sets them to the null (#0) state in di vid u ally, by a macro loop:


#500 = #0

Common variable #500 cleared (set to null)

#501 = #0

Common variable #501 cleared (set to null)

#502 = #0

Common variable #502 cleared (set to null)

#503 = #0

Common variable #503 cleared (set to null)

#999 CNC Angle Line = #0

Common variable #999 cleared (set to null)

Such a pro gram can be quite long and will take un nec es sary mem ory space Using a loop, the

pro gram will be short ened sig nif i cantly and be more pro fes sional as well:


Closed-loop control of the secret: the use of feedforward control system to make adjustment easier

Closed-loop control system has the advantage of: through the motion controller to make the advantages of hydraulic energy to play to meet the modern institutions to control more precise requirements. The control links containing the proportional, integral, derivative (P, I and D) gain parameters have become the standard function of the motion controller and additional control parameters have been added to optimize the control cnc machining center algorithm. For example, a feedforward gain is added to satisfy the increased dynamic system response while reducing position and velocity errors. This results in a higher machine control performance and a longer machine life due to smooth operation.
The motion controller uses a combination of proportional, integral and derivative gains to generate control signals to reduce errors in the target position and the actual position. The proportional gain (P) is simply multiplied by the instantaneous error between the target position and the actual position so as to proportionally act on the control signal at the next instant. The larger the error, the greater the resulting control signal.

Structural Steel Fabrication

The integral gain (I) is multiplied by the sum of the position errors over a period of time to produce an integral effect on the output. Even if the error is small at any time, the sum of the errors will eventually increase to a point where the error is reduced.
The derivative gain (D) is multiplied by the error of the target and actual speed [WHM1]. The effect of the derivative gain on the output control signal is proportional to the divergence Hydraulic notching machine and convergence rate of the target and actual position deviation. For simplicity, we ignore the differential gain by using a system with sufficient damping factor.
One limitation of using only PID control is that the proportional link requires an error to produce the control output, and the integral link requires error and time. The output signal used to control the electro-hydraulic valve is always related to the error between the target position and the actual position of the load. In many cases, if only the proportional gain is used, the error needs to be large enough to produce the desired control signal. Adding an integral link will be through the accumulation of errors, so that the output of the control signal increases, but the integral part of the output signal increases need time.
In general, point-to-point operation occurs very quickly, because the integrator does not have enough time for error accumulation, so here rarely used integrator. Even if the integrator accumulates the error, it is likely to cause overshoot of the position control when the error is reduced.
When the error signal between the target position and the actual position changes, the integrator error accumulation decreases. This phenomenon occurs only when the actual position is overshooted by a certain amount of the target position, which is usually not desired in the motion control system. The motion controller can reduce the number of components in the front feedback control loop, thereby reducing the frequency of operation of the integrator.
The front feedback uses the motion controller’s target or action curve generator information. In general, the control principle of a high-performance controller is that the motion controller generates the target motion curve and then controls the actual motion following the target motion curve by the control loop (just like a donkey in front of a donkey to guide it forward).
The target action is refreshed after a period of time and may be refreshed every millisecond. Before each PID controller is refreshed, the target generator calculates parameters such as the position angle iron machine, velocity, and acceleration expected by the action. Because the motion controller “knows” the target speed and acceleration, it does not need to wait for the PID control to respond to the target position and the actual position of the error, can be directly output to meet the speed and acceleration requirements of the control signal.
The strength of the output signal is determined by the front feedback gain, which is a predicted parameter. The PID gain is multiplied by the feedback error. Instead of the feedback gain, the pre-feedback gain is the predicted gain. Its parameters are multiplied by the target speed and acceleration, respectively, and the sum is added to produce the control signal. As shown in Figure 1. The control of the output current by the front feedback is based on a simple formula,
Front feedback output composition = Kv × target speed + Ka × target acceleration
Among them, Kv expresses the speed before feedback;
Ka represents acceleration before feedback.
It is worth noting that motion control can be achieved in different ways. As shown in Figure 1, many factors determine the size of the control current. The output current can be obtained from the negative feedback of the PID control, either from the positive feedback calculation or from a combination of the two. However, the control current obtained under the same conditions can reach the same speed. The system does not care whether the control current is derived from the previous feedback or in the PID control. We can observe the above phenomena in Figures 2a, 2b, 2c.
If the system does not have high-speed motion, why not just increase the PID gain? Because in order to ensure the stability of the system, for the calculation of the feedback gain can not be too large. Normally, the negative feedback gain is increased to achieve the requirement of reducing the error without causing oscillation and instability. The advantage of obtaining the control signal from the previous feedback is that the pre-feedback does not generate the control signal by means of the error signal, as PID control does.
The key to designing a stable and easy-to-debug system is to use as much feedback as possible to obtain the control signal and to minimize the use of PID control to obtain the control signal. So that the error of the result will be minimized.
The designer uses the PID unit to compensate for environmental angle bending machine factors such as temperature and humidity in the system and the non-linear part of the system response that changes over time (eg, changes in the system load) that can not be evaluated in the front feedback .
Figure 2a. Actual and ideal motion profiles obtained with the RMCTools software. Only proportional gain is used here. The actual speed and position differ greatly from the desired speed and position. The area between the actual position curve (red) and the target position curve (cyan) is the error necessary to produce the proportional gain. This error can be eliminated by increasing the feed forward link.
Figure 2b. Pre-velocity feedback is added to the system of Figure 2a. Due to the constant velocity, the position error (the area between the red and blue curves) has been much reduced, but there is still a position error (see the part of the oval curve) during acceleration and deceleration.
Figure 2c. The motion profile is obtained in the same system as in Figures 2a and 2b with simultaneous feedback of velocity and acceleration. The actual position curve is in good agreement with the ideal curve. This is an optimal regulation system.
The action of pre – speed feedback system
The motion controller uses the pre-speed feedback gain to calculate the control current that actuates the actuator at a given speed.

structural fabrication machine

By controlling the servo valve, the system makes one end of the hydraulic cylinder through the hydraulic oil, one end of the hydraulic oil, thus driving the hydraulic cylinder action. In order to move the cylinder at a given speed, the system needs to control the flow of the hydraulic fluid and ensure that the net force acting on the piston is equal to the sum of the traction of the load and the friction of the hydraulic cylinder.
We can empirically estimate the control current intensity at each speed. This is done automatically by the speed front feedback unit. As shown in Fig. 2b, the position accuracy of the system is higher after introducing the pre-velocity feedback gain.
For example, we give the valve a control signal of 10% of the maximum intensity of the control signal and measure the speed of the actuator. If the actuator travels at 1-foot-per-second at this point, we can estimate that the actuator is running at about 3 feet per second when the control signal is 30% of the maximum signal. In other words, the open-loop gain of the system is such that the system moves at 1% per second at 10% control current.
The pre-feedback gain should be set to the opposite of the open-loop gain of the system, so the front feedback of the system corresponds to 10% of the control current per 1-foot-per-second. The motion controller calculates the control current using the pre-feedback after a new target speed is given.
Speed ​​before the feedback adjustment
As mentioned above, we often rely on observing the system open-loop action to determine the gain before the speed of feedback. However, in some of the implementation of components and applications, we need to do more work.
For example, a single rod piston cylinder must be in the direction of extension and retraction direction, respectively, debugging. Because the piston rod on both sides of the role of different areas cnc drill machine in the system extension and retraction stage need to set a different PID control and the former feedback gain. By calculating the speed ratio of the protrusion and retraction, the gain ratio at the time of extension and retraction can be determined.
This means that we can determine the pre-feedback gain ratio by first inputting a control current of + 10% to the system and then inputting a control current of -10% to observe the velocity of the piston rod in different directions. Even if the actuator is symmetric, the system still has nonlinear links. Such as hanging heavy objects, the gravity will cause the actuator to move down and hinder the actuator upward action.
Ideally, the system can fully use the pre-feedback gain work. But in fact, the load will change and there are non-linear part of the system, the motion controller through the PID gain aided before the feedback function. If the system load is greater, requires a 32% control current instead of the previous 30% of the control current work. The PID element in the control loop can provide a control current gain of 2%. The pre-speed feedback provides 30% of the control current to provide the main power.

How can the wear parts of the lift equipment be properly maintained?

What is fragile parts cnc for sale, mainly refers to the usual more easy to wear parts, easy to wear parts in the lift more, because the work of the various components and ultimately, friction, the following lifting platform for you to explain wear parts maintenance knowledge. Manufacturers equipment 1, tires Lift tire is a kind of wear goods, long-term use will be worn, and the lift tires are also divided into many kinds such as: nylon wheel, PU wheel, polyurethane bag nylon, rubber wheel. Most of the lifts are equipped with nylon wheels, because the market in general, cheap, but the wear of poor, walking noise is also large. Lift a certain degree of tire wear, please replace, expensive, cheap, customer choice. 2, the fuel tank Cylinders in the entire lifts play a vital role in the process hydraulic angle cutting machine, but also through it to achieve the goods rise and fall. So if the fork can not fall, or can not rise, the reason: 1) may be due to the load in the cargo, overload or partial load, making the piston rod and cylinder damage; 2) the piston rod exposed to rust for a long time, hinder the smooth movement of the piston; 3) Adjust the nut and hex nut is not in the correct position; then according to judge, replace the piston rod or cylinder, do not use the lift when the car down the minimum, re-adjust the nut. 3, seal ring Seal ring is sealed cylinder rod and cylinder between the key components, are generally equipped with imported seals.


Mainly good sealing, wear, use a long time. 70% of the cylinder oil leakage occurs in the oil seal above, if the cylinder oil leakage phenomenon, timely inspection, the case of aging and damaged seals, the choice of high-quality sealing ring replacement. piston 4, the pump station Pump station is a key part of all lifts, once the pumping station problems sheet metal fabrication, that declared lifts to stop working, no matter how good the other components in time, there is no damage, can not work. The pumping station is a very large number of common components, including the most prone to problems with a dust ring, O-ring, ball and other accessories, Zhenyang lift to remind you once these accessories problems or in the use of process In the wear and tear, damage, the easiest and fastest solution is to replace the replacement of these accessories. 5, pole Support rod is connected between the pumping station and the key components of the rod, hydraulic cylinder lifting support, cargo handling are supported by the pole to support and achieve a balance, due to the handling of goods, may be overloaded, And other phenomena tend to lead to deformation or fracture of the pole. It must occur this phenomenon can not operate the lift, so contact manufacturers or in the market to buy replacement pole Steel Punching. 6, electronic control switch.

Pneumatic auxiliary components failure treatment

Pneumatic auxiliary components failure treatment In this case pipe welding machine, Pneumatic components failure are: oil mist device failure, automatic sewage device failure, muffler failure. 1, the failure of the oil mist: adjustment of the needle is too small to adjust the amount of oil blockage, pneumatic punching pipe leaks and so will not be able to atomize the oil droplets. In this regard, the pneumatic punch should be promptly deal with blockage and leakage of the place, adjust the amount of drop of oil iron worker tools, to reach about 5 drops / min.

Normal use, the oil cup to keep the oil in the upper and lower limits within. The bottom of the oil cups are deposited in water, should be promptly ruled out. 2, Pneumatic Press Automatic sewage device within the oil and water can not be automatically excluded sometimes, especially in the case of low temperature in winter is particularly serious. In this case, it should be removed and inspected and cleaned. 3, when the valve mounted on the muffler is too dirty or blocked high speed drill, it will affect the sensitivity of the valve and commutation time, it is necessary to regularly clean the muffler.

environmental protection CNC Drilling Machine

Pneumatic presses, Luohu pneumatic punch, quality assurance services in place Luohu pneumatic punch equipment manufacturers – IPM main products: precision presses, pneumatic presses, sheet metal presses, forging presses, and so on. Pneumatic punch its use of the most advanced casting technology, the whole structure is stable; system micro-electric control to prevent the second punch cnc punching machine, double protection; micro-control punching strength, machine damage to aluminum minimum; Low noise; slider with six-oriented, and enhance the service life of the mold. With the operation stability, safety, high precision, processing automation, environmental protection CNC Drilling Machine, energy saving and so on. IPM punch is your trusted professional punch manufacturers Head punching machine. IPM pneumatic punch quality assurance services in place, please contact

Pneumatic punch the old brand gantry welding machine

Pneumatic punch the old brand gantry welding machine, Guangzhou punch equipment – co-forging Guangzhou Punch Equipment-IPM mainly produces precision presses, pneumatic presses, sheet metal presses and forging presses. Among them, the pneumatic punch has a simple structure and low production cost, and adopts pneumatic technology to realize an air compressor for multiple pneumatic punching machines at the same time. Work, more energy than the electric punch custom metal fabrication. Reduce power consumption. Simple operation, high safety, the use of foot switches to control the solenoid valve, simple structure, low failure rate and improve efficiency.

Highly sensitive, test clutch / brake device and the international top double solenoid valve to ensure that the press slide and stop the accuracy and safety of the machine running the transmission components using centralized detection drill machine, automatic forced lubrication system design, Real-time control can be achieved, self-protection function. IPM is the Guangdong punch processing of the old brand, welcome customers to buy, and to undertake the special needs of customers specifications products.

Characteristics of Pneumatic Presses Pneumatic punch

Characteristics of Pneumatic Presses Pneumatic punch, riveting press, riveting machine, riveting machine, pneumatic press punching machine A: product characteristics 1, with compressed air as the power source boring machine, high efficiency and easy operation, can reduce labor force, suitable for manual operation, automated assembly line operations; 2 CNC Busbar Punching Machine, the structure is simple, easy to operate, cheap, superior performance, there is no oil pressure system and the standby power generated by noise, can save electricity consumption to reduce production costs, with a high price; 3, the output is easy to adjust, just adjust the barometric pressure can be adjusted to the required pressure, high yield. With anti – rotation of the guide bar, guide plate, high precision, can adapt to high – speed precision Chongzai; 4, according to different products or mold, adjust the height, speed, stroke, the size of the pressure and stamping time; 5 beam drilling and sawing lines, optional hand control buttons or foot switch, can increase the protection device, heating mold, temperature control and pressure sensors, control devices and pre-control device in line with safety standards to ensure the safety of operators. 6, the use of microcomputer control system, can choose manual, semi-automatic, fully automatic operation, and the other can increase the control device. Second, the scope of application Suitable for electronics, electrical appliances, instruments, meters, cameras, watches, jewelry, hardware and clothing, footwear industry; Third, the processing of materials Can be thin, strip, coil shear, punching, blanking, forming, bending, riveting and other processes; suitable for non-ferrous metals, plastic parts processing.