LINUX CNC: basic540, 4 axes, EMC2 + AXIS
Linux CNC, using realtime linux and AXIS (Python, TKinter) user interface.
วันพฤหัสบดีที่ 4 กันยายน พ.ศ. 2551
วันจันทร์ที่ 8 ตุลาคม พ.ศ. 2550
My electronic experience
Somehow and somewhat, I graduted for an electical (communicaion) engineer. For now, I 'm a web developer.
To remember what I have done, it is a good chance to summasize here.
1. A robot arm using servo motor and AVR microcontroller, a student traning project.

2. A robot arm using DC motor and microcontroller, a graduate project.
-Comming soon,
3. A roller break tester project, my old company work.
3. A roller break tester project, my old company work.
5.ARM7,
6. ARM9,An Embedded Linux Project, my another old company work.

วันพุธที่ 3 ตุลาคม พ.ศ. 2550
Computur Numerical Control Using Open Source Software
This is my old work. It had built one year ago while I was working for CNC company. Details are following;
Hardware















Hardware
- Machine Type, 3 axis milling
- Servo drive and motor, Panasonic servo dirver and motor
- Spindle, Hitachi 3 phase AC motor
- Interfacing, PCI Motenc-100
- Computer, P4 2.8GHZ (Socket 478), 512 RAM, ATI9600 GRAPHIC, 40 GB IDE Harddisk
Software
- Operating system, Linux TLE 7.0 (waghor, FC3 base) with RTAI real-time extension
- CNC controller, Enhancement Machine Controller, EMC
- HAL Configuration, HAL for motenc-100
- GUI (MMI), AXIS, TKInter with extension module
Images















วันอาทิตย์ที่ 30 กันยายน พ.ศ. 2550
Motion Control System-Hardware
A motion control system consist of two major part, are following;
A position controller, is mainly consist of hardware box. There are two types of position controller, a open and close loop position controller.
Open loop position control
Like its name, this controller need not a feedback device. A rotation has a pre-define, certain amount of traveling. This mean, with a one command, a device will travel with one position unit.
A block diagram of system is shown below,

Example of this kind of device is stepper motor controller system. see picture below,

Close loop position control
A block diagram is shown below,

It has a PID calculator, a driver and a feedback device. An big advantage of close loop over open loop is, close loop has an error detection device and use that device as a part of controlling. Some open loop system has an error detector but use to indicate or stop operation if a system enter an position error that cannot acceptable.
Servo motor and Servo driver .
An industrial market has introduced a device used to control a motion of object that is attached to it, that device is consist of a motor and a drive system to be convenient and flexible to build or fix a machine. There is invention a servo motor and servo driver.
Actually, server motor and servo drive has to work together to provide ability to control a motion of object attach to it. Anyway, it was separated a driver and motor because it is easy to upgrade, fix only a driver or motor. Need not to change both of them.

Picture below show a categorize of server system.

Feedback device.
For a close loop control system, it has to has a feedback device. It tells a system how much actual position differ from a desire command. There are two types of feedback device, analog and digital feedback device.
- Position command generator. A machine reads command from its storage and interprets into a format compatibly with a controller. Usually, there are two types of path that machine has to be able to traveling, straight line motion (linear) and circular motion. After machine knows what is a motion type, it send a motion information to its interpolation, a system that take a path conformations and feed a position controller a position that motor have to rotate to at given time.
- Position Controller. A sub-system that receives a position command and driver a motion to that position.
A position controller, is mainly consist of hardware box. There are two types of position controller, a open and close loop position controller.
Open loop position control
Like its name, this controller need not a feedback device. A rotation has a pre-define, certain amount of traveling. This mean, with a one command, a device will travel with one position unit.
A block diagram of system is shown below,

Example of this kind of device is stepper motor controller system. see picture below,

Close loop position control
A block diagram is shown below,

It has a PID calculator, a driver and a feedback device. An big advantage of close loop over open loop is, close loop has an error detection device and use that device as a part of controlling. Some open loop system has an error detector but use to indicate or stop operation if a system enter an position error that cannot acceptable.
Servo motor and Servo driver .
An industrial market has introduced a device used to control a motion of object that is attached to it, that device is consist of a motor and a drive system to be convenient and flexible to build or fix a machine. There is invention a servo motor and servo driver.
Actually, server motor and servo drive has to work together to provide ability to control a motion of object attach to it. Anyway, it was separated a driver and motor because it is easy to upgrade, fix only a driver or motor. Need not to change both of them.

Picture below show a categorize of server system.

Feedback device.
For a close loop control system, it has to has a feedback device. It tells a system how much actual position differ from a desire command. There are two types of feedback device, analog and digital feedback device.
- Analog feedback device. Use with analog control system. It can be used with digital system by integrate with analog to digital converter. Usually convert a distance to electrical signal, a voltage or current. Example of this device,
- Potentiometer
- Tachometer
- Digital feedback device. Use with digital control system. With more accurate and good noise rejection. A digital feedback device is widely use more than an analog. These device, topically use an optical technique. Example of device.
- Absolute encoder
- Give a certain position for any movement. Is used for a short distance of movement.
- Incremental encoder
Motion Control System-Introduction
Introduction
Motion control system is, ability to control how objects move. In mechanical points of views, is ability to control position, velocity and acceleration of an object. In modern industrial machine, it has ability to control derivative of acceleration of an object.
To control object acceleration, we have to have a method to control its velocity. To control object velocity, we have to have ability to control its position. Therefor, a position control is a basic and key of motion control.
To control a position of an object. We can use a simple feedback control system. In face, it is not the best method to control an object. To control an object with optimum
efficiency, we can use an state equation to control an object. The state equation is, a mathematic model use to drescript an object. Unfortunately, it is inconvenient to determine equation for any object. The simple feedback control so, is widely used in industrial machine.
The feedback control system control an object by attempts to correct the error between a measured process variable and a desired setpoint by calculating and then outputting a corrective action that can adjust the process accordingly.
PID Controller.
There are three term for this kind of controlling.
A model of controlling is shown below.
Equation in continuous form,

Equation in discrete form,

To calculate this equation, we use a microprocess, or integrate circuit, for example Micro controller, FPGA, CPLD, DSP or even a personal computer.
Please note that, from equation, we need to have a precise sampling timer. To accomplish this, we use a chip or computer with real-time operating system.
Motor
To move an object. We use energy transformation. For a machine, electric energy is more reasonable more than any kind of energy because its flexibility. Another device use to move an object include pneumatic or hydraulic system.
Motor is a device use to convert electrical to mechanical energy. There two (major) of motor.
Motion control system is, ability to control how objects move. In mechanical points of views, is ability to control position, velocity and acceleration of an object. In modern industrial machine, it has ability to control derivative of acceleration of an object.
To control object acceleration, we have to have a method to control its velocity. To control object velocity, we have to have ability to control its position. Therefor, a position control is a basic and key of motion control.
To control a position of an object. We can use a simple feedback control system. In face, it is not the best method to control an object. To control an object with optimum
efficiency, we can use an state equation to control an object. The state equation is, a mathematic model use to drescript an object. Unfortunately, it is inconvenient to determine equation for any object. The simple feedback control so, is widely used in industrial machine.
The feedback control system control an object by attempts to correct the error between a measured process variable and a desired setpoint by calculating and then outputting a corrective action that can adjust the process accordingly.
PID Controller.
There are three term for this kind of controlling.
- Proportional term
- Integral term
- Derivative term
A model of controlling is shown below.
Equation in continuous form,

Equation in discrete form,

To calculate this equation, we use a microprocess, or integrate circuit, for example Micro controller, FPGA, CPLD, DSP or even a personal computer.
Please note that, from equation, we need to have a precise sampling timer. To accomplish this, we use a chip or computer with real-time operating system.
Motor
To move an object. We use energy transformation. For a machine, electric energy is more reasonable more than any kind of energy because its flexibility. Another device use to move an object include pneumatic or hydraulic system.
Motor is a device use to convert electrical to mechanical energy. There two (major) of motor.
- DC Motor, use DC electric current to rotate motor.
- AC Motor, use AC electric current to rotate motor.
- Pulse Motor, use pulse shape electric current to rotate motor.
Controller and Driver device.
Topically, we need a large size of motor, depend on how large machine is and how good we like motor to move. To control a motor, we need a control circuit, to calculate a control signal. To calculate a control signal, we need a measuring unit, to read a real position of motor. A desire position and real position will be compute together and result in a control signal.
A control signal is small level of amplitude. We heed to scale it up to be able to rotate a motor.
Servo motor, Servo drive.
Topically, we need a large size of motor, depend on how large machine is and how good we like motor to move. To control a motor, we need a control circuit, to calculate a control signal. To calculate a control signal, we need a measuring unit, to read a real position of motor. A desire position and real position will be compute together and result in a control signal.
A control signal is small level of amplitude. We heed to scale it up to be able to rotate a motor.
Servo motor, Servo drive.
Because widely use of motion control machine. There is a new set of position controller, which include motor, controller , driver and feedback device. This kind of device is called servo motor.
Actually, for a modern servo motor, it has ability to do motion control as well. But for a machine, let a machine controller generates a position command is more effective.

Motion kinematics
Because machine has a large size. A movement of objects is something have to be take care. We apply a large size of force, a movement can damage a device because its inertia. Movement of object is shown below;

From picture, we like a small number of response time of machine to reach a destination, a little steady-state error and overshoot.
Typically, getting all of above need a fine tune of a controller. Sometime, we have to compromise all of them.
Position command generation
Actually, for a modern servo motor, it has ability to do motion control as well. But for a machine, let a machine controller generates a position command is more effective.

Motion kinematics
Because machine has a large size. A movement of objects is something have to be take care. We apply a large size of force, a movement can damage a device because its inertia. Movement of object is shown below;

From picture, we like a small number of response time of machine to reach a destination, a little steady-state error and overshoot.
Typically, getting all of above need a fine tune of a controller. Sometime, we have to compromise all of them.
Position command generation
As I mention above, to get a desire object acceleration, we have to have ability to control object 's velocity. To get a desire object's velocity, we have to ability to control object position.
In reverse, to control machine acceleration, we have to control its velocity. To control object velocity, we have to control its position.
In mathematic point of view, an acceleration is derivative of velocity and velocity is derivative of position. In reverse case, a position is integral of velocity and velocity is integral of acceleration.
For machine, it has a code that operator can use to control a machine. A code will be translated to position command and send to movement device.
Motion profile.
A motion profile is relative of position and velocity and acceleration at a given time. For a market machine, a third order polynomial is widely used to generate a motion profile. For a high-precision machine, a five order polynomial is used to gain a more smooth and more accurate of movement.
Below is motion profile graph,
Third order, Tapezoidal velocity profile

Fifth order, S-curve velocity profile

In reverse, to control machine acceleration, we have to control its velocity. To control object velocity, we have to control its position.
In mathematic point of view, an acceleration is derivative of velocity and velocity is derivative of position. In reverse case, a position is integral of velocity and velocity is integral of acceleration.
For machine, it has a code that operator can use to control a machine. A code will be translated to position command and send to movement device.
Motion profile.
A motion profile is relative of position and velocity and acceleration at a given time. For a market machine, a third order polynomial is widely used to generate a motion profile. For a high-precision machine, a five order polynomial is used to gain a more smooth and more accurate of movement.
Below is motion profile graph,
Third order, Tapezoidal velocity profile

Fifth order, S-curve velocity profile

สมัครสมาชิก:
บทความ (Atom)
This website is about cnc (Computer Numerical Control). There are many subjects on cnc, motion control is the basic of this kind of this machine. The motion control is consists of command intrepreter, path generation and motion control. In order to build some motion control system,you need a real-time system including another non-realtime work together , graphic user interface, file handling, Input/ Output control. A system that meet these requirement may be a group of many processor module running it job, and work together, or you can build this system using single cpu and real-time operating system
The author would like to share knowledge about cnc technology. In the beginning of learning, it very hard to find any reference for cnc development. The real-time os play an important role in electronic and computing industrial. You can reserse real-time behavious for time-critical and display the system status in the same time using only single cpu ;) Today, professional embedded system is mainly implemented using rtos (or embedded operating system) .
The author would like to share knowledge about cnc technology. In the beginning of learning, it very hard to find any reference for cnc development. The real-time os play an important role in electronic and computing industrial. You can reserse real-time behavious for time-critical and display the system status in the same time using only single cpu ;) Today, professional embedded system is mainly implemented using rtos (or embedded operating system) .




