1. Trang chủ
  2. » Luận Văn - Báo Cáo

project report topic control cnc machine table with pid controller

64 2 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Control CNC Machine Table with PID Controller
Người hướng dẫn Ph.D. Tao Ngoc Linh
Trường học Hanoi University of Science and Technology
Chuyên ngành Mechanical Engineering
Thể loại project report
Năm xuất bản 2023
Thành phố Hanoi
Định dạng
Số trang 64
Dung lượng 11,43 MB

Cấu trúc

  • CHAPTER I: ANALYSIS OF PRINCIPLES AND SPECIFICATIONS (4)
    • 1. Working principles (4)
    • 2. Identify the components of the control system (8)
  • CHAPTER II: COMPUTATION METHODS AND INTERPOSAL (10)
    • 2.1. Interpolation method (10)
    • 2.2 Line interpolation method (11)
    • 2.3 Circle interpolation (13)
  • CHAPTER III: MOTOR CONTROLLING TABLE X ,Y BY PID CONTROL (15)
    • 3.1. Table X (15)
      • 3.1.1. Build a transfer function model of the system (15)
      • 3.1.2. Qualified transfer function G(s) for table X (17)
      • 3.1.3. Check the stability of the transfer function G(s) (17)
      • 3.1.4. PID controller design for table X (20)
    • 3.2. Table Y (27)
      • 3.2.1. Build a transfer function for table Y (27)
      • 3.2.2 Qualified transfer function G(s) for table Y (27)
      • 3.2.3. Check the stability of the transfer function G(s) (28)
      • 3.2.4. PID controller design for table Y (31)
  • CHAPTER IV: DESIGN CONTROL CNC CIRCUIT (35)
    • 4.1. Input Devices (35)
    • 4.2. Main Control Unit (36)
    • 4.3. Driving System (42)
    • 4.4. Feedback System (46)
    • 4.5. Complete Circuit (49)
  • CHAPTER V: SYSTEM OPERATION SIMULATION WHILE MACHINING IS (50)
    • 5.1. Export 3D model files to Matlab (50)
    • 5.2. Straight line simulation (52)
    • 5.3. Circle line interpolation (57)

Nội dung

School of Mechanical Engineering Instructor: Ph.D... School of Mechanical Engineering Instructor: Ph.D.. The transfer functionof a system or a block is defined as the ratio of output to

ANALYSIS OF PRINCIPLES AND SPECIFICATIONS

Working principles

Control systems in an interdisciplinary field covering many areas of engineering and sciences Control systems exist in many systems of engineering, sciences, and in human body Some type of control systems affects most aspects of our day-to-day activities.

Control means to regulate, direct, command, or govern A system is a collection, set, or arrangement of elements (subsystems) A control system is an interconnection of components forming a system configuration that will provide a desired system response. Hence, a control system is an arrangement of physical components connected or related in such a manner as to command, regulate, direct, or govern itself or another system.

In order to identify, delineate, or define a control system, we introduce two terms: input and output here The input is the stimulus, excitation, or command applied to a control system, and the output is the actual response resulting from a control system The output may or may not be equal to the specified response implied by the input Inputs could be physical variables or abstract ones such as reference, set point or desired values for the output of the control system Control systems can have more than one input or output The input and the output represent the desired response and the actual response respectively A control system provides an output or response for a given input or stimulus, as shown in Fig 1.1

There are two control system configurations: open-loop control system and closed- loop control system.

(a) Block A block is a set of elements that can be grouped together, with overall characteristics described by an input/output relationship as shown in Fig 1.2 A block diagram is a simplified pictorial representation of the cause-and-effect relationship between the input(s) and output(s) of a physical system.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 1.2 Block diagram of whole control system

The simplest form of the block diagram is the single block as shown in Fig 1.2. The input and output characteristics of entire groups of elements within the block can be described by an appropriate mathematical expressions as shown in Fig 1.3

Fig 1.3 Block diagram for logic expression

(b) Transfer Function The transfer function is a property of the system elements only, and is not dependent on the excitation and initial conditions The transfer function of a system

(or a block) is defined as the ratio of output to input as shown in Fig.1.4

Fig.1.4 Block diagram for transfer function

Transfer functions Transfer functions are generally used to represent a mathematical model of each block in the block diagram representation All the signals are transfer functions on the block diagrams.

Instructor: Ph.D Tao Ngoc Linh

For instance, the time function reference input is r(t), and its transfer function is R(s) where t is time and s is the Laplace transform variable or complex frequency Transfer functions can be used to represent closed-loop as well as open-loop systems.

(c) Open-loop Control System Open-loop control systems represent the simplest form of controlling devices A general block diagram of open-loop system is shown in Fig 1.5

Fig 1.5 Block diagram of opened-loop system

(d) Closed-loop (Feedback Control) System Closed-loop control systems derive their valuable accurate reproduction of the input from feedback comparison The general architecture of a closed-loop control system is shown in Fig 1.6 A system with one or more feedback paths is called a closed-loop system.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 1.6 Block diagram of closed-loop system

Instructor: Ph.D Tao Ngoc Linh

Identify the components of the control system

Down below are some notable about benefits of closed-loop control system

- These systems are exceedingly precise and faultless.

- Errors can be fixed through feedback signals.

- It supports better for automation.

- They are not affected by interference.

So, I choose closed-loop control system for CNC machine.

Control system is closed-loop with feedback path:

Fig 1.7 The structure diagram of the CNC machine

The control system consists of the following main components:

+ Actuator: Motor: transmit motion to the lead screw through coupling.

Coupling and ball screw system: transmit motion to the machine table Machine table.

+ Sensor: Encoder: as a measuring device to assist CNC machining achieve high precision, determine the precise location of the machine axes and the position of the cutter

Cruise switch or travel sensor, temperature sensor, pressure sensor for lubrication and cooling systems.

+ Control devices: Drivers for motors, PCs, PLCs.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 1.8 Feed drive mechanism with a lead screw drive

In this project, I will control the motor to construct a CNC machine table controller This controller requires fewer than 5% overshoot, a response time of less than 0.5s, and the system clings to the input excitation signal.

Instructor: Ph.D Tao Ngoc Linh

COMPUTATION METHODS AND INTERPOSAL

Interpolation method

On numerically controlled machine tools, the line of action between the tool and the part is formed by shifting coordinates on multiple axes To produce a machined profile, there must be a functional relationship (linear or non-linear) between the motions on each of the individual coordinates.

The fulcrums must be located so densely that the resulting machined profile is sufficiently precise (no point is out of tolerance).

The coordinate values of the intermediate points are found in a cluster of numerical control functions called the interpolator.

- Find out the position of intermediate points that allow the formation of a given profile within a specified tolerance.

- The speed given the positions of the intermediate points must match the tool speed.

- Go to the correct points and end the progress.

To determine the required values of position on individual axes, different interpolation methods are applied If classified according to the algorithm used, we can distribute the interpolation in 2 groups:

- Group 1: devices that work on the principle of evaluation and fractional integral parts.

- Group 2: devices working on the principle of integral numbers.

If classified by implementation method, there are 2 types:

Technically, the implementation of interpolation by analog or digital working devices:

- Simple analog-style interpolator with limited accuracy.

- In fact, people use interpolation according to the number principle.

Calculating interpolation of functions in numerical form is done by 3 methods:

- Calculate functions directly from the curve in the form of a mathematical function f ( x,y,z)

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

- Calculate the parameters of the curve in real time.

- Converting the eigenvectors of the system to differential equations for numerical calculation will find the toolpath values through the sum of the differentials This method is called Digital Diferential Analysis (DDA) method.

Line interpolation method

+Definition: The drill head is moved from the beginning to the end of the stroke in a straight line sequence.

+ Implementation: Line interpolation along 2 or 3 axes

Start point coordinates, end point coordinates.

+ Possibility: Theoretically, line interpolation can make any curved trajectory, but the amount of data to be processed is very large Using arc, parabolic, and helix interpolation reduces the amount of data to be programmed

Instructor: Ph.D Tao Ngoc Linh

Example: Interpolate from point A to point E

Using the method “Digital differential analysis”

Consider a knife that needs to be moved from :

From starting point PA to ending point in a straight line with a specified tool PE speed ( figure ) u

Fig 2.2 Example of line interpolation

So in time: T = L/u Line components ( XE-XA) and

Coordinates of intermediate positions are calculated as a function of time:

Divide the time T into   t T N / sufficiently small intervals đủ nhỏ , Integral can be replaced by numeric addition:

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

With each addition step, the position value is increased by a constant step by one To ensure the accuracy of the interpolation profile, the addition steps must be less than the unit rate of the tool motion Usually  f = 0,001 mm.

Circle interpolation

+ Definition: The drill head is moved from the starting point to the end point of the stroke in an arc by a simple command (block), replacing many line interpolation commands. + Implementation: Interpolate circular lines along 2 axes.

Start point coordinates, end point coordinates, center or radius of the arc.

+ Possibility: Interpolate arcs or entire circles.

DDA interpolation method is also applied in arc interpolation.

Example: Interpolation of arcs from P A to P B

Instructor: Ph.D Tao Ngoc Linh

From the figure: To run the cut along the curve, the intermediate points on the profile must be determined from the interpolator in a relationship that depends on the running time in the cut

 Integrating by the time , We get the component speeds on each individual axis:

With sufficient precision, the above integral can be replaced by the addition of the displacement line increments Therefore:

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

MOTOR CONTROLLING TABLE X ,Y BY PID CONTROL

Table X

3.1.1 Build a transfer function model of the system

Fig 3.1 Machine tool table simulation

Fig 3.2 Modeling machine tool table 3.1.1.1 Input data

Weight of workpiece and table X: M = 860 kg , friction coefficient f = 0.01 , lead screw step l= 10 mm , Ballscrew length L = 1093 mm.

Instructor: Ph.D Tao Ngoc Linh

M : Weight of workpiece and table X

+ ( )t : The angle of rotation of the motor required to produce a displacement x(t) + l : Lead screw step , l= 10 mm

Where: f is the coefficient of friction( f =0,01)

Choose Single Flexing Coupling with an inner diameter of 45mm It’s stiffness is 294.2x(Nm/rad) -According to document coupling 2

- Axial rigidity of the support bearing

- Rigidity of the Nut Bracket and support bearing bracket

- Axial rigidity of the screw shaft

- : Axial rigidity of the Nut

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Because of using fixed-simple type of support, so in order to get kswe use formula (From PMI ballscrews catalog)

- A: Ball-screw cross-sectional area, A= ( For DEmm)

In which: k1, dynamic load = 5576,5 kgf, average axial force 53,7 kgf

After calculating, we get a table of stiffness:

3.1.2 Qualified transfer function G(s) for table X

Using the Laplace transform on both sides of the equation, we get:

3.1.3 Check the stability of the transfer function G(s)

3.1.3.1 Check the stability of the opened system

Instructor: Ph.D Tao Ngoc Linh

If all the roots of the expression A(s) lie to the left of the imaginary axis, or then A(s) is called a Hurwitz polynomial, we use the roots A(s) command to get the following set of solutions:

Therefore, the opened system is stable.

3.1.3.2 Checking the stability of the closed system

Input to Matlab: ằ num = 4563; ằ den = [850 34845 2867330]; ằ nyquist(num,den)

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 3.3 Nyquist diagram of system

Based on the graph below, we can see that: The point (-1+j0) marked (+) on the figure is not bounded by the Nyquist diagram, so the closed system is stable.

Input to Matlab: ằ num = 4563; ằ den = [850 34845 2867330]; ằ bode(num,den)

Fig 3.4 Bole diagram of the system

Comment: The phase line is above  180 0 so the closed system is stable

3.1.3.3 Check the system response with some common signal

Instructor: Ph.D Tao Ngoc Linh

Fig 3.5 Step response of the system

Comment: With overshoot up to  max

= 30,6% T max =0.0584 s This is unacceptable for a system where it is required to set a correction transient in the range of 2% Furthermore, here we give the system an excitation with signal 1(t) but the system does not sell input

3.1.4 PID controller design for table X

3.1.3.1 Basic knowledge of PID controller

The PID controller is responsible for bringing the error e(t) of the system to zero so that the transition process satisfies the basic requirements for quality.:

- If the error e(t) is larger, through the amplification stage (P), the signal u(t) will be larger.

- If the error e(t) is often changed, then through the integral step (I), PID still generates an adjustment signal.

- If the error change of e(t) is larger, through the differential component (D), the appropriate response of u(t) will be faster.

The PID controller is described by the I/O model:

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

The transfer function of the PID controller:

Fig 3.6 Closed-loop feedback control with PID controller

3.1.3.2 The role of proportionals, integrals, and differentials

The larger the value, the faster the response speed, so the larger the error, the larger the proportional compensation If the magnitude of the scaling is too high, the system will be unstable Conversely, the small magnitude is due to the small output response while the input error is large, and makes the controller less sensitive, or slow to respond If the magnitude of the proportional link is too low, the control action may be too small in response to system disturbances.

Instructor: Ph.D Tao Ngoc Linh

Fig 3.7 The role of the proportional stage in the PID controller

Fig 3.8 The role of the integral stage in the PID controller

The distribution of the integral (sometimes reset) is proportional to both the amplitude of the error and the duration of the error The sum of the instantaneous errors over time (the integral of the error ) gives us a previously corrected compensatory accumulation The accumulated error is then multiplied by the integral gain and added to the controller output signal The distribution amplitude of the integral over all adjustments is determined by the integral gain K i

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

The larger the value, the faster the stability error is eliminated The return is a larger overshoot: any negative error that is integrated during the transient response must be suppressed by the positive error as it approaches steady state.

Fig 3.9 The role of the differential stage in the PID controller

The differential step slows down the rate of change of the controller output and this characteristic is most noticeable to reach the controller setpoint From there, differential control is used to reduce the overshoot amplitude generated by the integral component and improve the stability of the composite controller However, the differential of a signal will amplify the noise and thus this link will be more sensitive to noise in error, and can cause the process to become unstable if the noise and differential gain are large enough.

Parameter Rise time Overshoot Setting time Stability error Stability

K p Decrease Increase A bit change Decrease Down stage

Ki Decrease Increase Increase Significant decrease Down stage

3.1.3.3 Design the PID controller according to the experimental method ( method Ziegler- Nichols the first)

The first Ziegler-Nichols method uses the most inertial approximation model with delayed control objects.

Instructor: Ph.D Tao Ngoc Linh

The experimental method is responsible for determining the parameters K p

, K i , Kd for the PID controller on the basis of the transfer function approximation G(s) becomes (1), for the closed system to quickly return to steady state and adjustment h do not exceed an allowable limit, about 40% in compare with h= lim ( ) t   ht

3 parameter L ( delay time constant), K (amplification factor) và T (time constant of inertia ) of model approximation (1) can be approximated from the overshoot function h(t).

L(t) is the time of output h(t) have not response to stimulate 1(t) on the input.

K is limitation value of h= lim ( ) t   ht

Called A is the finished point in the time domain, which means in x-axis where have length L And T is the time required after L for the tangent of h(t) at A to reach k. After calculating all of the parameters, PID controller has the form:

K L  hay K D 0.5kL p Apply the above theory to design the PID controller as follows.

Fig 3.10 PID controller for table X

By using the Matlab simulation tool has a built-in PID controller design tool The results of designing automatic PID multiplex using Matlab & Simulink are as follows:

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 3.11 PID controller parameters of table X

Fig 3.12a Step response of table X when using PID controller

Instructor: Ph.D Tao Ngoc Linh

Fig 3.12b Step impulse response of table X when using PID controller

Comment: Looking at the jump response of the X table when there is a PID controller in the graph above, we can see that the system has a strong grasp of the input signal, the overshoot was below 5% and the response time was below 0.5s.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Table Y

3.2.1 Build a transfer function for table Y

Weight of workpiece and table X: M = 1090 kg , friction coefficient f = 0.01 , lead screw step l= 10 mm , Ball screw length L = 943 mm.

Theoretically, compute as the previous for table X We get data below

- A: Ball-screw cross-sectional area, A= ( For DEmm)

In which: k1, dynamic load = 6697,5 kgf, average axial force B4,8 kgf

After calculating, we get a table of stiffness:

3.2.2 Qualified transfer function G(s) for table Y

Using the Laplace transform on both sides of the equation, we get:

Instructor: Ph.D Tao Ngoc Linh

3.2.3 Check the stability of the transfer function G(s)

3.2.3.1 Check the stability of the opened system

If all the roots of the expression A(s) lie to the left of the imaginary axis, or then A(s) is called a Hurwitz polynomial, we use the roots A(s) command to get the following set of solutions:

Therefore, the opened system is stable.

3.2.3.2 Checking the stability of the closed system

Input to Matlab: ằ num = 4569; ằ den = [1090 39265 2871066]; ằ nyquist(num,den)

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 3.13 Nyquist diagram of system

Based on the graph below, we can see that: The point (-1+j0) marked (+) on the figure is not bounded by the Nyquist diagram, so the closed system is stable.

Input to Matlab: ằ num = 4569; ằ den = [1090 39265 2871066]; ằ bode(num,den)

Instructor: Ph.D Tao Ngoc Linh

Fig 3.14 Bole diagram of the system

Comment: The phase line is above  180 0 so the closed system is stable

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

3.2.3.3 Check the system response with some common signal

Fig 3.15 Step response of the system

Comment: With overshoot up to  max

= 30,8% T max =0.0665 s This is unacceptable for a system where it is required to set a correction transient in the range of 2% Furthermore, here we give the system an excitation with signal 1(t) but the system does not sell input

3.2.4 PID controller design for table Y

Apply the above theory to design the PID controller as follows:

Fig 3.16 PID controller for table Y

Instructor: Ph.D Tao Ngoc Linh

By using the Matlab simulation tool has a built-in PID controller design tool The results of designing automatic PID multiplex using Matlab & Simulink are as follows:

Fig 3.17 PID controller parameters of table Y

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 3.18a Step response of table Y when using PID controller

Instructor: Ph.D Tao Ngoc Linh

Fig 3.18b Step impulse response of table Y when using PID controller

Comment: Looking at the jump response of the X table when there is a PID controller in the graph above, we can see that the system has a strong grasp of the input signal, the overshoot was below 5% and the response time was below 0.5s.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

DESIGN CONTROL CNC CIRCUIT

Input Devices

The program input device is the means for a part program to be entered into the CNC control Three commonly used program input devices are punch tape reader, magnetic tape reader, and computer.

Instructor: Ph.D Tao Ngoc Linh

Fig 4.3 CAM Software on Computer

In this project we choose computer to be input device because ease of use,export G-code files from CAM software.

Main Control Unit

To control CNC machine, we can use PLC, Microcontroller or PC using supported software. a, PLC

PLC stands for programmable logic controller.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 4.4 PLC (programmable logic controller)

This is a programmable control device that allows flexible implementation of logic control algorithms through a programming language User programmable to perform a series of events PLCs operate by scanning the input and output states When there is a change in the input, the output will change accordingly.

Advantages: to overcome the disadvantages of wired controllers (relay controllers), a PLC has been created to satisfy the following requirements: easy-to-learn, compact, easy-to-maintain programming language, repair; large memory capacity to accommodate complex programs; complete reliability in industrial environments; can communicate with other smart devices such as computers, network connections.

Disadvantages: Hardware cost is high, some firms have to buy additional software for programming; requires the user to have a high level of expertise. b, PC using professional CNC control software

Due to enormous memory and processing speeds of up to several GHz, PCs are increasingly being utilized to control CNC machines Companies have also created a

Instructor: Ph.D Tao Ngoc Linh wide range of professional CNC control software that runs on well-known operating systems like Windows or Linux.

Fig 4.5 PC used on CNC machines c, Microcontroller

Normally, microcontroller can be used is Arduino or STM32.

However, the disadvantage of the microcontroller is that it has little memory capacity, so it can only be used in mini-CNC machines, with light loads.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

So that, we prefer to utilize a PC with a specific CNC control program in this project due to its ease, big capacity, and comprehensive free software.

4.2.1 Mach3 CNC Control Software and Breakout Board AKZ250

To using PC to control CNC machine, we choose a specific CNC control program named Mach3 and a breakout board to link PC with other components. a, Mach3 CNC Control Software

Mach3 is software from ArtSoft, originally designed for hobbyist home cnc machine builders, but has quickly become versatile control software in industry. Here are a few of the basic functions and features offered by Mach3:

- Turn a PC into a full-featured 6-axis CNC machine controller.

- Allows direct import of dxf, bmp, jpg and hpgl files through LazyCam software.

- Generating G-code through LazyCam or Wizards.

- The interface can be completely customized according to the preferences of the user.

- Customize M-code and Macro using VBscript.

- Can control many relays on-off.

- Capable of generating manual motor speed control pulses.

- Display video when the machine is running.

- Can be used with touch screen.

- The software interface is capable of displaying any screen in use.

Instructor: Ph.D Tao Ngoc Linh

Fig 4.7 Mach3 CNC Software b, Breakout Board

To link the PC using the professional CNC control software Mach3 to the other components of the CNC control circuitry, we need a breakout board

In the CNC milling machine control system, the connection between the computer and the CNC machine is a very important part Currently, to communicate between CNC machines and computers, they usually communicate via LPT port and USB port Each method of communication has its own advantages and disadvantages.

There are numerous advantages to computer communication circuits via USB ports, including being more modern and easy to communicate with all computers because USB ports are available on all computers However, this communication method has a flaw in that the circuit that converts data from computer instructions is extremely complex and expensive to manufacture.

AKZ250 Motion Board is representative board of BOB Mach3 using USB Port.The AKZ250 board serves as a link between the computer's control software(Mach3 software) and control components including stepper motor drivers and servo

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh drivers It is also in charge of receiving feedback signals from sensors and limit switches and sending them back to the handling software.

Fig 4.8 AKZ250 Motion Board Features of the circuit AKZ250:

- Supports communication with all versions of Mach3 software, including Mach3 version R3.042,040.

- Compatible with Windows2000/XP/Vista/win 7

- No need to install any additional USB drivers for the computer, can be used immediately after plugging in the computer.

Fully compatible with all USB ports, the circuit continuously monitors the USB port's status.

- Compensate for errors and deviations of Mach3 software.

- The maximum oscillation frequency is 200KHz, suitable for Servo motor as well as stepper motor.

- There are LEDs indicating the USB port connection status and the operating status of the circuit.

- There are 16 outputs for different purposes.

Instructor: Ph.D Tao Ngoc Linh

- Feed speed and spindle speed can be controlled by the control knob.

- Powered via USB port, no need for separate power supply.

The AKZ250 circuit is capable of controlling up to 5 coordinate axes Only 4 coordinate axes—X, Y, Z, and A—can be controlled by the counter as it is depicted in the figure The stepper motor and servo motor control on the AKZ250 circuit are supported.

There are explicit annotations on the control signals for each axis—X, Y, Z, and A

—on the circuit board We have two control signals, one of which is a Step pulse signal that is sent to the motor driver to control the motor driver, for each axis The Direct signal is used to regulate the motor's rotational direction in addition to the Motor Speed Control signal Because the output signal from the AKZ250 is merely a control signal with a voltage of 5V, all control signals from the AKZ250 must be routed through the motor driver in order to control the motor.

Here, we choose AKZ250 Motion Board to link PC with the others because of the convenience of USB cable and outstanding features of AKZ250 Board.

Driving System

Stepper motors are widely employed in today's CNC machines Stepper motors provide a number of notable benefits over servo motors, including excellent braking capability, a considerably simpler control scheme, and significantly lower motor and driver costs However, there are still certain drawbacks, such as the inability to precisely adjust speed and position with a servo motor, and the open-loop control of stepper motors, which can result in step loss under excessive load.

Stepper motors are frequently expanded to provide a surplus between the maximum torque required to drive the load and the motor's available torque in order to prevent this issue In addition to the size increase, another way is to add an encoder and run in servo mode, the stepper motor system can monitor and control the position, just like a servo motor.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

In contrast to ordinary motors, stepper motors require the input wires to receive pulses in a certain sequence in order for the motor to function Each stepper motor requires a separate driver in order to be driven and to receive sequential control pulses delivered to the wires.

Stepper motors can't be powered by the same source as regular AC or DC motors

To the inputs of the stator's windings, a consecutive square pulse voltage must be applied.

We need a driver to accomplish that. b, Industrial Step Motor Driver

There are many different types of stepper motor drivers available on the market today, with prices ranging from a few dollars to several hundred dollars from various nations These drivers are created and manufactured particularly for a wide range of 2- phase or 3-phase, bipolar or unipolar steppers.

Instructor: Ph.D Tao Ngoc Linh

Fig 4.10 Professional drivers DM542T of STEPPERONLINE c, Stepper motor driver circuit

Fig 4.11 Stepper motor driver circuit A3967

The low-cost stepper motor driver circuit is used to operate stepper motors, which are found in CNC machines and precision mechanical systems Stepper Motor DriverCircuit for simple and straightforward stepper motor control, compatible with any signal that can generate a digital pulse between 0 and 5V

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

The stepper motor driver module operates on voltages ranging from 7V to 20V, with power supplied to the stepper motor at any level The board has a voltage regulator

IC that allows you to pick the 5V power level MS1 and MS2 were used to select microsteps and alter the resolution of microsteps.

It is suitable for machine learning models, but not for industrial manufacturing.

So we chose industrial step motor driver DM860 of Leadshine for 2 stepper motors in this CNC project.

Fig 4.12 Professional drivers DM860 of Leadshine

Leadshine DM860 stepper motor driver (MA860H Upgrade) is an upgraded version of MA860H with superior IC and DSP processing algorithm for anti-interference ability, stability and low noise (actual testing shows that the noise is low) The noise and vibration of the engine compared to the MA860H is reduced many times, the engine runs smoothly and smoothly), the shape, size, and usage of the DM860 are completely compatible with the old version MA860H.

Leadshine MA860H stepper motor driver is genuine Leadshine used to control 2-phase and 4-phase stepper motors with maximum current up to 7.2A, Driver has good quality, durability and high stability, is the most commonly used type in Laser Cutting machine, CNC machine,

- Automatically adapts to the operating state of the motor.

Instructor: Ph.D Tao Ngoc Linh

- Input pulse up to 300Khz.

- The input signal is 5V-TTL and has Opto isolation.

- 16 micro-step selection modes up to 40000steps/rev.

- Compatible with 2-phase and 4-phase motors.

- Support PUL/DIR or CW/CCW function.

- Short circuit, over current, over voltage protection.

Feedback System

To establish the coordinates of the table and the tool, position measurement equipment is installed on the machine's axes (Example: Position encoder mounted on the machine table to measure the displacement of the table along the X axis ) The CNC control system analyzes the electrical signal that the measuring instruments produce when a machine axis moves in order to calculate the precise coordinates of the machine axes

These instruments measure the displacement distance i.e determine the instantaneous actual coordinates of the coordinate axes The quantities to be measured here are line segments in linear motions and angles in rotations of coordinate axes The output signals of these devices are compared with the position set values, the results are fed into the inputs of the position controller.

There are two types of encoders: rotary encoder and linear encoder.

- Rotary Encoder: A rotary encoder, also called a shaft encoder, is an electro- mechanical device that converts the angular position or motion of a shaft or axle to analog or digital output signals There are two main types of rotary encoder: absolute and incremental The output of an absolute encoder indicates the current shaft position, making it an angle transducer The output of an incremental encoder provides information about the motion of the shaft, which typically is processed elsewhere into information such as position, speed and distance.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

- Linear Encoder: A linear encoder is a sensor, transducer or readhead paired with a scale that encodes position The sensor reads the scale in order to convert the encoded position into an analog or digital signal, which can then be decoded into position by a digital readout (DRO) or motion controller The encoder can be either incremental or absolute Linear encoders are used in metrology instruments, motion systems, inkjet printers and high precision machining tools ranging from digital calipers and coordinate measuring machines to stages, CNC mills, manufacturing gantry tables and semiconductor steppers.

In this project, we choose to use linear encoder to mount on the guide railway of each table X and Y, linear encoder in this case is easier to use and more suitable than rotary encoder b, Switch journey

As a device to protect the machine when the table slips beyond the allowable stroke, when the stroke switch is touched, the external circuit will be disconnected and the table will stop moving, avoiding collisions with other details in the system.

Fig 4.15 Switch journey c, DC Power Supply

Instructor: Ph.D Tao Ngoc Linh

Because the motor used here is a 24VDC Stepper motor, and peripheral devices such as encoder, switch also use 24VDC source, so we select 24V 14.6A Power Supply to supply power to the Stepper Motor and Encoder, Switch Journey.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Complete Circuit

Fig 4.17 Diagram of control system for CNC machine model

- Mach3 software and computer: Acts as a CNC controller, control the whole system.

- AKZ250 buffer circuit: responsible for connecting the controller with control devices.

- Stepper motor and stepper motor driver: Drive the table to form the moving trajectory of the machining head.

- Travel switch: Limits the stroke for the tables to prevent the table from colliding with the supports

- Encoder: feedback signal of the table's displacement to the controller.

- Power: 24VDC power supply for the stepper motor.

Instructor: Ph.D Tao Ngoc Linh

SYSTEM OPERATION SIMULATION WHILE MACHINING IS

Export 3D model files to Matlab

Installing the Simscape Multibodylink inside Matlab from the website, we are allowed to link the Solidworks to Matlab Simscape Open the 3D model of CNC tables in Solidworks and export it to xml file

Import the 3D model to Matlab Simulink by using the command:

In the Simulink window, we obtain a desktop model that includes the following blocks:

Fig 5.2 The table model was exported to the MATLAB and SIMULINK environments.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Simmechanics is a tool of Matlab that allows users to simulate and model mechanical parts, thereby building machine parts and mechanical machines.

The following shows some of the Simechanics libraries used in this project:

Provides access to the world or ground frame, a unique motionless, orthogonal, right-handed coordinate frame predefined in any mechanical model World frame is the ground of all frame networks in a mechanical model.

A model can have multiple World Frame blocks, but all represent the same frame.

Port W is a frame port identified with the world frame Any frame port directly connected to W is also identified with the world frame.

Sets mechanical and simulation parameters that apply to an entire machine, the target machine to which the block is connected In the Properties section below, you can specify uniform gravity for the entire mechanism and also set the linearization delta The linearization delta specifies the perturbation value that is used to compute numerical partial derivatives for linearization.

Port C is frame node that you connect to the target machine by a connection line at any frame node of the machine.

Defines solver settings to use for simulation.

Defines a fixed 3-D rigid transformation between two frames Two components independently specify the translational and rotational parts of the transformation Different translations and rotations can be freely combined.

In the expandable nodes under Properties, choose the type and parameters of the two transformation components.

Ports B and F are frame ports that represent the base and follower frames, respectively The transformation represents the follower frame origin and axis orientation in the base frame.

Instructor: Ph.D Tao Ngoc Linh

Represents a prismatic joint between two frames This joint has one translational degree of freedom represented by one prismatic primitive The joint constrains the follower origin to translate along the base z-axis, while the base and follower axes remain aligned.

In the expandable nodes under Properties, specify the state, actuation method, sensing capabilities, and internal mechanics of the primitives of this joint After you apply these settings, the block displays the corresponding physical signal ports.

Ports B and F are frame ports that represent the base and follower frames, respectively The joint direction is defined by motion of the follower frame relative to the base frame.

Straight line simulation

The straight line is a fairly common machining line on machine tools

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh Algorithm diagram

Bộ điều khiển PID vị trí Y với tham số = 1170, = 8503,48, = 39.83

Bộ điều khiển PID vị trí X với tham số

= Y position PID controller with parameters

X position PID controller with parameters

Instructor: Ph.D Tao Ngoc Linh

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

We have the equation of the line passing through 2 points A(), C().

   Where (x,y) is the coordinate of the tool tip

=> The equation of the line AC is:

To satisfy the conditions of orbit and velocity, we establish the relation x = x(t) as a polynomial of degree 3: x = +.t+.+

From the above formula, we can determine the coefficients a_0= a_1=0; a_2=0.6; a_3=-0.08

By adding the simulating element of the simscape library, like Real-time clock, PID blocks, Function block to enter trajectory equations and the Scopes to display the results.

Instructor: Ph.D Tao Ngoc Linh

Fig 5.3 Simulation graph of toolpath in a straight line on MatLab Simulink

We obtain the simulated trajectory of the machine table as below :

Fig 5.4 Desired trajectory of the table

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 5.5 Actual trajectory of the table

Compared to the expectation trajectory, the trajectory that we obtained, only has a tiny overshoot and at the first 0.2s From then, the signal remains stable, and the table move exactly to the expected point.

Circle line interpolation

When controlling the toolpath in a circular path, the table must perform circular interpolation The curve is divided into short segments and treated as a straight line A circle is a set of straight lines The circle is defined by the coordinates of the center, the radius, and the corresponding rotation angle We have the equation of a circle passing through 2 points A(), C(, taking AC as the diameter with the equation:

Instructor: Ph.D Tao Ngoc Linh Algorithm Diagram:

Set of PID Set of PID

Y position PID controller with parameters

X position PID controller with parameters

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

   is the midpoint of AC

Instructor: Ph.D Tao Ngoc Linh

We write the parametric equation of the circle as follows: sin(a(t)) cos(a(t)) i i x x R y y R

Also to satisfy the conditions of orbit and velocity, we establish the relation x x(t) as a polynomial of degree 3: a(t)= +.t+.+. and must satisfy the condition:

From this we find the coefficients:

Example: Let the tool head run from point A(0,0) to point C(4,4) in time T=4s

From the above formula, we can determine the coefficients :

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Fig 5.6 Simulation graph of toolpath in a circle line on MATLAB Simulink

We get the graph of simulation table X,Y:

Fig 5.7 Desired trajectory of the table

Instructor: Ph.D Tao Ngoc Linh

Fig 5.8 Actual trajectory of the table

Fig 5.9 Motion of each table during operation Y: Right; X: Left

Compared to the expectation trajectory, the trajectory that we obtained has exactly the same trajectory as expected From then, the signal remains stable, and the table move exactly to the expected point.

School of Mechanical Engineering Instructor: Ph.D Tao Ngoc Linh

Project: Designing control system of CNC machine.

The Project ends up with a suitable design control system for the mechanical design that has been done in the Project 1.

Based on the requirements of the project, we can calculate and choose the details and parts used in CNC machine control system:

-Computer and Mach3 software: work as CNC machine controller, control all the system.

-AKZ250 circuit is the connection circuit between the control software (software Mach3) on the computer and control elements

-Step motor and Step motor Driver: Drive the motion of the CNC table to form a moving path of the working spindle.

-Limit Switch: Limit travel for tables to prevent tables collide with supports

- Sensor and encoder: The machine axes are equipped with position and speed measuring devices to determine the coordinates of the table

-Power source: 48V, supply power for the control system

1 Stepper motor NEMA 34HS45-6004S STEPPERONLINE

2 Stepper motor driver DM860 STEPPERONLINE

6 Linear scale encoder KA300-420 SINO

Ngày đăng: 13/06/2024, 16:52

w