Design and Implementation of CNC Operator Panel Control Functions Based on CPLD. Huaqun Zhan, Bin Xu

Similar documents
Applied mechanics and applied technology in fuel injection pump bench. Rotational speed measurement system design based on CPLD

The Design of CAN Bus Communication System Based on MCP2515 and S3C2440 Jinmei Liu, Junhong Wang, Donghui Sun

A design of real-time image processing platform based on TMS320C6678

Design and Research of Virtual Instrument Development Board

Design and Implementation of LED Display Screen Controller based on STM32 and FPGA Chi Zhang 1,a, Xiaoguang Wu 1,b and Chengjun Zhang 1,c

Design And Implementation Of USART IP Soft Core Based On DMA Mode

The Analysis and Research of IPTV Set-top Box System. Fangyan Bai 1, Qi Sun 2

Based on a Single Chip Microcomputer to Realize Electronic Clock Design and Analysis

Efficient VLSI Huffman encoder implementation and its application in high rate serial data encoding

The Design of Distributed File System Based on HDFS Yannan Wang 1, a, Shudong Zhang 2, b, Hui Liu 3, c

International Conference on Information Sciences, Machinery, Materials and Energy (ICISMME 2015)

The IIC interface based on ATmega8 realizes the applications of PS/2 keyboard/mouse in the system

The Application of Programmable Controller to Chip Design. Shihong Lan 1, Jian Zhang 2

The Design of the Sensor Node of IOT Based on SIM20 KUANG Xinghong 1, a,yao Zheyi 1, b, Huo haibo 1, c, Li junjun 1, d, Wu yanxiang 1, e

Design and Implementation of MP3 Player Based on FPGA Dezheng Sun

Study and Design of CAN / LIN Hybrid Network of Automotive Body. Peng Huang

Design of the Software for Wirelessly Intercepting Voices

Serial Communication Based on LabVIEW for the Development of an ECG Monitor

EITF35 - Introduction to the Structured VLSI Design (Fall 2016) Interfacing Keyboard with FPGA Board. (FPGA Interfacing) Teacher: Dr.

Design and Implementation of Hamming Code on FPGA using Verilog

High Speed SPI Slave Implementation in FPGA using Verilog HDL

Design of a Wireless Laser Pointer Based on MCU

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Field Programmable Gate Array Application for Decoding IRIG-B Time Code

Marine fuel boiler system design platform. Hou Ying-ying

AN WIRELESS COLLECTION AND MONITORING SYSTEM DESIGN BASED ON ARDUINO. Lu Shaokun 1,e*

Research and Implementation of Message Queue on Key Event Processing

Deduction and Logic Implementation of the Fractal Scan Algorithm

The Design of Electronic Color Screen Based on Proteus Visual Designer Ting-Yu HOU 1,a, Hao LIU 2,b,*

The Design of Wireless Data Collector based on WIA-PA Ligang Li 1,2,a, Zhongfeng Wang 1,2,b, Jianlong Huang 1,2,c

Research on Full-text Retrieval based on Lucene in Enterprise Content Management System Lixin Xu 1, a, XiaoLin Fu 2, b, Chunhua Zhang 1, c

Rensselaer Polytechnic Institute Computer Hardware Design ECSE Lab Assignment 3 Altera Richards Controller and Logic Analyzer Laboratory Rev.

, ,China. Keywords: CAN BUS,Environmental Factors,Data Collection,Roll Call.

Realization of Automatic Keystone Correction for Smart mini Projector Projection Screen

Tutorial for I 2 C Serial Protocol

Open Access A New Optical Design of Worm Precision Detection Based on FPGA

ENEE 245 Lab 1 Report Rubrics

Research on the Application of Digital Images Based on the Computer Graphics. Jing Li 1, Bin Hu 2

Construction of the Library Management System Based on Data Warehouse and OLAP Maoli Xu 1, a, Xiuying Li 2,b

Research Of Data Model In Engineering Flight Simulation Platform Based On Meta-Data Liu Jinxin 1,a, Xu Hong 1,b, Shen Weiqun 2,c

Programmable Logic controller (PLC) in computer Numerical control (CNC) machine

Research on Embedded CNC Device Based on ARM and FPGA

Design and Verification of Serial Peripheral Interface 1 Ananthula Srinivas, 2 M.Kiran Kumar, 3 Jugal Kishore Bhandari

Study of Smart Home System based on Zigbee Wireless Sensor System. Jie Huang 1

An Efficient Designing of I2C Bus Controller Using Verilog

Pong. CSEE 4840 Spring 2012 Project Deisgn. 1 Introduction. Bo Li(bl2438) Jihong Zou (jz2428) Cong Liu (cl2991) Zuyang Cao (zc2220)

PSIM Tutorial. How to Use SPI in F2833x Target. February Powersim Inc.

Design and Implementation of unified Identity Authentication System Based on LDAP in Digital Campus

Design of the Refueling Card Information Transmission System Based On DTMF

ENEE245 Digital Circuits and Systems Lab Manual

Improved DDA Algorithm and FPGA Implementation Yi-Xuan WANG a, Quan-Gang WEN b, He YIN c, Zhi-Gang HAO, Xin-Zheng DONG

Research of 3D parametric design system of worm drive based on Pro/E. Hongbin Niu a, Xiaohua Li b

Design of analog acquisition and storage system about airborne flight data recorder

MICROCONTROLLER S PROGRAMMER

Design of Bicycle mileage Speed Meter

Lab 1: Verilog Synthesis and FSMs

A Low Power DDR SDRAM Controller Design P.Anup, R.Ramana Reddy

Field Programmable Gate Array

Hello, and welcome to this presentation of the STM32 I²C interface. It covers the main features of this communication interface, which is widely used

Building Data Path for the Custom Instruction. Yong ZHU *

Laboratory Exercise 3

Study of LED Electronic Writing Screen based on Single Chip Dengjin Wu 1

Design and Simulation of UART for Serial Communication

Unlocking the Potential of Your Microcontroller

Implementation of Hamming code using VLSI

Laboratory Exercise 7

PERFORMANCE OF DMA MODE UART IP SOFT CORE IN EMBEDDED SYSTEMS

ENEE245 Digital Circuits and Systems Lab Manual

The Design and Implementation of the Unmanned Vehicle Fixed-point Tracking System Liang-liang CHEN, Yu-ying LIU and Chun ZHAN

Rensselaer Polytechnic Institute Computer Hardware Design ECSE 4770

ChipScope Demo Instructions

Digital Design and Computer Architecture

Design of the Control System for Step Motor Based on MCU

FPGA Interfacing of HD44780 Based LCD Using Delayed Finite State Machine (FSM)

Chapter 13 Programmable Logic Device Architectures

2.5G Reed-Solomon II MegaCore Function Reference Design

ECE 353 Lab 3. MIDI Note Number Display. Lab Info. Electrical and Computer Engineering

Design and Application of a Reconfigurable Embedded system

DESIGNING OF INTER INTEGRATED CIRCUIT USING VERILOG

Hardware-configuration based on FPGA for open CNC system

A Tentative Study on Ward Monitoring System based on Zigbee Technology Jifeng Liang

Fully Integrated Thermal Accelerometer MXC6225XU

The Design of the Embedded WEB Server Based on ENC28J60

International Journal of Advance Engineering and Research Development DESIGN AND IMPLEMENTATION OF SPI PROTOCOL

A Template-Matching-Based Fast Algorithm for PCB Components Detection Haiming Yin

A Half-duplex Synchronous Serial Fieldbus S 2 CAN with Multi-host Structure

System Verification of Hardware Optimization Based on Edge Detection

The Design of Embedded MCU Network Measure and Control System

Intelligent Pressure Measuring System

Prepayment Electric Energy Meter with Multi-functional for Multi-user based on STC11F52XE Sun Wei 1,a and Tuo Jianzhi 1,b

< W3150A+ / W5100 Application Note for SPI >

Utilizing Restricted Direction Strategy and Binary Heap Technology to Optimize Dijkstra Algorithm in WebGIS

PREFACE. Changes to the SOPC Edition

Improvement of the Communication Protocol Conversion Equipment Based on Embedded Multi-MCU and μc/os-ii

Implementation of Convolution Encoder and Viterbi Decoder Using Verilog

Human heart rate detector based on photoelectric volume

FPGA IMPLEMENTATION OF A PROCESSOR THROUGH VERILOG

A Digital Menu System Based on the Cloud client Technology Lin Dong 1, a, Weibo Li 1, b, Ping He 2,c,Jia Liu 1,d

Matrix Manipulation Using High Computing Field Programmable Gate Arrays

PCI to SH-3 AN Hitachi SH3 to PCI bus

Transcription:

Advanced Materials Research Online: 2013-07-31 ISSN: 1662-8985, Vol. 722, pp 428-432 doi:10.4028/www.scientific.net/amr.722.428 2013 Trans Tech Publications, Switzerland Design and Implementation of CNC Operator Panel Control Functions Based on CPLD Huaqun Zhan, Bin Xu College of Communication and Electronics, Jiangxi Science & Technology Normal University, Nanchang, China email: 1666736703@qq.com Keywords: CNC Operator Panel; CPLD; Keyboard scan; Serial communication; Hand wheel; 5M1270ZT144 Abstract. Method of CNC operator panel control functions are introduced in this thesis, which is based on CPLD. First, the paper indicates the theory of system works and the overall structure; second, the thesis mainly introduces the implementation of the keyboard scan, the function of hand wheel and serial communication; Last but not least, the correct simulation results are given as well. The MAX V chip of ALTERA is used in this program, 144 IO ports can be processed at most. It is an effective solution to process lots of IO ports and the problem of hardware space limited. Introduction CNC operator panel is an important component of CNC machine tools, which is the communication tool of operators and CNC machine tools. CNC operator panel can be used by operators to operate CNC machine tools: programming, debugging, setting and modifying the machine parameters, Operators can also grasp and query the operating state of the CNC machine tools.cnc operator panel is the specific input and output member of the CNC machine tools. It is composed of display device, NC keyboard (similar to a computer keyboard keys), machine control panel (MCP), and hand wheel etc. Figure 1.Appearance of CNC operation panel Figure 1 is CNC operator panel. It includes 45 keys of machine control panel, 43 LEDs, two knobs override switch (spindle override switch, cutting feed rate switch), a hand wheel, and the 5 direct connecting switch (start, pause, etc.). If all functions use MCU to achieve, then, large-scale expansion of the peripheral interface circuit is needed, this method not only takes up more hardware resources, increases costs, but also the whole circuit is so bulky and cannot layout all elements on CNC operator panel circuit board. But CPLD is complex programmable logic device; it can replace dozens even hundreds of blocks of common IC chips. CPLD has programmable capabilities, its implementation is easy to change, and the pin attributes can be definition. To sum up, this paper uses CPLD which has high cost-effective to implementation of keyboard scan, the driver of LEDs and knobs override switch processing and serial communication with the host computer etc. The theory of system working and overall structure The whole system is divided into two parts of peripheral interface circuit and control circuit of CPLD driver. Figure 2 is hardware block diagram of system. Peripheral interface circuit is comprised of keyboard matrix circuit which has 8 rows and 10 columns, direct connecting switch All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of Trans Tech Publications, www.ttp.net. (#69804889, Pennsylvania State University, University Park, USA-17/09/16,22:14:07)

Advanced Materials Research Vol. 722 429 circuit, the circuit of LEDs driver etc.. Control circuit of CPLD driver in Figure 2 is composed of keyboard scan circuit, the circuit of LEDs driver, the circuit of knobs override switch and the circuit of serial communication etc.. The control functions of CPLD is summarized as follows: 1.Access to outside information, including: the information of keyboard scan, the coding information of two knobs override switch; the information of hand wheel; 2.Though the circuit of scanning, the information obtained is send to the host computer by serial transmission mode, then the information is processed by the host computer; 3.The result of processing by the host computer which is send to the CPLD by differential lines, Using the internal of CPLD which has 8 rows and 10 columns keyboard scan circuit to drive the signal of 43 LEDs. Among all IO ports, Keyboard scan circuit and knobs switch circuit are occupied 21 IO ports, the circuit of LEDs driver is occupied 18 IO ports, direct connecting switch occupied 15 IO ports, and serial communication needs 4 IO ports. This paper uses the chip 5M1270ZT144 of MAX V, the device offers 144 programmable IO pins, it offers 1270 Les,980 typical equivalent macrocells and 127 LABs, it has ISP Programming capability as well. Therefore, one chip can meet the requirements which system needs lots of IO ports and more macrocells, Do not need another chip. Figure 2. System block diagram Specific methods of the CPLD control functions The implementation of keyboard scan In order to achieve the matrix keyboard scan circuit which have 8 rows and 10 columns? First, the system clock gets 78 KHZ clock by frequency dividing circuit, this clock is called clk_scan which seen as a key trigger clock. When on the rising edge of clk_scan, by coding, controlling each of the column lines which pull down one by one to achieve the function of keyboard scan. When no key is pressed, each of the column lines keep HIGH, when a key is pressed, the column line where the key located is LOW, At the same time, reading row lines information and sending the information to serial communication module so as to communicate with the host computer. The function of hand wheel The full name of hand wheel is manual pulse generator, also known as the photoelectric encoder. In this paper, hand wheel primarily used to control the X, Y, Z and 4th axis of CNC machine tools. as Figure 3 shown, the hand wheel in the CNC operator panel has a relationship as follows: On the CNC operator panel, hand wheel connection lines marked with A, B. Phase A and Phase B are quadrature pulse signal. Difference between the two is 90 degrees. When hand wheel counterclockwise rotation, phase A lead phase B 90 degrees(phase A is rising edge when Phase B is LOW), and accumulator(cnt_mpg )is counted once as long as there is a edge between phase A and phase B(Either rising edge or falling edge),when hand wheel counterclockwise rotation, cnt_mpg minus 1.When hand wheel clockwise rotation, phase B lead phase A 90 degrees(phase B is rising edge when Phase A is LOW), and accumulator(cnt_mpg)is counted once as long as there is a edge between phase A and phase B(Either rising edge or falling edge),when hand wheel clockwise rotation, cnt_mpg plus 1.One circle in hand wheel is divided into 10 files(0-90),a total of 200 pulses.

430 Optical, Electronic Materials and Applications IV Figure 3.The phase relationship schematic diagram of hand wheel Figure 3 shows the key point of the coding is both phase A and phase B sampling data twice (Simultaneous Sampling),then make the 4 data splice together. One situation is Phase A sampled data are 0 and 1, when hand wheel counterclockwise rotation, phase B sampled data are 0 and 0, therefore the 4 data is 0,1,0,0, written as 4'b0100.By the relationship: When hand wheel counterclockwise rotation, cnt_mpg minus 1.Another situation is phase A sampled data are 0 and 1,when hand wheel clockwise rotation, phase B sampled data are 1 and 1,therefore the 4 data is 0,1,1,1, written as 4'b0111.By the relationship as well: When hand wheel clockwise rotation, cnt_mpg plus 1.The rest can be done in the same manner, a total of 8 kinds of situations. Figure 4 is part of the coding. The function of hand wheel can be realized by the above. Figure 4. Part of the coding of hand wheel The method of serial communication CPLD exchange information with the host computer includes: the information of keyboard scan, the coding information of direct connecting switch, the information of hand wheel and the driver information of LEDs. Since a large amount of information to transmission, therefore, using the differential transport protocol based on the standard RS-422. The protocol has the following features: 1.High-rate 1.25MHz; 2. Hamming code error correction; 3. automatically detect the device. The protocol uses a Master-Slave communication, Master device is the host computer, and Slave device is the CNC operator panel. There are three pairs of differential lines to transmit information: one pair transmits clock information from master device, one pair transmits data from master device, and another pair transmits data from slave device to master device. The data output line of slave device must have a tri-state output enable. The work of master device, master device transmits clock signal by frame. The clock frequency is 1.25MHz. Beginning of each frame, clock line remain LOW for four clock cycles which marked a frame start signal, written as 3.2 µs. Continuous send 60 clock cycles. Master device transmits 60 bits data to slave device and slave device transmits 54 bits data to master device during the 60 clock cycles, Figure 5 shows CPLD can communicate with the host computer through this protocol. Figure 5. Protocol of serial communication Note: See Figure 5, From the top to down, the first line is frequency dividing clock signal; the second line is a data signal which from master device to slave device; the third line is a data signal which from slave device to master device. There are 60 bits data from master device to slave device: 60 bits data=2 start bits(01)+ 4 address bits(the address of slave device)+4 synchronization

Advanced Materials Research Vol. 722 431 bits(0101) +8 alternate data bits+38 Hamming code bits+4 end bits(0101). There are 54 bits data from slave device to master device: 54 bits data=4 acknowledge bits+8 alternate data bits+38 Hamming code bits+4 end bits(0101). The results of simulation This paper is given a correct simulation results which includes the simulation of keyboard scan and the function of hand wheel. The code is used Verilog HDL language, Simulation is used Modelsim 6.6d. Figure 6 shows a simulation result of the keyboard scan. LEDs scanning circuit law is similar to keyboard scan, Simulation results will not repeat here. Figure 6.Keyboard scan simulation Note: See Figure 6, The first line is the signal of system clock; the second line is the signal of reset, LOW active; the third line is the signal of divided counter; the fourth line is the signal of frequency dividing clock; the fifth line is the signal of scan counter(from 0 to 9); the sixth line is the signal of scanned column, scanning column by column(low indicates a key pressed), a total of 10 columns. Seen from the Figure 6,if the counter is 0, then the next clock cycle, the 10 columns is 1111111110, and if the counter is 1, then the next clock cycle, the 10 columns is 1111111101,the rest can be done in the same manner; the seventh line is the signal of scanned row. Seen from the simulation results, the function of keyboard scan achieved the design goals. As Figure 7 shown, the waveform is measured by digital oscilloscope when hand wheel clockwise rotation, measuring the waveform when hand wheel counterclockwise rotation is similar to clockwise rotation, Simulation results will not repeat here. Figure 7. The diagram of hand wheel function Note: Seen Figure 7, From the top to down, The first line is the signal of phase A; the second line is the signal of phase B; Figure 7 shows phase B lead phase A 90 degrees, it is the waveform when hand wheel clockwise rotation. Therefore, the code achieved the requirements. Conclusion Since CNC operator panel needs lots of IO ports and the hardware space is limited. This paper uses one complex programmable logic device (CPLD).it can realize keyboard scan, the driver of LEDs and communicate with the host computer. This thesis is given a correct simulation results about

432 Optical, Electronic Materials and Applications IV some module as well. Currently, CNC operator panel that based on CPLD is applied to some packers. From those packers, CNC operator panel get a good evaluation and have a larger practical application value. Acknowledgment First, I would like to extend my thanks to my tutor, Mr. Zhan, who gave me numerous encouragements and help. Second, I also want to thank my beloved girlfriend Miss. Zeng. Without their generous advices and supports, this paper cannot be accomplished. Thanks very much. References [1] Song Pan, Jiye Huang. Practical course of EDA technology [M]. Science Publishing House, 2006. [2] Ing Zhang, Lisong Wang etc.. Method of CNC operator panel control function based on CPLD [EB/OL]. Control &Detection, 2008. [3] Zhihui Wang, Shuisheng Lin. Design and Implementation of keyboard scan module based on FPGA [J]. International Electronic Elements, 2006. [4] Yihong Wang, Zhitong Chen. Realization of hand wheel function of CNC machine tools based on PMAC [J]. Mechanical Engineers, 2005. [5] Guotao Fang. Hamming code encoding and decoding system based on FPGA [J]. IT Magazine, 2010. [6] Tao Liu, Xing Hua. FPGA digital electronic system design and development examples navigation [M]. The People's Posts and Telecommunications Press(Posts & Telecom Press), 2005. [7] Song Pan etc.. Practical course of EDA technology: Verilog HDL version (Fourth version) [M]. Science Publishing House, 2010.