CN111026041B - Reconfigurable system and reconfigurable method for multi-axis linkage numerical control - Google Patents

Reconfigurable system and reconfigurable method for multi-axis linkage numerical control Download PDF

Info

Publication number
CN111026041B
CN111026041B CN201911403078.7A CN201911403078A CN111026041B CN 111026041 B CN111026041 B CN 111026041B CN 201911403078 A CN201911403078 A CN 201911403078A CN 111026041 B CN111026041 B CN 111026041B
Authority
CN
China
Prior art keywords
motion
instruction
control
byte
speed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911403078.7A
Other languages
Chinese (zh)
Other versions
CN111026041A (en
Inventor
张建华
李鲁
林健
葛红宇
俞耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Institute of Technology
Original Assignee
Nanjing Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Institute of Technology filed Critical Nanjing Institute of Technology
Priority to CN201911403078.7A priority Critical patent/CN111026041B/en
Publication of CN111026041A publication Critical patent/CN111026041A/en
Application granted granted Critical
Publication of CN111026041B publication Critical patent/CN111026041B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/414Structure of the control system, e.g. common controller or multiprocessor systems, interface to servo, programmable interface controller
    • G05B19/4142Structure of the control system, e.g. common controller or multiprocessor systems, interface to servo, programmable interface controller characterised by the use of a microprocessor
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B22CASTING; POWDER METALLURGY
    • B22FWORKING METALLIC POWDER; MANUFACTURE OF ARTICLES FROM METALLIC POWDER; MAKING METALLIC POWDER; APPARATUS OR DEVICES SPECIALLY ADAPTED FOR METALLIC POWDER
    • B22F10/00Additive manufacturing of workpieces or articles from metallic powder
    • B22F10/10Formation of a green body
    • B22F10/18Formation of a green body by mixing binder with metal in filament form, e.g. fused filament fabrication [FFF]
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B22CASTING; POWDER METALLURGY
    • B22FWORKING METALLIC POWDER; MANUFACTURE OF ARTICLES FROM METALLIC POWDER; MAKING METALLIC POWDER; APPARATUS OR DEVICES SPECIALLY ADAPTED FOR METALLIC POWDER
    • B22F10/00Additive manufacturing of workpieces or articles from metallic powder
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B22CASTING; POWDER METALLURGY
    • B22FWORKING METALLIC POWDER; MANUFACTURE OF ARTICLES FROM METALLIC POWDER; MAKING METALLIC POWDER; APPARATUS OR DEVICES SPECIALLY ADAPTED FOR METALLIC POWDER
    • B22F10/00Additive manufacturing of workpieces or articles from metallic powder
    • B22F10/80Data acquisition or data processing
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B33ADDITIVE MANUFACTURING TECHNOLOGY
    • B33YADDITIVE MANUFACTURING, i.e. MANUFACTURING OF THREE-DIMENSIONAL [3-D] OBJECTS BY ADDITIVE DEPOSITION, ADDITIVE AGGLOMERATION OR ADDITIVE LAYERING, e.g. BY 3-D PRINTING, STEREOLITHOGRAPHY OR SELECTIVE LASER SINTERING
    • B33Y50/00Data acquisition or data processing for additive manufacturing
    • B33Y50/02Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B22CASTING; POWDER METALLURGY
    • B22FWORKING METALLIC POWDER; MANUFACTURE OF ARTICLES FROM METALLIC POWDER; MAKING METALLIC POWDER; APPARATUS OR DEVICES SPECIALLY ADAPTED FOR METALLIC POWDER
    • B22F10/00Additive manufacturing of workpieces or articles from metallic powder
    • B22F10/10Formation of a green body
    • B22F10/12Formation of a green body by photopolymerisation, e.g. stereolithography [SLA] or digital light processing [DLP]
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/34Director, elements to supervisory
    • G05B2219/34013Servocontroller
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P10/00Technologies related to metal processing
    • Y02P10/25Process efficiency
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Chemical & Material Sciences (AREA)
  • Materials Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)

Abstract

A reconfigurable system for multi-axis linkage numerical control comprises an upper control system, a lower control system and a controlled object; the basic logic structure unit of the control application-specific integrated circuit comprises: an SPI reading module SpiRd, an SPI writing module SpiWr, an instruction decoding module DecInstr, a PWM output control module U1PwmDrv, an AD acquisition conversion control module U0MaxDrv, a switching value output module DigOutP, a switching value input module DigInP, a motion instruction queue module mInstr, a motion instruction execution control module ExeInst, and: XYZ three-axis feeding motion control module U X MtDrv、U Y MtDrv、U Z MtDrv or X/Y/Z/X1/Y1/Z1/W1 seven-axis motion control module U 0 MtDrv~U 6 MtDrv. The system reconstruction method selects 1 or more modules according to the system requirements when constructing the system, and controls the modules by combining the motion characteristics of the controlled object.

Description

Reconfigurable system and reconfigurable method for multi-axis linkage numerical control
Technical Field
The technical scheme belongs to the technical field of numerical control, and particularly relates to a system reconstruction method and a reconfigurable industrial control system for multi-axis linkage economic numerical control.
Background
The three-dimensional printing is based on the concept of discrete-accumulation, the spatial three-dimensional shape is realized by processing a two-dimensional layer, the processing difficulty of a complex three-dimensional structure can be greatly reduced, and the method is an important research content in the current manufacturing field. High-performance processing control methods and systems are important research directions in the field of three-dimensional printing. In combination with the development of three-dimensional printing in the directions of novel forming process, method, material and metal part forming and the like, the research on a novel 3D printing control method and an economical system which are low in cost, high in precision, high in integration degree and reliability and have an extensible function and a reconfiguration function is important in the research.
Meanwhile, the social requirements of individuation and differentiation also put forward higher requirements on the adaptability and the complexity of the production system, and the method is suitable for economic numerical control with low cost, high flexibility and high complexity of changeable markets and fast changing products, and is an urgent requirement on a processing system in a production field.
Disclosure of Invention
According to the situation, the invention researches a control technology for three-dimensional printing, expands the control technology to other typical multi-axis linkage controlled objects, and provides a reconfigurable system for multi-axis linkage economic numerical control based on a high-performance standard industrial PC system, an embedded controller and a special control integrated circuit, wherein the reconfigurable system comprises an upper control system, a lower control system and a controlled object;
the upper control system completes the man-machine interface and control, the layered slicing algorithm and the data processing of the industrial control system;
the lower control system consists of an embedded system, a control special integrated circuit and a basic supporting circuit;
the embedded system realizes management scheduling of the control process, processing related control algorithm and hardware driving function; the control special integrated circuit receives the instruction information sent by the embedded system, executes data conversion according to the requirement of the controlled equipment, sends the converted instruction data to the corresponding control circuit, and drives the corresponding execution component of the controlled object to realize corresponding action; meanwhile, the control application specific integrated circuit collects the state information of the controlled object and sends the state information to the embedded control system; the basic supporting circuit comprises circuits such as an embedded processor, a power supply for controlling an application-specific integrated circuit and the like, a starting circuit, a clock circuit, an external storage circuit and the like;
the basic logic structure unit of the control application specific integrated circuit comprises: an SPI reading module SpiRd, an SPI writing module SpiWr, an instruction decoding module DecInstr, a PWM output control module U1PwmDrv, an AD acquisition conversion control module U0MaxDrv, a switching value output module DigOutP, a switching value input module DigInP, a motion instruction queue module mInstr, a motion instruction execution control module ExeInst, and:
X/Y/Z/X1/Y1/Z1/W1 axis motion control module U 0 MtDrv~U 6 MtDrv, wherein the 7 modules adopt the same logic structure; w-axis motion control moduleUwJetMt only requires speed control, and other shafts require speed and displacement control and have the requirement of linkage control;
additional AD acquisition and conversion control module U 1 Maxdrv, its module circuit and U 0 MaxDrv is the same;
SpiRd and SpiWr jointly realize SPI read-write control;
DigOutP and DigInP realize switching value input/output control;
U 0 MtDrv~U 6 MtDrv and UwJetMt realize the control of the motion of X, Y, Z, X, Y1, Z1, W1 and W of the controlled object;
SpiWr receives MOSI, SCK and NSS signals of the SPI bus, executes data analysis and data discrimination, calculates a command code CMD, command data DInst and a data sequence number DIndx, then sends a calculation result to a DecInstr module, and executes command decoding;
the SpiRd responds to SCK and NSS signals of the SPI bus and sends data in the SPI sending register TBuf to an MISO port of the SPI bus according to a preset time sequence;
the DecInstr receives the instruction data output by the SpiWr, realizes instruction decoding and executes a part of instructions;
a. receiving a motion instruction, calculating a mInstr instruction queue write pointer WrP, judging a queue full state QueF, inputting data into an mInstr instruction queue according to a write pointer WrP, and waiting for an instruction execution control module ExeInstr to process;
b. when receiving a PWM output, acquisition conversion or switching value output instruction, the DecInstr sends the instruction parameter to a corresponding PWM output, acquisition conversion or switching value output module circuit, starts U1PwmDrv, U0MaxDrv or DigOutP, outputs a preset PWM waveform, and starts acquisition conversion or outputs a specified switching value;
c. receiving switching value input, coordinate acquisition, AD acquisition data acquisition or motion state acquisition instructions, retrieving a corresponding register DIBuf, mtCor, wData or MtBsy by the DecInstr, transmitting the data to an SPI (Serial peripheral interface) sending register TBuf, and transmitting the data to an SPI bus by the SpiRd;
the data in the MtCor register is the current coordinate information of each direction, namely U 0 MtDrv~U 6 Current coordinates Cor of each direction sent by MtDrv;
the data in the MtBsy register is the current state of each axis, namely U 0 MtDrv~U 6 The current busy and idle state Bsy in each direction is sent by the MtDrv;
the DigOutP responds to an enabling signal EnDO sent by the instruction decoding DecInstr and sends the data of the switching value output buffer DObuf to a switching value output port DO of the SPI bus;
the DigInP acquires a switching value input port DI of an SPI bus, sends related input data to a switching value input buffer DIbuf, responds to an enable signal EnDI output by the DecInstr, sends the data of the DIbuf to a sending buffer TBuf of the SpiRd, and finally sends the data of the DIbuf out of the integrated circuit by the SpiRd; u0MaxDrv receives an enable signal EnAd sent by the DecInstr to generate mSK and mCS control signals required by an external AD device; at the same time, U 1 MaxDrv and U0MaxDrv dynamically acquire a serial data port DM of an SPI bus according to the time sequence requirement of an AD device, and send acquired conversion data to a register wData; then, the DecInstr responds to the acquired data reading instruction, transmits the wData data to the TBuf, and transmits the wData data to the SPI bus through the SpiRd;
u1PwmDrv responds to an enable signal EnPWM sent by DecInstr, and outputs a specified PWM waveform according to a pulse width parameter wDur and an inter-pulse parameter wInt output by DecInstr;
the ExeInstr receives an mInstr write pointer WrP sent by the DecInst, acquires the instruction data of the mInstr, calculates a read pointer RdP, a motion segment end stop mark Stp and a motion instruction queue empty mark QueE of each motion direction Dr and mInstr; then, the command speed Spd, the displacement Dis, the moving direction Dr and the moving segment stop mark Stp are sent to the specified U 0 MtDrv~U 6 MtDrv or UwJetMt, corresponding driving pulses 0 Cp-6 Cp and wCp are output to realize corresponding movement; the motion direction of X/Y/Z/W/X1/Y1/Z1/W1 is also realized by ExeInstr.
A system reconfiguration method of the reconfigurable system comprises the following steps:
the SPI reading module SpiRd, the SPI writing module SpiWr, the instruction decoding module DecInstr, the movement instruction queue module and the movement instruction execution control module are essential basic building modules of the system, and the quantity is one when the system is built;
the PWM output control module, the AD acquisition conversion control module, the switching value output module, the switching value input module, the W-axis motion control module and the like are standard reconstruction modules, and can be increased according to the requirements of the system on the number of PWM, AD acquisition conversion, switching value input and output and W-axis motion;
feed motion control module U X MtDrv、U Y MtDrv、U Z MtDrv or X/Y/Z/X1/Y1/Z1/W1 seven-axis motion control module U 0 MtDrv~U 6 The MtDrv has the same structure, function and implementation circuit and is a standard reconstruction module; according to the requirement of the number of motion axes of the system, 1 or more motion control modules are used for realizing a plurality of motions;
the system implementation and reconstruction process comprises the following steps:
1) The system structure is as follows: determining the number of modules for feed motion, main motion, AD acquisition, PWM, switching value control and the like according to the number of feed shafts, the number of main motion, PWM, acquisition conversion, switching value input and output and the like of a system realization structure and the system; the execution component selects mechanisms and objects such as a feeding servo motor, a spindle motor, a machine tool body and the like of the complex multi-axis numerical control system;
2) The instruction system: with the foregoing, a three-axis two-linkage economical system (FDM and other three-dimensional printing, drilling, planing, etc.) uses a basic instruction set, a three-feed-axis linkage controlled motion instruction execution module ExeInstr (a 7-feed-axis linkage module ExeInstr may also be used); the three-feed-shaft linkage economical system (milling machine, lathe and other systems) uses a basic instruction set, an extended instruction set and a motion instruction execution module ExeInstr (a 7-feed-shaft linkage module ExeInstr can also be used); the complex multi-axis linkage economical system (more than 3-axis feeding, multi-analog quantity acquisition, multiple power control and the like) uses a basic instruction set, an extended instruction set and a 7-feeding axis linkage module ExeInstr;
3) An upper control system: the method is realized by combining a standard PC system with special processing software such as editing, decoding and the like for a multi-axis linkage numerical control system, and after data processing is finished, instruction data are transmitted to a lower control system through high-speed communication (generally adopting a high-speed serial port) according to the requirement of an instruction system;
4) Feeding movement: comprises a 1-7-axis feeding motion, which is realized by an X one-way to XYZX1Y1Z1W1 seven-way servo system and a motor universal control module;
5) Cutting main motion: the main shaft moves, and when the main motion has a relatively accurate rotating speed control requirement or has a speed matching requirement with the feeding motion, the main motion can be realized by a W-direction servo system and a control module; the requirement of rotating speed precision is general, and has no coordination control requirement with the feed motion, and can be realized by adopting a special PWM control module, an external power amplification circuit and a corresponding motor
6) The lower control system: the method is realized by a standard embedded system and a one-seven-axis linkage special control program; when the processing is executed, the special control program driver receives the basic instruction and the expansion instruction, and writes the parameters into the special integrated circuit to realize the motion of the main shaft and the X unidirectional-XYZX 1Y1Z1W1 seven-direction feed shaft and other functions; the lower control system collects coordinates and strokes at regular time and sends the coordinates and strokes to a standard PC through high-speed communication to realize display updating;
7) An application specific integrated circuit: receiving control commands of feeding motion, main motion and the like sent by a standard embedded system, outputting signals corresponding to motors such as XYZWX1Y1Z1W1 and the like, PWM control and the like, and driving an execution component to realize corresponding functions; meanwhile, collecting information such as coordinates, travel switches and the like, responding to the request of the standard embedded system regularly, and sending out corresponding data information;
8) Inputting switching values such as travel: the switching value input module and the corresponding conversion circuit are used for realizing the switching value input; the switching value input/output module expansion switching value can be increased according to the system requirement;
9) Other switch control requirements: the switching value output module and the corresponding conversion and power amplification circuit are used for realizing the switching value output;
10 Analog detection requirement: the analog quantity acquisition of at most two paths can be realized by AD acquisition and conversion control or additional AD acquisition and conversion control and a necessary amplification conversion circuit; the number of the expanded analog quantity detection of the AD acquisition and conversion control module can be increased according to the system requirement;
by combining the process, a more complex multi-axis linkage control processing system can be constructed, and when the more complex industrial production field control is met, the more complex processing control system can be constructed by properly modifying the data processing and special control program of the upper and lower control systems, properly increasing the control instruction, correcting and executing the control ExeInstr module and by additionally arranging the PWM control module, the feed axis control module, the W axis control module and the AD acquisition and conversion control module.
Drawings
FIG. 1 is a functional block diagram of an industrial control system oriented to FDM in this example;
FIG. 2 is a schematic diagram of an implementation structure of an FDM-oriented industrial control system;
FIG. 3 is a logic structure diagram of an FDM-oriented industrial control system ASIC (i.e., the control circuit of the present invention);
fig. 4a and 4b are comparisons of acceleration and velocity curves for trapezoidal acceleration and deceleration, where:
FIG. 4a is an acceleration curve and FIG. 4b is a velocity curve;
FIG. 5 is a schematic diagram of the logical structure of the XYZ-direction motion control module;
FIG. 6 is a schematic diagram of the logical structure of the W spinning motor control module;
fig. 7 is a control timing of the typical AD device ADs 7816;
fig. 8 is a timing chart of the operation of the motion execution control module ExeInstr.
FIG. 9 is a schematic diagram of an implementation structure of the complex multi-axis linkage reconfigurable industrial control system of the embodiment
FIG. 10 is a schematic diagram of the logic structure of the ASIC of the control system facing FDM;
fig. 11 is a timing chart of the operation of the motion execution control module ExeInstr of this example.
Detailed Description
For the convenience of understanding, the principle of the industrial control system is described below with a simpler FDM-oriented simple multi-axis linkage economic numerical control system. The industrial control system realizes complex multi-axis linkage control on the basis.
1. System functional framework
The functional structure of an economical reconfigurable industrial control system facing FDM, which is proposed by comprehensively analyzing the data processing and scanning, stacking, machining and forming processes of a fused deposition manufacturing process, is shown in FIG. 1. According to the completed system function and control task, the control system is divided into three constituent units, namely an upper control system, a lower control system and a machine tool body and an execution component. The upper control system is realized by a high-performance industrial control computer and supporting software thereof, and mainly completes human-computer interface and control, hierarchical slicing algorithm and data processing of the system. The method supports the relevant instruction operation, processing parameters, three-dimensional processing model input, model discretization processing, processing instruction generation and transmission, state data transmission and display of a user.
The lower control system is mainly composed of an embedded system, software, a printing control special integrated circuit and a basic supporting circuit. The embedded control system realizes management scheduling, unit control algorithm and hardware driving function of the printing control process. When executing printing control, the management scheduling program executes dynamic searching special integrated circuit according to preset strategy to obtain state information of machine tool equipment; then, according to the state information, calling a related algorithm control program, according to a preset control strategy, dynamically calling corresponding hardware drive control, and sending related control data to the integrated circuit to realize a preset action.
The printing control special integrated circuit of the lower control system receives the instruction information sent by the embedded system and the software, executes data conversion according to the specific requirements of the servo motor, the acquisition system and the heating circuit, sends the converted instruction data to the corresponding control circuit, drives the corresponding equipment to realize corresponding movement, heating and acquisition operations, and realizes the functions of printing, scanning, stacking, wire temperature detection and control and the like. Meanwhile, the printing control special integrated circuit responds to the request of the embedded processor, and timely collects and sends out states of the wire temperature, the stroke, the limit switch and the like for the retrieval of the embedded control system.
The machine tool body and the executing component mainly comprise a machine tool body, an XY direction scanning motion servo system and a motor, a Z direction stacking motion servo system and a motor, a W axis spinning motion servo system and a motor, an AD conversion and support circuit for filament temperature acquisition control, a spinning heating power amplification circuit, a digital I/O amplification circuit and other auxiliary control and circuits. The execution component receives the standard control signal output by the lower control system, executes power amplification, drives corresponding equipment such as a motor and a heating circuit, and realizes instruction action. Meanwhile, the execution component receives data such as a travel switch, a power-off signal and the like from the machine tool body, converts the data into a standard signal after amplification and conversion, and sends the standard signal to a special integrated circuit of a lower control system for retrieval by the embedded processor.
Other auxiliary control and circuits including the control of lighting, power switch, lubricating and other functions are completed by the electric system of the machine tool body and are not directly controlled by a lower control system.
2. System implementation structure
According to the basic functional structure and control requirements of the control system, and combined with the comprehensive consideration of the specific implementation method and implementation process of module functions, the convenience requirement of command operation control and the like, the implementation structure of the reconfigurable system for FDM fused deposition modeling and other economic numerical controls proposed herein is shown in fig. 2. The system is convenient to realize, expand functions and improve the reliability of the system, and the upper control system is constructed by a standard industrial PC. The hardware is realized by standard industrial PC, the supporting software is a mainstream operating system, a standard driver and a graphic library, and the high-speed data communication adopts a built-in RS232 standard serial port and a transmission protocol of the PC. And a special algorithm and a processing program of the upper control system receive and process the three-dimensional CAD model, generate a processing control file according to the process and the hardware requirements of the control system, and transmit the processing file to the lower control system according to a special communication protocol based on RS 232.
The lower processing control is realized by a standard embedded system and a self-designed printing control special integrated circuit. The embedded control system comprises standard hardware such as an embedded processor, a starting circuit, a clock circuit, a downloading circuit and the like and a special printing control program; based on the consideration of the aspects of transmission speed, transmission distance, control instantaneity and the like, the data transmission between the embedded system and the application-specific integrated circuit is realized through an SPI bus protocol, and the communication baud rate is 36MBPS. Through a special control program of a standard embedded system, the lower control system receives and interprets an instruction program sent by the high-speed communication port, drives multi-axis motion control, PWM control, AD conversion and acquisition control sub-modules of the special integrated circuit, realizes instruction actions of processing motion, silk temperature acquisition, silk spraying heating and the like, and processes the appointed three-dimensional solid part.
The special integrated circuit is controlled by the instruction of the embedded system to realize the direct control of the functions of printing and scanning, layer stacking, silk temperature acquisition, printing and spinning and the like; wherein, the XYZW motion control module finishes XY printing scanning, Z processing stacking and W-axis spinning action, and outputs driving pulse and direction control signal of an XYZW axis servo system, and the specific control content comprises XYZW axis direction, acceleration, speed, displacement, linkage, W-axis direction and speed control and the like; the special PWM control module receives PWM parameters sent by the standard embedded system, outputs PWM control signals according with a preset duty ratio, and drives the heating power amplification circuit to realize the timely regulation of the spinning heating power; and the AD conversion and acquisition control module sends out a control signal meeting the time sequence logic requirement of an external AD device according to the instruction requirement from the SPI, starts data acquisition and acquires the instant spinning temperature.
The switching value input/output control module receives switching signals such as stroke, limit and the like sent by the machine tool equipment end, sends the switching signals to the special buffer in the chip in real time and responds to an instruction to be sent to the system; meanwhile, the module outputs switching signals such as processing instructions, running conditions and the like according to system instructions to realize equipment state indication; the register of the integrated circuit and the processing instruction queue temporarily store data such as operating parameters, states, processing instruction information and the like, the processing instruction execution control module automatically acquires a queue instruction, executes instruction decoding, starts a related control module according to the instruction and realizes instruction required action.
3. Integrated circuit logic structure and instruction set design
3.1 logical Structure design
The logic unit formation and logic relationship structure of the FDM-oriented reconfigurable control system-specific integrated circuit is shown in fig. 3, according to the functional structure and implementation structure of the reconfigurable control system, in combination with the functional requirements, the working process analysis, and the input/output logic relationship with other constituent modules of the reconfigurable system of the dedicated control integrated circuit.
The basic constituent unit of the application-specific integrated circuit mainly comprises an SPI read SpiRd, an SPI write SpiWr, a command decoding DecInstr, a PWM output control U1PwmDrv, an acquisition conversion control U0MaxDrv, a switching value output DigOutP, a switching value input DigInP, a motion command queue mInstr, a motion command execution control ExeInstr, an X-direction motion control UxMtDrv, a Y-direction motion control UyMtDrv, a Z-direction motion control UzMtDrv and a W-axis motion control UwJetMt. SpiRd and SpiWr jointly form SPI read-write control, digOutP and DigInP realize switching value input/output control, and UxMtDrv, uyMtDrv, uzMtDrv and UwJetMt realize XYZW directional motion control.
The SpiWr module of the integrated circuit receives SPI standard signals MOSI, SCK and NSS, executes data analysis and data discrimination, calculates a command code CMD, command data DInst and a data serial number DIndx, sends a calculation result to the DecInstr module, and executes command decoding; the SpiRd module responds to SPI signals SCK and NSS and sends the on-chip data TBuf to an SPI port MISO according to a preset time sequence.
The module DecInstr receives the command data CMD, DIndx and DInstr output by the SpiWr, realizes command decoding and executes a part of commands. Receiving a motion instruction (such as spinning, feeding and the like), calculating a write pointer WrP of an mInstr instruction queue by the module, judging a queue full state QueF, writing data into the mInstr instruction queue according to the write pointer WrP, and waiting for an instruction execution control module ExeInstr to process; receiving instructions of PWM output, acquisition conversion, switching value output and the like, sending instruction parameters to corresponding module circuits by the module DecInstr, starting the U1PwmDrv, U0MaxDrv or DigOutP module, outputting a preset PWM waveform, and starting acquisition conversion or outputting a specified switching value; after receiving instructions such as switching value input, XYZ coordinate acquisition, AD acquisition data acquisition, motion state acquisition and the like, the module DecInstr retrieves corresponding registers DIBuf, mtCor, wData and MtBsy, sends data to an SPI sending register TBuf, and sends data to an SPI bus through SpiRd. The signal MtCor in the figure is current coordinate information in XYZ direction, i.e., XYZ current coordinates Cor sent by UxMtDrv, uyMtDrv, uzMtDrv; the signal MtBsy is the current state of XYZ axes, i.e., uxMtDrv, uyMtDrv, XYZ current busy-idle state Bsy sent by UzMtDrv.
The switching value output DigOutP responds to an enabling signal EnDO sent by an instruction decoding DecInstr, and sends 16-bit data of the switching value output buffer DObuf to an integrated circuit port DO; the switching value input DigInP acquires a switching value input port DI of 16 paths, relevant input data is sent to a buffer DIbuf, the module responds to an enable signal EnDI output by the DecInstr, the DIbuf is sent to a sending buffer TBuf of the SpiRd, and the SpiRd is sent out of the integrated circuit; the acquisition conversion control U0MaxDrv receives an enable signal EnAd sent by the DecInstr to generate mSK and mCS control signals required by an external AD device. Meanwhile, the module U0MaxDrv dynamically collects the serial data port DM according to the timing requirement of the AD device, and sends the obtained conversion data to the register wData. Then, the DecInstr responds to the acquired data reading instruction, transmits the wData data to the TBuf, and transmits the wData data to the SPI bus through the SpiRd; the PWM output control U1PwmDrv responds to the enable signal EnPWM sent by the DecInstr, and outputs a specified PWM waveform according to the pulse width parameter wDur and the pulse interval parameter wInt output by the DecInstr.
Executing control ExeInstr to receive mInstr write pointer WrP sent by instruction decoding DecInstr, acquiring instruction data of motion instruction queue mInstr, calculating direction Dr of an XYZW motion axis, read pointer RdP of mInstr, motion segment end stop mark Stp and motion instruction queue empty mark QueE, sending instruction speed Spd, displacement Dis, motion direction Dr and motion segment stop mark Stp to specified XYZW control module UxMtDrv, uyMtDrv, uzMtDrv or UwJetMt, and outputting driving pulses xCp, yCp, zCp and wCp of corresponding XYZW axes to realize corresponding motion. In particular, the motion direction of the XYZW axis is also realized by the execution control module ExeInstr.
The motion control modules UxMtDrv, uyMtDrv and UzMtDrv realize printing XY-direction scanning and Z-direction stacking motion, the modules receive an acceleration set value mACC output by an instruction decoding Decinstr, execute and control an enable signal En, a speed setting Spd, a displacement setting Dis, a direction setting DR and a motion segment and then receive a mark Stp, and output servo motor driving pulses xCp, yCp and zCp in corresponding directions, a three-direction motion axis mark Bsy and three-axis current coordinates Cor (namely xCOR, yCor and zCor), and realize acceleration and deceleration control in corresponding directions and driving of motors in corresponding axes; the motion control module UwJetMt realizes the spinning action of the three-dimensional printing spinning motor, receives an enabling signal wEn and a speed setting Spd output by an instruction decoding DecInstr, outputs a driving pulse wCp of a spinning shaft W, facilitates circuit simplification, and is not provided with an acceleration and deceleration function.
3.2 basic instruction and basic instruction set design
3.2.1 instruction format and method of transmission
The basic structure of the instruction comprises an instruction code and an instruction parameter, wherein the instruction code indicates the operation content of the instruction and occupies 1 byte; the instruction parameters specify parameters used to execute the instruction, with the basic instruction set instruction occupying 4-18 bytes. System instructions are classified into motion instructions and non-motion instructions according to functions and operations to be performed. Wherein the motion instruction is used for realizing motion required in processing; the non-motion command is used to set processing parameters, obtain system status, or implement other output and input controls than processing motion.
The instruction transmission is realized by adopting a 16-bit SPI process, and according to the sequence, the embedded CPU sequentially transmits instruction codes and instruction parameters to the special integrated circuit through the SPI in sequence according to the byte sequence, namely, the instruction transmission is finished; when data such as system state, coordinate position and the like are obtained, the requested 16-bit data are received when the command is sent to the last SPI cycle.
3.2.2 non-motion Instructions
The non-motion command comprises switching value output, switching value read-in, analog value input, PWM output, acceleration setting, coordinate reading, state reading and the like, and the format definitions of the non-motion command are different.
1) Output switch value
The switching value output is used to set an output switching value of 16 bits, and the basic configuration of the command is shown in table 1. The command code 17H, byte 2 and byte 3 are respectively the high byte DOH and low byte DOL of the 16-bit preset switching value data.
TABLE 1 switching value output instruction Format
Instruction code Byte 1 Byte 2 Byte 3
17H 00H (unused) DOH DOL
When the output switching value is set, the SPI firstly sends out a command code and data 1700H of byte 1, then the SPI sends out 16-bit data consisting of DOH and DOL, and the output high-low bit bytes of the special integrated circuit are 16-bit switching values of the DOH and the DOL respectively.
2) Input switching value
The switching value input is used to obtain the state data of the 16-bit input switching value, and the basic structure of the command is shown in table 2. Instruction code 15H, parameter bytes 1, 2, and 3 are 00H, XXH and XXH, respectively. Where XXH is arbitrary data.
TABLE 2 switching value input command Format
Instruction code Byte 1 Byte 2 Byte 3
15H 00H (unused) XXH XXH
When the input switching value is obtained, the SPI firstly sends out an instruction code and data 1500H of byte 1, then the SPI sends out data XXXXH of parameter byte 2 and parameter byte 3, and meanwhile 16-bit state data of the input switching value are received.
3) Enabling operation
Enabling operation enables/disables the corresponding system device by pulling/resetting different flag bits, and the basic composition of the instruction is shown in table 3.
TABLE 3 Enable operation instruction Format
Figure GDA0003776779260000061
Instruction code 1BH, parameter bytes 1, 2 are both 00H. The D0 bit of the byte 3 is used for acquiring the start/stop (1/0) of the conversion control module U0MaxDrv, and the D1 bit is used for the start/stop (1/0) of the PWM output control module U1PwmDrv; the rest bits are reserved for system expansion.
4) State acquisition
The state acquisition command is mainly used for acquiring the working condition of a system circuit before the system sends out a command, so as to avoid misoperation, and the basic composition and related meanings of the command are shown in table 4. Instruction code 14H, parameter bytes 1, 2 are both 00H. The bits D0, D1, and D2 of byte 3 are the busy flag for X, Y, Z to move, respectively, the bit D3 is the busy flag of the acquisition conversion control module, and the bits D4 and D5 are the full and empty flags of the motion instruction queue mlstr, respectively.
Table 4 state fetch instruction format
Figure GDA0003776779260000062
The other bits of parameter bytes 1, 2 and parameter byte 3 are temporarily unused and can be used as system extensions.
5) Analog input
The input of the analog quantity needs to start the acquisition conversion control firstly, and then wait for the acquisition conversion to finish to obtain the conversion result.
(1) Starting digital-to-analog conversion: starting digital-to-analog conversion requires first prohibiting acquisition conversion and clearing the last conversion result according to the enable operation instruction shown in table 3. And then, restarting the module U0MaxDrv and starting new acquisition conversion.
(2) Waiting for the conversion to end: when the conversion is finished, the system acquires the system state according to the instruction shown in the table 4, the AdBsy is 0, and an analog input result is acquired; otherwise, continuing to wait.
(3) Obtaining an analog quantity: the basic configuration of the analog quantity fetch instruction is shown in table 5. Instruction code 16H, parameter bytes 1, 2, and 3 are 00H, XXH and XXH, respectively. Where XXH is arbitrary data.
TABLE 5 analog get instruction Format
Instruction code Byte 1 Byte 2 Byte 3
16H 00H (unused) XXH XXH
When the input result of the analog quantity is obtained, the SPI first sends out 16-bit data 1600H (the high byte is the command code 16H, and the low byte is the value 00H of the parameter byte 1), and then the SPI sends out data xxxxxh of the parameter byte 2 and the parameter byte 3, and the low 12 bits of the received 16-bit data are the input analog quantity to be obtained.
6) PWM parameter setting and output instruction
The PWM parameter setting and output instruction comprises three types of PWM pulse interval setting, pulse width setting and PWM output, and the three types of PWM pulse interval setting, pulse width parameter setting and output appointed PWM waveform are respectively used for PWM waveform pulse interval and pulse width parameter setting.
(1) PWM pulse interval setting: the unit μ s is set for the inter-pulse parameter, and the basic structure of the command is shown in table 6. The instruction code 19H, byte 2 and byte 3 are respectively the upper eight-bit wPulIntH and the lower 8-bit wPulIntL of the setting value of wPulInt between pulses.
TABLE 6 PWM Interpulse set instruction Format
Instruction code Byte 1 Byte 2 Byte 3
19H 00H (unused) wPulIntH wPulIntL
When the setting between the PWM pulses is executed, the SPI first sends out the instruction code and the data 1900H of byte 1, and then sends out the 16-bit parameter between the pulses composed of wpullinth and wpullintl, thereby realizing the setting between the PWM pulses.
(2) Setting PWM pulse width: the basic configuration of the pulse width parameter setting command is shown in table 7. Instruction code 1AH, bytes 2 and 3 are the upper eight bits wPulDurH and the lower 8 bits wPulDurL, respectively, of the set value of wPulDur between pulses.
TABLE 7PWM pulse Width setting instruction Format
Instruction code Byte 1 Byte 2 Byte 3
1AH 00H (unused) wPulDurH wPulDurL
The pulse width setting method is similar to the inter-pulse setting, except that the instruction codes are different.
(3) And (3) PWM waveform output: the PWM waveform output is accomplished by enabling the operation commands, the format of which is shown in table 3. After setting parameters between pulse width and pulse, the SPI firstly sends out an enabling operation code and a data byte 1B00H; then, setting the PWM enabling position by the external processor, and recalculating the parameter byte 3; finally, the external processor sends the byte 2 (00H) and the calculated byte 3 to the asic via the SPI, outputting the predetermined PWM waveform.
8) Acceleration setting
Acceleration setting is used for setting acceleration parameters of XYZ-directional motions, so that instructions are simplified, the same acceleration is adopted for three-axis motions, and the basic composition of the instructions is shown in table 8.
TABLE 8 Accelerator setting Command Format
Instruction code Byte 1 Byte 2 Byte 3
18H 00H (unused) mAccH mAccL
The instruction code 18H, the byte 2 and the byte 3 are respectively a high byte mAccH and a low byte mAccL of 16-bit preset acceleration, and the setting method is similar to the output switching value, and will not be described herein again.
9) Coordinate reading
The coordinate reading mainly comprises acquiring XYZ coordinate data, only rotating the W axis in the forward direction or the reverse direction, without the coordinate control requirement, and the basic composition of the command is shown in Table 9. The instruction codes obtained by XYZ coordinate acquisition are respectively 11H, 12H and 13H, and the parameter bytes 1, 2 and 3 are respectively 00H, XXH and XXH. Where XXH is arbitrary data.
TABLE 9 coordinate fetch instruction Format
Instruction code Byte 1 Byte 2 Byte 3
11H/12H/13H 00H (unused) XXH XXH
When coordinate information is acquired, the SPI first sends out the command code and the data 1100H, 1200H or 1200H of byte 1 as required, and then sends out the 16-bit data xxxxxh composed of the parameter byte 2 and byte 3, and simultaneously receives the corresponding 16-bit coordinate data.
3.2.3 motion Instructions
1) Motion command generic format
The processing movement of the system comprises three types of unidirectional movement, two-axis linkage and XYW three-axis linkage. Wherein, the unidirectional movement is divided into X, Y, Z and W-direction movement; the two-axis linkage is divided into XY, YW and XW linkage motion; the motion commands are also individually associated with the motion classes, and the general format is shown in table 10.
TABLE 10 motion instruction general Format
Figure GDA0003776779260000081
The instruction code 10H, the parameter byte 1 is not used, the parameter byte 2 is the enabling state of the motion axis, D0-D4 are X, Y, Z and set to be '1' if W moves or not in sequence, and the axis moves; conversely, the shaft does not participate in the motion; the parameter byte 3 is the instruction movement direction, D0-D4 are the movement directions of X, Y, Z and the W axis in sequence, and set to be '1', and the axis moves in the negative direction; conversely, the shaft moves in a forward direction;
parameter bytes 4 and 5 are 16-bit instruction speed of motion, unit: step/s; parameter bytes 6 and 7 are 16-bit instruction displacements of motion, in units of: and (5) carrying out the following steps. And the motion parameters are sequentially distributed to X, Y, Z or a W shaft participating in motion (W only sets the motion speed and has no displacement parameters).
2) Unidirectional motion command
The unidirectional motion has 8 conditions of forward and reverse motion of X, Y, Z, W axes
(1) X unidirectional movement: the structure of the X unidirectional motion command is shown in table 11. The instruction code 10H, the parameter byte 1 is not used, the parameter byte 2 is 01H, and the instruction code indicates that the movement is X-axis movement; the parameter byte 3 indicates the direction of motion, 00H for positive motion and 01H for negative motion. Parameter bytes 4-5 specify a 16-bit motion velocity in steps/s, and parameter bytes 6-7 specify a 16-bit motion displacement amount in steps.
TABLE 11X Axis unidirectional motion Command Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7
10H 00H (unused) 01H 00H positive/01H negative 16 bit instruction speed 16 bit instruction displacement
(2) Y unidirectional motion: the instruction structure is shown in table 12. The instruction code 10H, the parameter byte 1 is not used, the byte 2 is 02H, and the Y-axis motion is designated; byte 3 is 00H, Y is moving forward; 02H, negative Y motion. Bytes 4-5 and 6-7 specify 16 bits of speed and displacement, respectively.
TABLE 12Y Axis UNIDIRECTIONAL MOTION COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7
10H 00H (unused) 02H 00H positive/02H negative 16 bit instruction speed 16 bit instruction displacement
(3) Z unidirectional movement: the instruction structure is shown in table 13. Parameter byte 2 is 04H, and Z-axis motion is specified; parameter byte 3 is 00H, Z axis forward motion; 04H, Z-direction motion. Parameter bytes 4-5 and 6-7 specify 16-bit speed and displacement, respectively.
TABLE 13Z Axis Unidirectionally moving Command Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7
10H 00H (unused) 04H 00H positive direction/04H negative direction 16 bit instruction speed 16 bit instruction displacement
(4) W, unidirectional movement: the instruction structure is shown in table 14. Parameter byte 2 is 08H, specifying W-axis motion; parameter byte 3 is 00H, and the W axis rotates in the positive direction; negative spin of 08H, W. The parameter bytes 4-5 specify 16-bit movement speed (frequency) of the W-axis, which is used as a spinning action of a spinning shaft or a spindle rotation action of economic numerical control, and only performs rotation speed control but not angular displacement control.
TABLE 14W Axis Unidirectionally moving Command Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5
10H 00H (unused) 08H 00H positive/08H negative 16 bit instruction speed
3) Two-axis linkage control instruction
The X-Y oblique line movement or X/Y unidirectional printing track or numerical control cutting track is divided into 3 types of linkage of XY, YW and XW according to the movement axis.
(1) XY linkage: the XY axis linkage control command structure is shown in table 15. The command code is still 10H, parameter byte 2 is 03H, indicating that the motion axis is X, Y; the parameter byte 3 indicates the direction of motion, and the parameters 00H-03H indicate positive X-positive Y-positive X-negative Y-positive X-positive Y-negative X-negative Y-negative motion in sequence.
Table 15 XY axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11
10H 00H (unused) 03H 00H-03H 16 bit X speed 16 bit X shift 16 bit Y speed 16 bit Y shift
The parameter bytes 4-5 and 6-7 specify the 16-bit movement speed and displacement in the X direction in turn, and the parameter bytes 8-9 and 10-11 specify the 16-bit movement speed and displacement in the Y direction, respectively.
(2) YW linkage: the YW axis linkage control command structure is shown in table 16. Parameter byte 2 is 0AH, indicating axis of motion Y, W; parameters 00H, 02H, 08H, and 0AH of parameter byte 3 sequentially specify the command movement directions of Y positive direction W positive direction, Y negative direction W positive direction, Y positive direction W negative direction, and Y negative direction W negative direction.
Table 16 YW axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9
10H 00H (unused) 0AH 00H、02H、08H、0AH 16 bit Y speed 16 bit Y shift 16 bit W speed
Parameter bytes 4-5 and 6-7 specify the 16-bit movement speed and displacement in the Y-direction in turn, and parameter bytes 8-9 specify the 16-bit movement speed in the W-direction.
(3) XW linkage: the XW axis linkage control command structure is shown in table 17. Parameter byte 2 is 09H, indicating axis of motion is X, W; parameters 00H, 01H, 08H, and 09H of parameter byte 2 sequentially specify the instruction movement directions of positive X-direction W positive, negative X-direction W positive, positive X-direction W negative, and negative X-direction W negative.
TABLE 17 XW Axis coordinated control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9
10H 00H (unused) 09H 00H、01H、08H、09H 16 bit X speed 16 bit X shift 16 bit W speed
Parameter bytes 4-5 and 6-7 specify the 16-bit movement speed and displacement in the X-direction in turn, and parameter bytes 8-9 specify the 16-bit movement speed in the W-direction.
4) XYW triaxial linkage control command
The instruction structure for XY diagonal printing or numerical control cutting trajectory is shown in table 18. The command code is still 10H, parameter byte 2 is 0BH, and the motion axes are X, Y and W; the parameter byte 3 indicates the movement direction, and the parameters 00-03H and 08-0BH sequentially indicate the movement of X positive Y positive W positive, X negative Y positive W positive, X positive Y negative W positive, X negative Y negative W positive, X positive Y positive W negative, X negative Y negative W negative, X negative Y positive W negative, X negative Y negative W negative, X positive Y negative W negative, and X negative Y negative W negative.
TABLE 18 XYW THREE-AXIS LINKAGE CONTROL COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13
10H 00H (unused) 0BH 00-03H,08-0BH X speed X displacement Y speed Y displacement W speed
The parameter bytes 4-5 and 6-7 specify the 16-bit movement speed and displacement in the X direction in turn, the parameter bytes 8-9 and 10-11 specify the 16-bit movement speed and displacement in the Y direction, respectively, and the parameter bytes 12-13 specify the 16-bit movement speed in the W direction.
4. Motion control and implementation
The motion control of the system comprises XYZ processing feed motion and spinning motion of a spinning shaft W direction, and the requirements and implementation methods of the two types of motion are different. The printing and feeding requirements are stable in movement, free of impact and provided with requirements on movement speed and displacement control, and the requirements are met through X, Y, Z-direction movement control modules UxMtDrv, uyMtDrv and UzMtDrv; the spinning motion is realized by controlling UwJetMt through W-direction motion, compared with printing feeding motion, the power of the spinning motion is small, the speed is low, only the speed control is executed, and the control requirement of displacement or rotation angle is avoided.
When the machining motion is executed, the execution control module ExeInstr coordinates in the whole process, controls the XYZ motion control modules UxMtDrv, uyMtDrv, uzMtDrv and the W-direction spinning motion control module UwJetMt, and drives the corresponding servo motor to realize the three-dimensional printing operation.
4.1 feed control principle
4.1.1 drive mode
The motion in the XYZW direction is dragged by a servo motor, and the driving method adopts a mode of combining command pulses with direction signals. Compared with other control modes, the mode of combining the instruction pulse with the direction signal is simple and convenient in wiring and debugging and easy to realize.
When the servo motor works in a command pulse mode, the driving signal of the servo motor comprises a driving pulse signal and a direction control signal. The frequency of the driving pulse determines the rotating speed of the servo motor, and the higher the pulse frequency is, the faster the rotating speed is; the lower the frequency, the slower the rotation speed; the rotation angle of the motor is controlled by the number of command pulses, and the larger the number of command pulses is, the larger the rotation angle of the servo motor is.
The level state of the direction signal determines the rotation direction of the motor, and controls the servo motor to realize the rotation movement in the counterclockwise direction or the clockwise direction.
4.1.2 acceleration/deceleration control
From the perspectives of simplifying calculation and facilitating implementation, the printing feed motion of the system is realized by acceleration and deceleration of a trapezoidal curve and the like. Assuming an acceleration value a of the movement M Command velocity v M The initial velocity value is "0", and the acceleration and velocity variation curves of the complete trapezoidal acceleration and deceleration process are shown in fig. 4a and 4 b.
According to the speed change characteristics, the whole process of trapezoidal acceleration and deceleration can be divided into 3 processes of acceleration section, uniform velocity section and deceleration section, which respectively correspond to 0-t 0 、t 0 -t 1 And t 1 -t 2 A time period. Assuming that the acceleration and the velocity at the time t are a (t) and v (t), respectively, the acceleration a (t) at the time t is:
Figure GDA0003776779260000101
the velocity v (t) at time t is:
Figure GDA0003776779260000102
assuming an initial velocity v of the movement 0 The velocity v can also be described as:
Figure GDA0003776779260000103
assuming that the sampling time of the system is delta t, and the speed and the acceleration at the moment k are respectively set as v k 、a k Velocity v at time k k Discretization is as follows:
Figure GDA0003776779260000104
and (4) calculating the instantaneous acceleration and speed of each motion moment according to the formulas (1) and (4). And then, calculating a corresponding driving pulse count value according to the instantaneous speed, and generating motor driving pulses according with the movement speed and the displacement, so that the speed and the displacement control of the movement in the corresponding direction can be realized.
4.1.3 feed motion control strategy design
1) Motion analysis and planning
Assuming a current speed v of the feed motion, the commanded speed v M According to v and v M The comparison relationship of (a) and whether the next section of the current direction movement continues, etc., the feed movement of the X, Y, Z shaft is divided into 4 types: and respectively designing control strategies for the acceleration ending movement, the deceleration ending movement, the acceleration continuous movement and the deceleration continuous movement.
(1) Acceleration ending exercise
(1) The motion characteristics are as follows: A. the current speed v is less than or equal to the command speed v M (ii) a B. When the current movement is finished, the direction movement is stopped; C. the movement comprises 3 movement sections of speed rising, uniform speed and braking.
(2) And (3) movement planning: and planning the movement speed and the displacement according to the movement section of the feeding.
A. In the speed raising stage, acceleration integral is executed at regular time, the instant speed and the count value are calculated, and the corresponding driving pulse is output until the command speed v M
B. Uniform velocity segment according to v M Calculating brake displacement, keeping the speed unchanged, collecting displacement at fixed time, and entering a brake section when the brake displacement arrives;
C. and a brake section, which executes acceleration integration at regular time, calculates speed and count value, and outputs driving pulse until reaching target displacement.
(2) Deceleration ending exercise
(1) The motion characteristics are as follows: A. the current speed v is greater than or equal to the command speed v M (ii) a B. When the current movement is finished, the direction movement is stopped; C. the movement comprises 3 movement sections of speed reduction, uniform speed and braking.
(2) And (3) movement planning: and planning the movement speed and the displacement according to the movement section of the feeding.
A. In the speed reduction stage, acceleration integral is executed at regular time, the instant speed and the count value are calculated, and the corresponding driving pulse is output until the command speed v M
B. Uniform velocity segment according to v M Calculating brake displacement, keeping speed unchanged, collecting displacement at fixed time,the brake position moves to enter the brake section;
C. and a brake section, which executes acceleration integration at regular time, calculates speed and count value, and outputs driving pulse until reaching target displacement.
(3) Speed-up continuous motion
(1) The motion characteristics are as follows: A. the current speed v is less than or equal to the command speed v M (ii) a B. When the current movement is finished, the direction movement is continued; C. the movement comprises 2 movement segments with ascending speed and uniform speed.
(2) And (3) movement planning: and planning the movement speed and the displacement according to the movement section of the feeding.
A. The acceleration stage is used for executing acceleration integration at regular time, calculating the instant speed and the count value, and outputting a corresponding driving pulse until the command speed v M
B. And in the constant speed section, displacement is collected at regular time until the target displacement.
(4) Reduced speed continuous motion
(1) The motion characteristics are as follows: A. the current speed v is greater than or equal to the command speed v M (ii) a B. When the current movement is finished, the direction movement is continued; C. the movement comprises 2 movement segments with reduced speed and uniform speed.
(2) And (3) movement planning: and planning the movement speed and the displacement according to the movement section of the feeding.
A. In the speed reduction stage, acceleration integral is executed at regular time, the instant speed and the count value are calculated, and the corresponding driving pulse is output until the command speed v M
B. And in the constant speed section, displacement is collected at regular time until the target displacement.
2) Feed control strategy
A. Related concepts
Braking speed: speed of system during brake actuation
Brake displacement: when braking is performed, the movement is reduced from the braking speed to the speed 0, and the displacement is generated in the period. Assuming a brake velocity value v BRK Then according to the parameter curve of trapezoidal acceleration and deceleration, the brake displacement s BRK Comprises the following steps:
Figure GDA0003776779260000111
the essence of the braking displacement is the remaining unfinished displacement of the current movement when the system performs a braking operation.
B. Preparing for exercise: obtaining motion parameters, judging whether the motion in the direction stops after the current motion is finished, stopping the motion, and obtaining a command speed v M And calculating the brake displacement as the brake speed; if the motion is continued, the brake displacement calculation is not executed; comparing the current velocity v with the command velocity v M Judging the speed rising/falling type, and determining the acceleration a (the value a of the speed rising section) M Value-a at the deceleration stage M ) Entering corresponding speed rising/falling control;
C. controlling the ascending/descending speed: executing trapezoidal acceleration integration at fixed time, calculating instant speed and count value, and outputting drive pulse until command speed v M
D. Uniform speed control: if the direction movement stops after the current movement is finished, the system collects displacement at fixed time, and enters brake control after reaching the brake position; if the direction movement continues after the current movement is finished, acquiring displacement at fixed time until the displacement is instructed; .
E. Brake control, acceleration a taking the value-a M And performing acceleration integration at regular time, calculating speed and count value, and outputting driving pulse until command displacement.
F. Abnormal control, namely, achieving command displacement, prohibiting system output and ending movement no matter what control mode; when the speed is increased, the command displacement is 1/2, and the system enters the brake control.
4.2 Implementation of XYZ-direction motion control
4.2.1 logical Structure of control Module
X, Y, Z drives the corresponding motion motor to the motion control module UxMtDrv, uyMtDrv and UzMtDrv by adopting the mode of combining the pulses with the direction signals, and acceleration and deceleration control is completed by trapezoidal acceleration and deceleration. The three modules have similar functions and requirements, adopt the same logic structure and are mainly formed as shown in figure 5.
The motion direction of the XYZW is given by a motion control instruction, and ExeInstr is directly output by motion execution control; the driving pulse of the motion is realized by an XYZ motion control module.
The XYZ motion control module receives the reference clock CLK, the motion acceleration Acc sent by the command decoding module DecInstr, the command speed SpdI sent by the motion execution control ExeInstr, the command displacement Dis, the motion enable G, the motion direction DR, and the stop flag bStp after the end of this segment, and outputs X, Y, the driving pulse CP of the Z axis, the current coordinate Coor of the motion direction, and the busy motion flag Bsy. The module mainly comprises a motion control clock submodule Ck10KP, a state conversion control submodule StaCon, a brake displacement calculation submodule CalDis, a displacement calculation submodule DisCtrl, a driving pulse submodule CPGen and a speed counting calculation submodule CalCnt.
The Ck10KP sub-module utilizes a reference clock CLK to realize a control clock signal Ck10K of the feeding motion; the StaCon is controlled to collect and output feeding motion control parameters by state conversion, speed, displacement discrimination and state conversion are executed, and the whole process control of feeding motion is realized; the speed counting calculation submodule CalCnt acquires the current movement speed, and calculates a corresponding speed counter value tSpdCnt according to a driving pulse principle; the driving pulse submodule CPGen acquires a speedometer value and sends out a matched driving pulse to drive the servo motor to realize movement; the displacement operation submodule DisCtrl samples the driving pulse of the servo motor and calculates the current displacement; and when the current motion axis does not participate in the motion of the next instruction, the brake displacement calculation submodule CalDis acquires the brake speed and calculates the brake displacement of the current feeding motion.
4.2.2 logical implementation of control Module
1) Control clock submodule Ck10KP
According to the control requirements of the motion speed, the precision and the like of three-dimensional printing and other economical numerical control systems, a 1MHz active crystal oscillator is selected as a system reference clock CLK, the system control period is 10 mu s, the control clock frequency is set to be 100KHz, and the control is realized through a submodule Ck10 KP.
Ck10KP receives reference clock CLK of system, and divides CLK clock by 10 to obtain control clock signal Ck10K of 10 KHz. 2) State transition control StaCon
The submodule StaCon realizes the conversion and control of the motion state, the motion execution control ExeInstr sets the motion enable G, the StaCon starts the motion process and executes the conversion control of the motion state, and the basic process mainly comprises the motion preparation and the control of the motion process.
(1) Preparing for exercise: the method comprises the steps of A, judging the motion type and B, setting initial parameters.
A. And when the motion starts, the StaCon acquires the acceleration data Acc sent by the command decoding module DecInstr, the command speed SpdI, the displacement Dis and the direction DR sent by the motion execution control module ExeInstr and the stop mark bStp after the current segment is ended, compares the current speed Spd with the command speed SpdI, and executes the type judgment of the motion acceleration and deceleration and the judgment of whether the brake is performed or not by combining the stop mark bStp after the motion is ended.
B. Setting initial parameters, finishing the motion discrimination, sending the Spd into a CalCnt by the StaCon, and calculating a current speed count value; and if the vehicle stops after the movement is finished, sending SpdI serving as the braking speed BrkSpd into CalDis, and calculating the braking displacement. And then, the StaCon sets a corresponding motion speed increasing and decreasing control state, an enabling driving pulse submodule CPGen and a setting motion busy sign Bsy according to the motion speed increasing and decreasing type.
(2) And (3) process control: the motion process control comprises motion end judgment and motion state conversion.
A. In the process of movement, staCon continuously samples a displacement operation submodule DisCtrl to obtain a current displacement iDisCur, an instruction displacement Dis is reached, and the module clears a busy movement mark Bsy and ends the movement; if the Dis is not reached, switching to the motion state;
B. and (5) converting the motion state.
A) Controlling the clock Ck10K to output the StaCon sampling CalCnt, acquiring a count value tSpdCnt, sending the count value tSpdCnt to a driving pulse submodule CPGen as the SpdCnt, and then entering state processing;
b) State processing, then, staCon performs motion state processing.
(A) The motion is in brake control, the acceleration is selected to be-Acc, staCon calls a formula (10), acceleration integration is carried out, the motion speed Spd is recalculated, the Spd is sent to CalCnt, and a counting value tSpdCnt is calculated for the next use;
(B) The motion is in acceleration control, if Spd is smaller than SpdI, the acceleration is selected Acc, staCon calls a formula (10), acceleration integration is executed, the speed Spd is recalculated and sent to CalCnt, and a count value tSpdCnt is calculated for the next use; if the Spd is larger than or equal to SpdI, the movement is switched to the constant speed control;
(C) The movement is in deceleration control, if Spd is larger than SpdI, the acceleration is selected to-Acc, staCon calls a formula (10), acceleration integration is executed, the movement speed Spd is recalculated and sent to CalCnt, and a counting value tSpdCnt is calculated for the next use;
(D) If bStp = '1' (the current motion is finished, the motion of the current axis is stopped), staCon collects the current displacement iDisCur sent out by DisCtrl, the residual displacement is less than or equal to RemDis, and the motion is switched to brake control.
C) Speed calculation method
(A) Principle of velocity calculation
Setting a speed unit 'step/s', an acceleration unit 'mm/s', setting a motion step equivalent of 0.01mm, setting an integration period delta t consistent with the selection of a motion control period to be 10 mu s, and setting the speed v at the moment k according to a formula (4) k Can be expressed as:
Figure GDA0003776779260000121
definition of integral remainder sigmaMa k ,sigMa k Is an integral
Figure GDA0003776779260000122
For the remainder of divisor 1000, equation (6) evolves to:
Figure GDA0003776779260000123
wherein int is the rounding operation, rm is the decimal operation, and the parameter Spd is defined k
Figure GDA0003776779260000124
Since there is no decimal value for the speed in steps/s, spd k Actual speed of movement at time k:
Figure GDA0003776779260000125
(B) Formula for calculation
Summarizing equations (6) - (9), the velocity calculation is implemented using equation (10), where the Rem () operation is a modulo 1000 operation:
Figure GDA0003776779260000126
(C) Calculation process
When acceleration integration is executed, the circuit module firstly calculates the sum formula sigmaMa K-1 +a k-1 And (6) obtaining the result. Formula of calculation
Figure GDA0003776779260000131
By the sum formula sigmA K-1 +a k-1 The calculation result of (2) is right shifted by 10 bits; calculating Rem (sigMa) k-1 +a k-1 ) In time, directly taking and summing type sigmaMa K-1 +a k-1 The lower 10 bits of the result.
3) Caldis sub-module for calculating brake displacement
The CalDis obtains that command decoding module sends out acceleration Acc and the brake speed BrkSpd that state transition control StaCon sent out calculates the brake displacement, according to equation (5), calculates brake displacement RemDis, unit: step (0.01 mm).
CalDis includes a 12-bit multiplying circuit and a 24-bit dividend, a 13-bit divisor, respectively. The multiplication circuit executes square operation of 12-bit speed, the speed value is 0-4000 steps/s (0-40 mm/s), and 12-bit data is occupied; the division circuit realizes the division operation of the sum of the squares of the speeds of 24 bits and the acceleration of 13 bits; the 1/2 in the formula (5) is realized by logic right shift and is not finished by a special circuit to save resources.
4) Calcnt sub-module for calculating speed count
(1) Speed counting implementation principle
The motion control of the system utilizes the speed counter value to count the reference clock, and the pulse output port of the motion control motor is pulled up/cleared at regular time, so that the pulse width and the pulse interval of equidistant driving pulses of the servo motor are realized. Assuming a speed of motion v, in units of "steps/s", the frequency f of the reference clock CLK CLK Then the speedometer value k C Comprises the following steps:
k C =f CLK /2v (11)
according to the principle described in equation (11), the submodule CalCnt acquires the current speed Spd sent by the state transition control StaCon, calculates the corresponding count value tsfdcnt, and returns it to StaCon standby. Setting the equivalent of motion step of 0.01mm and the frequency f of reference clock CLK CLK Setting 1MHz, the count tsspdcnt may be determined as:
tSpdCnt=5×10 5 /Spd (12)
(2) Implementation procedure
Calcnt calculates the velocity count value tSpdCnt by using a standard neutralization circuit with a 20-bit dividend and a 12-bit divisor, wherein the dividend is a fixed value of 5 × 10 in the above formula 5 The divisor is the 12-bit speed Spd.
5) Displacement operation submodule DisCtrl
The sub-module DisCtrl samples a driving pulse internal signal iCP output by the CPGen sub-module and performs counting operation on the driving pulse internal signal iCP, calculates the instant displacement iDisCur of movement, and then sends the instant displacement iDisCur into the state conversion control StaCon to realize the state control of the movement;
meanwhile, the DisCtrl calculates the current coordinate value Coor of the motion in combination with the motion direction DR sent by the motion execution control module ExeInstr, and the current coordinate value Coor is used as the output of the motion control module.
6) Drive pulse submodule CPGen
The sub-module CPGen outputs a servo motor driving pulse CP to drag the servo motor to realize movement. The CPGen receives and responds to an enabling mark CPEn sent by the state conversion control submodule StaCon, counting operation is carried out on a 1MHz reference pulse CLK, a pulse counting value SpdCnt is reached, the output of the module is inverted, and a new round of counting is restarted; the above-mentioned steps are repeated so as to implement motor driving pulse.
CPGen simultaneously sends the homologous signal iCP of CP to the displacement operator module DisCtrl, and carries out displacement and coordinate calculation; staCon monitors the displacement and coordinate operation results in time, and when the instruction displacement is reached, CPEn can be forbidden, and the current motion is finished.
4.3 spinning/spindle motion control UwJetMt (in FDM system, controlling W spindle for controlling spinning motor)
Different from XYZ-direction movement, the movement control of the spinning motor is relatively simple, acceleration and deceleration and displacement control are not required, and only the speed and direction control of the movement is required. The direction signal of the W-axis spinning motor is also given by a motion instruction and is directly output through the module ExeInstr, and the logic structure of the motion control of the W-axis spinning motor is shown in figure 6.
The control structure shown in fig. 6 realizes motor drive pulse output, and is composed of a speed count calculation sub-module CalCnt and a drive pulse sub-module CPEn, and the realization principle and function of the speed count calculation sub-module CalCnt and the drive pulse sub-module CPEn are the same as those of feed control. CalCnt obtains the W-axis movement speed Spd sent by ExeInstr, calculates a pulse count value SpdCnt and sends the pulse count value SpdCnt to a driving pulse CPGen; controlled by W-axis motion enabling signal G sent by ExeInstr, CPGen generates spinning motion driving pulse signal CP with corresponding frequency
4.4 ganged control
Through the coordination control of the module ExeInstr on the actions of UxMtDrv, uyMtDrv, uzMtDrv and UwJetMt, the linkage motion of XYZ and W axes can be realized, including the linkage motion of straight lines and curves of two axes, three axes and four axes.
4.4.1 Linear linkage
1) Data preprocessing:
when the linear linkage is executed, the embedded CPU of the lower control system calculates the speed and displacement of each linkage shaft, generates an instruction by combining an instruction format and an instruction set, and then sends the instruction to the special integrated circuit through the SPI bus.
2) Linkage execution:
an ExeInstr module of the special integrated circuit acquires instruction parameters, simultaneously resets the enabling bits of the XYZW linkage shafts in the enabling register according to the linkage shaft serial numbers, and forbids the actions of the linkage shafts; then, the ExeInstr acquires the motion direction of each linkage shaft and sets a direction control signal participating in linkage of each shaft; then, writing the ExeInstr into the speed and displacement parameters participating in linkage of each shaft according to the instruction data; and finally, the ExeInstr module simultaneously sets the enabling positions of the XYZW linkage shafts in the enabling register again to take effect of the motion parameters and start linkage motion.
3) The linkage principle is as follows:
when linkage control is executed, the control modules UxMtDrv, uyMtDrv, uzMtDrv and UwJetMt which are linked with each shaft use the same clock CLK with the reference clock of-1 MHz, and linkage displacement of each shaft participating in linkage can be realized at a specified speed and at a specified time by controlling each step of action of a motion motor through frequency division of the CLK, so that the requirements of the speed, the displacement and the track of the linkage motion are met.
4) FDM linkage:
the FDM three-dimensional printing movement only has the linkage requirement of XY-direction scanning movement and is used for realizing the processing track of any angle oblique line of a two-dimensional layer scanning boundary.
When the oblique line scanning track is realized, the embedded CPU of the lower control system respectively calculates the scanning component speed and the component displacement of the X, Y shaft according to the track parameters and the speed data, and writes the scanning component speed and the component displacement into the integrated circuit according to the instruction format; an ExeInstr module of the special integrated circuit firstly prohibits XY motion and acquires and sets XY direction signals; then, writing the speed and displacement of XY respectively; finally, the ExeInstr simultaneously starts the XY movement again, namely, the arbitrary angle oblique line scanning of XY is realized.
4.4.2 spatial curvilinear motion
The three-dimensional curvilinear motion of the numerical control system requires linkage of multiple motion axes, and the realization of the linkage is more complex than linear linkage. Because the calculation of the space curve parameters is involved, the calculation speed and the complexity are high, and the participation of a PC (personal computer) of an upper control system is required. The motion trail of the space curve is realized by the approximation of a plurality of sections of space straight lines, namely, the coarse interpolation and the fine interpolation.
1) Data preprocessing:
when the rough interpolation is executed, the industrial PC of the upper control system executes discretization operation on the space curve by combining the control precision, the space curve is discretized into a series of space straight-line segments, parameters such as the motion speed, the displacement, the direction and the like of each axis are respectively calculated, a series of space straight-line motion commands are formed according to the command format, and the so-called rough interpolation is completed.
Then, through high-speed data communication, the industrial PC sends a series of spatial linear motion commands to the lower control system, and the lower control system realizes spatial curvilinear motion, so-called "fine interpolation".
2) Linkage execution:
through the SPI bus, the embedded CPU of the lower control system continuously sends the received serial linear motion commands to the special integrated circuit and stores the serial linear motion commands into a command queue mInstr. Responding to a control clock Ck10K, reading mInstr by the ExeInstr, acquiring a linear motion instruction sequence, and executing each linear motion instruction one by one according to the motion sequence of prohibiting a motion axis, writing motion parameters and restarting the motion axis, namely realizing the preset space curvilinear motion, namely 'fine interpolation'.
5. Filament temperature heating and acquisition control
The silk temperature control is realized by a silk temperature control algorithm of a lower control system, silk temperature heating control and silk spraying temperature acquisition control. When the spinning temperature control is executed, an embedded CPU of a lower control system collects the spinning temperature at regular time, calculates the temperature deviation according to the set spinning temperature, calls a spinning temperature control algorithm to calculate the duty ratio of a heating control PWM signal, calculates the pulse width and the pulse interval counting value of the PWM by combining a reference clock of 1MHz, sends the pulse width and the pulse interval counting value into a special integrated circuit, outputs a corresponding PWM control signal, and drives a corresponding circuit to heat and spin the spinning so as to realize the corresponding spinning temperature.
5.1 filament temperature heating and analog output control
The filament temperature heating and analog quantity output control realizes the control of the filament spraying heating power through a PWM output control module U1 PwmDrv. And the U1PwmDrv receives a PWM waveform pulse width count value wDur, an inter-pulse count value wInt and an enable control signal EnPWM sent by the instruction decoding DecInstr module, outputs a signal PWM and controls spinning heating.
When the spinning heating operation is executed, the SPI respectively sends a PWM pulse width setting instruction and an inter-pulse setting instruction to the special integrated circuit, and sets PWM pulse width and inter-pulse parameters; then, setting a PWM enabling bit EnPWM and starting a PWM output control module U1PwmDrv; u1PwmDrv responds and performs pulse width/pulse width counting on 1MHz reference clock CLK, the counting value reaches wDur/wInt, U1PwmDrv inverts an output port signal PWM and shifts to pulse width/pulse width counting; the above steps are repeated in a circulating way to realize a preset PWM waveform, and an external heating circuit is dragged to realize the control of the spinning heating power.
The PWM output control module U1PwmDrv can also be used for control of a cutting spindle motor or the like, the rotation speed or other control quantity being regulated by a duty ratio.
5.2 filament temperature acquisition and analog input control
The wire temperature acquisition is realized through an analog input control module U0MaxDrv, the external AD device facing the control is a typical 12-bit AD conversion device ADS7816, and the control time sequence of the device is shown in figure 7.
When the wire temperature acquisition is executed, the temperature sensor sends standard 5v temperature acquisition quantity or other analog quantity into ADS7816, and the acquisition and conversion of the temperature/analog quantity are completed by the acquisition and conversion control U0MaxDrv of the special integrated circuit.
U0MaxDrv receives an enable control signal EnAd sent by the instruction decoding DecInstr, outputs mCS and mSK, starts ADS7816 to execute analog-to-digital conversion and transmits data according to the protocol shown in FIG. 7;
after the conversion is finished, the ADS7816 responds to a data clock mSK sent by the U0MaxDrv, and the acquired data are sequentially sent to the DM end of the U0MaxDrv module in a bitwise manner; u0MaxDrv samples DM port and obtains each data bit according to mSK, sends data to wData;
and finally, the SPI sends an analog quantity acquisition instruction, the instruction decoding module DecInstr acquires the acquired data wData, sends the acquired data wData to the SpiRd through the buffer TBuf, and the SpiRd sends the data to the embedded CPU of the lower control system.
6. Motion execution control ExeInstr
The XYZ-direction feeding motion, the W-direction spinning motion and the coordination control of the three-dimensional printing are realized by executing and controlling ExeInstr through motion instructions. When the system is executed to move, the ExeInstr acquires an instruction from the instruction queue mInstr, corrects the queue read pointer pRd and the queue empty mark QueE, acquires and distributes motion parameters, and coordinates and controls the XYZW to execute corresponding motion to the motion control module. The read pointer pRd and the write pointer pWr of the queue mlnstr point to 1 word (2 bytes) of data respectively, and the working timing of the module ExeInstr is shown in fig. 8.
The work cycle of ExeInstr comprises a waiting period t W Moving axis and direction setting period t C0 Parameter setting period t of 1 st-4 th movement axis C1 -t C5 ;t C1 -t C4 Sequentially corresponding to the control period of the XYZW axis, and divided into a speed setting period t spd Displacement setting period t dis . Considering the capacity of the instruction queue, discontinuous writing of the same instruction should be allowed, for example, when the mlstr is full and an instruction is not written, the system is allowed to wait until the queue is not full, and then write the remaining instruction parameters; at this time, one or more t is required to be inserted between different parameter setting periods W A waiting period.
Period t W 、t C0 (i.e., t) ax-dr )、t C4 、t C5 (i.e. t) enMT )、t spd 、t dis Corresponding to a reference clock CLK period, XYZ-axis set period t C1 、t C2 、t C3 Each including a corresponding speed setting period t spd And a corresponding displacement setting period t dis Setting period t of W C4 Comprising only one speed setting period t spd Without setting the period t dis
In the system operation process, the module ExeInstr responds to the reference clock CLK and executes the operation timing sequence shown in fig. 8; CLK till, exeInstr searches an XYZ direction motion busy mark Bsy and an instruction queue mInstr empty mark QueE; queE or Bsy mark in any direction is set, and ExeInstr is inserted into a waiting period t W (ii) a Bsy marks in the QueE direction and the XYZ direction are both '0', and ExeInstr reads mInstr queue data of 1 word (2 bytes) and executes a period t ax-dr Acquiring the enabling condition of the movement axis of 1 byte and the direction of the movement axis of 1 byte; then, the ExeInstr module searches the enabling conditions of the XYZW axes from low to high in sequence according to the data bit sequence of the enabling condition bytes of the motion axes according to the instruction format, and enables marks of the motion axes in the instructionPulling En low, forbidding the motion of the command motion axis, and preparing to write motion parameters; then, the ExeInstr module sequentially retrieves the motion directions of the XYZW axes from low to high according to the data bit sequence of the motion direction bytes and outputs the corresponding motion directions DR according to the instruction format; then, the ExeInstr adds one to the read pointer pRd of the queue mInstr, and compares the read-write pointer pWr with pRd; setting an empty mark QueE of the mInstr when the mInstr and the mInstr are equal, and emptying queue data; otherwise, no processing is performed; finally, exeInstr waits for the next CLK clock to enter the motion parameter settings for each axis.
When the motion parameter setting of each axis is executed, the ExeInstr responds to the clock CLK and enters the period t in sequence C1 -t C4 Setting the parameter settings of 1 st-4 th movement axes and 4 maximum movement axes. Enter t C1 T of spd Period, if QueE is set, insert wait period t W (ii) a Otherwise, the ExeInstr searches the D0 bit (X enable bit) of the instruction enable status byte, if the D0 bit is '1', reads 2 bytes of mInstr data, and sends the data into the X speed Spd; then, adding one to the reading pointer pRd, comparing with pWr, modifying the empty mark QueE, and finishing the X speed setting; then, wait for CLK and enter X shift setting t dis (ii) a The X enable bit is '0', directly enters the X displacement setting t dis . Enter t C1 T of dis Period, queE set, insert t W (ii) a Otherwise, the ExeInstr acquires the D0 bit (X enable bit) of the enable status byte, and if the enable status byte is '1', 2 bytes of mInstr data are taken and sent into the X displacement Dis; then adding one to the reading pointer pRd, comparing with pWr, modifying the empty mark QueE, and finishing the setting of X displacement; then, wait for CLK and enter t C2 (ii) a The X enable bit is '0', and the period t is directly entered C2 And setting Y-axis parameters.
Y, Z axis parameter settings are similar to the X axis and will not be described in detail herein. After the parameter setting in the XYZ axis is completed, exeInstr enters the W axis parameter setting. At this time, exeInstr responds to CLK, and the parameter setting of all movement axes is completed by writing the W-axis movement speed. Then, exeInstr enters t C5 And a parameter validation period. When the CLK comes again, exeInstr sets the enable bit of each motion axis of XYZW, i.e., activates the motion axis, according to the motion axis enable status byte of the instruction, and executes the predetermined instruction. At this time, EThe xeInstr enters a waiting state, a busy flag of an XYZ axis is adopted according to CLK timing, and when all idle, the ExeInstr reads the queue mInstr again to acquire and execute a new instruction.
In the system operation process, a module ExeInstr continuously monitors a queue write pointer pWr, a new motion instruction or instruction data is written, pWr changes, and the ExeInstr immediately clears an empty mark QueE to prepare for instruction reading and execution.
7. Other controls
Other controls include SPI read SpiRd, SPI write SpiWr, command decode DecInstr, switching value output DigOutP, switching value input DigInP, motion command queue mis.
1) SPI read control SpiRd
The SPI read module SpiRd performs parallel-serial conversion, responds to the serial data clock SCK, and sequentially sends the 16-bit data of the integrated circuit transmission buffer to the SPI data terminal MISO in the order from high to low for retrieval by the embedded CPU of the lower control system.
When the read operation is executed, the embedded CPU needs to send out the instruction code and the byte 1 according to the instruction, and then sends out any data again, that is, the data requested by the instruction is received in the receiving buffer of the SPI.
2) SPI write control SpiWr
The SPI write module SpiWr performs serial-to-parallel conversion, responds to the serial data clock SCK, and sequentially receives data from the SPI data terminal MOSI in order from high to low, forming 16-bit parallel data.
The SPI writing SpiWr default system of the system takes the high 8 bits of the 16-bit data written by the system for the first time as instruction codes, and judges whether the parameter number, the parameter serial number and the parameter writing are finished or not according to the instruction codes and an instruction set; the parameter write is completed, spiWr transfers to the instruction cycle again, and waits for a new instruction
3) Instruction decode DecInstr
And the command decoding DecInstr acquires a command Cmd, a parameter serial number Dindx and command data Dinst which are sent out by the SPI write control SpiWr, and sends parameters into and starts a corresponding control module according to the command Cmd to realize a command.
(1) The command is a command of switching value input, state acquisition, analog quantity acquisition, coordinate acquisition and the like, and the DecInstr sends the corresponding switching value input, state acquisition, analog quantity input and coordinate register content to a sending buffer TBuf of the SPI after sending out a command code byte of the SPI and before finishing sending byte 1. Then, the SPI sends xxxxxxh (i.e., any 16-bit data), spiRd changes Tbuf from high to low, and in response to the data clock, sends Tbuf bits to MISO in sequence, and then to the embedded CPU of the lower control system.
(2) The command is a switching value output command, an enabling operation command, a PWM pulse width/pulse width setting command, an acceleration setting command and the like, the DecInstr obtains a command code and command parameters and sends the command parameters to a corresponding switching value output port, an enabling zone bit, a pulse width/pulse width parameter register and an acceleration register.
(3) Acquiring analog inputs requires multiple instructions to implement. At this time, the enabling operation is firstly executed, the AD acquisition and conversion control module U0MaxDrv is forbidden to act, then the module U0MaxDrv is enabled again, a control signal waveform conforming to the time sequence of an ADS7816 device is output, the external analog quantity of the conversion is acquired, and the conversion data is obtained; and then, executing a state acquisition instruction to acquire the busy state of the U0MaxDrv, finishing the conversion if the U0MaxDrv is not busy, and acquiring conversion data through an analog quantity acquisition instruction.
(4) Receiving a motion instruction, sequentially storing an instruction code and parameter bytes into a motion instruction queue mInstr according to words by a module DecInstr, calculating a write pointer pWr, comparing the write pointer pWr with a read pointer pRd, equaling the write pointer and the read pointer, and setting an mInstr full mark QueF; meanwhile, the instruction decoding module DecInstr monitors the read pointer pRd, and immediately clears the full flag QueF once a read operation occurs.
4) Switching value output DigOutP: digOutP receives a start signal EnDO sent by the instruction decoding module DecInstr and output data DObuf, wherein EnDO is high, and sends DObuf data out of the switching value output port DO.
5) Switching value input DigInP: digInP receives a start signal EnDI sent by the command decoding module DecInstr and an external input DI, enDI is high, and DigInP sends 16-bit DI data to DIbuf and enters the DecInstr module.
6) Motion instruction queue mlstr: mInstr is a 20-byte first-in first-out circuit, and the write operation is completed by instruction decoding DecInstr, including the operation of full flag QueF and write pointer pWr; the reading operation is completed by a motion execution module ExeInstr, and comprises the operation of a null mark QueE and a write pointer pRd;
8. construction of FDM-oriented three-dimensional printing numerical control system
By adopting the method, an economical numerical control system represented by FDM processing can be realized, and the economical numerical control system comprises an FDM processing system, an SLA processing system and the like.
1) The system structure is as follows: the functional structure of fig. 1 and the implementation structure shown in fig. 2 are adopted.
2) An instruction system: the basic instruction format and instruction set described above are used.
3) An upper control system: the command data is transmitted to a lower control system through high-speed communication (generally adopting a high-speed serial port) according to the requirement of a command system after the processing is finished by combining a standard PC system with FDM special data processing software.
4) Printing movement: the method comprises the steps of scanning, stacking, spinning and the like, wherein the scanning is realized through an XY-direction servo system and a control module, the stacking is realized through a Z-direction servo system and a control module, and the spinning motion is realized through a W-direction servo system and a control module.
5) And (3) spinning, heating and collecting: comprises heating the filament temperature and collecting and controlling the filament temperature. The wire temperature heating is controlled to be switched on and off by the PWM control module and the heating circuit, so that the power control is realized. The silk temperature acquisition is realized by a silk temperature acquisition and analog quantity input control module.
6) A lower control system: the method is realized by a standard embedded system and a special control program. When printing and processing, the special control program drives the filament temperature acquisition module to acquire the filament spraying temperature at regular time, calculates the temperature deviation, and calculates the PWM duty ratio of filament spraying heating control through a PID algorithm to realize filament spraying temperature control. And receiving the instruction, and writing the parameters into the special integrated circuit to realize processing. The lower control system collects coordinates, temperature and travel at regular time and sends the coordinates, the temperature and the travel to a standard PC through high-speed communication, and display updating is achieved.
7) Application specific integrated circuit: receiving control instructions of spinning heating, temperature acquisition, scanning, spinning, stacking movement and the like sent by a standard embedded system, outputting signals of a motor, acquisition control, heating control PWM and the like, and driving an execution component to realize corresponding functions; meanwhile, information such as coordinates, temperature and the like is collected, a request of a standard embedded system is responded, and corresponding data information is sent out.
8) Inputting switching values such as travel: the method is realized through a switching value input module.
In combination with other processing technologies, other types of three-dimensional printing systems can be constructed, for example, the W-axis spinning is used for controlling the ejection of the binder, and the three-dimensional bonding forming of powder can be realized; the SLA can be achieved by using the W-axis direction control for the on-off control of the ultraviolet light or laser. When the method is used for realizing other three-dimensional printing, the reconstruction of the system can be realized only by combining and changing the corresponding data processing program.
9. Economic numerical control system reconstruction method
The complex multi-axis linkage industrial control system is further perfected and obtained according to the complexity of the controlled equipment on the basis of the simple control system.
9.1 reconstruction method of economic numerical control of two-axis linkage
By adopting the method, a general economic numerical control system which requires the feeding linkage requirement below two shafts can be realized, and the general economic numerical control system is generally called a two-shaft linkage numerical control system and comprises a drilling machine system, a linear cutting system and the like.
1) The system structure is as follows: with the functional configuration of fig. 1, the upper control system and the lower control system of the system have the same implementation configuration as that of fig. 2. The executing parts are mechanisms and objects of a processing technology corresponding to a motor, a machine tool body and the like.
2) An instruction system: the basic instruction format and instruction set described above are used.
3) An upper control system: the standard PC system is combined with special processing software for editing, decoding and the like of the numerical control system, the processing is finished, and the instruction data is transmitted to a lower control system through high-speed communication (generally adopting a high-speed serial port) according to the requirement of an instruction system.
4) Feeding movement: the device comprises an XYZ triaxial movement and is realized through an XYZ directional servo system and a control module.
5) Cutting main motion: the main shaft moves, and when the main motion has a relatively accurate rotating speed control requirement or has a speed matching requirement with the feeding motion, the main motion can be realized by a W-direction servo system and a control module; the requirement of rotating speed precision is general, and the requirement of coordinated control with the feeding motion is not required, and the special PWM control module, the external power amplifier circuit and the corresponding motor can be adopted to realize
6) The lower control system: the method is realized by a standard embedded system and a special control program for two-axis linkage. When the machining is executed, the two-axis linkage special control program driver receives a basic control instruction set instruction, and writes parameters into a special integrated circuit to realize the motion and other functions of the main shaft and the XYZ feeding shaft. The lower control system collects coordinates and strokes at regular time and sends the coordinates and strokes to a standard PC through high-speed communication, so that display updating is realized.
7) Application specific integrated circuit: receiving control commands of feeding motion, main motion and the like sent by a standard embedded system, outputting signals of a corresponding motor, PWM control and the like, and driving an execution component to realize corresponding functions; meanwhile, information such as coordinates, travel switches and the like is collected, the request of the standard embedded system is responded regularly, and corresponding data information is sent out.
8) Inputting switching values such as travel: the switching value input module and the corresponding conversion circuit are used for realizing the switching value input.
9) Other switch control requirements: the switching value output module and the corresponding conversion and power amplification circuit are used for realizing the switching value output.
In combination with the processing technology, other types of processing systems can be constructed, for example, the W shaft is used for controlling a main shaft of a common drilling machine, and a drilling machine control system can be realized; the laser cutting can be realized by controlling the direction of the W axis to control the on-off control of the laser. When the method is used for realizing other cutting processing, the corresponding PC data processing program is required to be modified by combining the processing technology, and the system can be reconstructed. Dedicated PWM control can be used for main shaft control, as well as for extended system specific analog control or other power control.
9.2 three-axis linkage economic numerical control reconstruction method
The three-axis linkage numerical control system generally refers to a system with three-feed axis linkage requirements, and the economical numerical control system adopts a basic instruction set and an extended instruction set, so that the control is relatively complex.
9.2.1 extended instruction set
1) Two-axis linkage extended instruction
According to the motion axes involved, the two-axis linkage extension is divided into 2 types of YZ and XZ axis linkage, and the reference basic instruction set is defined in a relevant way.
(1) YZ linkage:
table 19 YZ axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11
10H 00H (unused) 06H 00/02/04/06H (Direction control) 16 bit Y speed 16 bit Y shift 16 bit Z velocity 16 bit Z displacement
(2) XZ linkage:
table 20 XZ Axis linkage control instruction Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11
10H 00H (unused) 05H 00/01/04/05H (Direction control) 16 bit X speed 16 bit X shift 16 bit Z velocity 16 bit Z displacement
2) Three-axis linkage extended instruction
(1) XYZ linkage:
table 21 XYZ three-axis linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 Bytes 14-15
10H 00H (unused) 07H 00-07H (Direction control) X speed X displacement Y speed Y displacement Z velocity Z displacement
(2) XZW linked:
TABLE 22 XZW THREE-AXIS LINKAGE CONTROL COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13
10H 00H (unused) 0DH Direction control X speed X displacement Z velocity Z displacement W speed
(3) YZW linkage:
table 22 YZW three-axis linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13
10H 00H (unused) 0EH Direction control Speed of Y Y displacement Z velocity Z displacement W speed
3) Four-axis linkage extension instruction
Table 23 XYZW four-axis linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 Bytes 14-15 Bytes 14-15
10H 00H 0FH Direction control X speed X displacement Speed of Y Y displacement Z velocity Z displacement W speed
9.2.2 three-axis linkage economic numerical control implementation method
1) The system structure is as follows: the three-axis linkage economic numerical control still adopts the functional structure of fig. 1, and the realization structures of the upper control system and the lower control system are the same as those of fig. 2. The execution components are mechanisms and objects such as an XYZ direction feed motor, a spindle motor, a machine tool body and the like of the three-axis numerical control system.
2) An instruction system: the basic instruction format, basic instruction set, and extended instruction set described above are used.
3) An upper control system: the data processing is finished by combining a standard PC system with special editing, decoding and other processing software of a three-axis linkage numerical control system, and the instruction data is transmitted to a lower control system through high-speed communication (generally adopting a high-speed serial port) according to the requirement of an instruction system.
4) Feeding movement: the device comprises the motion of three axes of XYZ, and is realized by an XYZ-direction servo system and a control module.
5) Cutting main motion: the main shaft moves, and when the main motion has a relatively accurate rotating speed control requirement or has a speed matching requirement with the feeding motion, the main motion can be realized by a W-direction servo system and a control module; the requirement of rotating speed precision is general, and the requirement of coordinated control with the feeding motion is not required, and the special PWM control module, the external power amplifier circuit and the corresponding motor can be adopted to realize
6) A lower control system: the method is realized by a standard embedded system and a three-axis linkage special control program. When the processing is executed, the special control program driver receives the basic command and the extended command, writes the parameters into the special integrated circuit, and realizes the movement of the main shaft, the XYZ feeding shaft and other functions. The lower control system collects coordinates and strokes at regular time and sends the coordinates and strokes to a standard PC through high-speed communication, so that display updating is realized.
7) Application specific integrated circuit: receiving control commands of feeding motion, main motion and the like sent by a standard embedded system, outputting signals corresponding to an XYZW motor, PWM control and the like, and driving an execution component to realize corresponding functions; meanwhile, information such as coordinates, travel switches and the like is collected, the request of the standard embedded system is responded regularly, and corresponding data information is sent out.
8) Inputting switching values such as travel: the switching value input module and the corresponding conversion circuit are used for realizing the switching value input.
9) Other switch control requirements: the switching value output module and the corresponding conversion and power amplification circuit are used for realizing the switching value output.
10 Analog detection requirement: the analog quantity acquisition of 1 channel can be realized through AD acquisition and conversion control and a necessary amplification conversion circuit.
In combination with the process, a multi-type control system can be constructed, and W can be used for spindle control of turning, drilling, milling and the like: the AD acquisition and conversion control can realize the acquisition of analog quantity such as external temperature, flow and the like, the special PWM control can be used for the control of the main shaft, and the special analog quantity control such as heating power can be expanded. When the system is realized, a processing and modifying data processing program and a special control program of a lower standard embedded control system need to be combined.
9.3 reconstruction method of complex multi-axis linkage economic numerical control
9.3.1 system realizing structure
The structure of the complex multi-axis linkage reconfigurable system is shown in fig. 9. When the control of a complex object is executed, a multi-axis linkage control system with more than three feeding axes is used, the control framework, the implementation method, the axis control module, the AD and conversion control, the switching value control and the like are used, and an expansion instruction set is added on the basis of the original basic instruction set and the expansion instruction set; meanwhile, the execution module is expanded to 8-axis motion control, so that a novel system which has multi-axis linkage control and is suitable for complex control occasions is formed. The number of motion axes is increased from XYZW four axes to XYZW and 8 axes control of X1, Y1, Z1 and W1, and AD acquisition conversion control is increased to two. The W shaft is mainly used for cutting main motion and similar control, only speed control is required, and the rest shafts require speed and displacement control and have the requirement of linkage control.
The special requirements of a complex multi-axis linkage economical control system are met, and the special algorithm and processing of an upper control system need to add the processing of multi-axis linkage, additional AD conversion and other functions such as editing, decoding and the like; the special control program of the lower control system correspondingly adds the control functions of multi-axis linkage function instruction control, additional AD starting, state acquisition, data acquisition and the like; the starting, state obtaining and data obtaining instruction decoding functions of additional AD are added in the instruction decoding; the control needs to be modified and expanded to enable the multi-axis linkage, set parameters, start, monitor and control the process, etc.
Reconstruction of 9.3.2 integrated circuit
The structure of the logical unit composition and logical relationship of the complex multi-axis linkage economical numerical control application-specific integrated circuit is shown in fig. 3.
The SPI reading SpiRd, the SPI writing SpiWr, the PWM output control U1PwmDrv, the acquisition conversion control U0MaxDrv, the switching value output DigOutP, the switching value input DigInP, the W-axis motion control UwJetMt and the motion instruction queue mInstr are the same as the homonymous modules of the system; X/Y/Z/X1/Y1/Z1/W1 axis motion control module U 0 MtDrv-U 6 The MtDrv adopts an XYZ-direction motor control basic module, and the motion instruction execution control ExeInstr is an expansion module of the motion execution control ExeInstr and is compatible with the ExeInstr; the instruction decoding DecInstr is also an original DecInstr expansion module and is compatible with the original instruction decoding module DecInstr. U shape 1 MaxDrv is newly added additional AD acquisition and conversion control module, module circuit and U 0 MaxDrv is the same.
9.3.3 extended instruction set
1) Non-motion augmentation instructions
(1) An expansion enable operation: the expansion enabling operation is compatible with the enabling operation of the basic instruction, and the additional AD acquisition and conversion control U is expanded 1 Enable control bits for MaxDrv, as shown in table 24.
Table 24 extended enable operation instruction format
Figure GDA0003776779260000191
Figure GDA0003776779260000201
The D0 and D1 bits of byte 3 are unchanged, D0 being the EnAd enabled for U0MaxDrv (1 Enable/0 Disable), D1 being the EnPwm enabled for U1PwmDrv (1 Enable/0 Disable); d2 is newly added with an AD control module U 1 EnAd1 is enabled for MaxDrv, and the remaining bits are reserved.
(2) An extended state acquisition instruction: compatible with the state acquisition instruction of the basic instruction, and expanded with an additional AD control module U 1 Busy status flags for MaxDrv, X1, Y1, Z1, and W1, as shown in table 25.
TABLE 25 extended state acquire instruction Format
Figure GDA0003776779260000202
D0-D5 of byte 3 are unchanged, and are X, Y, Z axis, U respectively 0 MaxDrv busy flag, empty, full flag of queue mlstr. D6 and D7 are busy signs of x1 and y1 respectively; d0 of byte 2 is a z1 axis busy flag, and D1 is an additional AD acquisition and conversion control U 1 Busy flag of MaxDrv. (3) adding an analog quantity acquisition instruction: the basic configuration of the additional analog quantity fetch instruction is shown in table 26. Instruction code 16H, parameter bytes 1, 2, and 3 are 00H, XXH and XXH, respectively. Where XXH is arbitrary data.
Table 26 additional analog fetch instruction format
Instruction code Byte 1 Byte 2 Byte 3
26H 00H (unused) XXH XXH
(4) Extended coordinate reading instruction: including X, Y, Z, X, Y1, Z1, and W1, to coordinate data, the basic composition of the command is shown in table 27. XYZ coordinate-acquisition instruction codes 11 to 13H, X1, Y1, Z1, and W1 coordinate-acquisition instruction codes 21 to 24H.
Table 27 coordinate read instruction format
Instruction code Byte 1 Byte 2 Byte 3
11-13H/21-24H 00H (unused) XXH XXH
2) Augmenting motion instructions
The extended motion command is compatible with the basic motion command and the extended motion command, and the directional motions of X1, Y1, Z1 and W1 are extended, and the command format is shown in table 28.
Table 28 motion instruction general format
Figure GDA0003776779260000203
Byte 2, high 4 bits D4-D7 are X1, Y1, Z1 and W1 enabled, D0-D4 remain unchanged, XYZW is moving or not. Byte 3 high 4 bits D4-D7 are the X1, Y1, Z1 and W1 motion directions; D0-D4 are unchanged and are X, Y, Z and the W axis moving direction in sequence. The 2 nd to 7 th words of the instruction are the 1 st to 3 rd motion axis speed and displacement parameters in sequence; the 8 th word is the speed of the 4 th motion axis W; the 9 th to 16 th are the 5 th to 8 th axes speed and displacement in sequence.
The command is the condition that all motion axes of the system participate in the motion, and when the system axes do not participate in the motion, the command parameters sequentially divide the frequency of the motion parameters according to the sequence of X, Y, Z, W, X, Y1, Z1 and W1. Other uses of the instruction are consistent with the basic instruction.
9.3.4 Complex multi-axis linkage execution control module ExeInstr
The complex multi-axis linkage system is similar to the motion instruction execution control ExeInstr circuit principle, the working time sequence and the implementation method of the three-axis linkage, the two-axis linkage and the three-dimensional printing system. The operation sequence of the module ExeInstr is shown in fig. 11.
FIG. 11 shows a control sequence including XYZWX1Y1Z1W1 eight-axis linkage commands, consistent with a three-axis linkage system, for a control cycle including a wait period t W Moving axis and direction setting period t C0 Parameter setting period t of each motion axis C1 -t C8 Motion start period t enMT ;t C1 -t C8 Sequentially corresponding to the control period of the XYZWX1Y1Z1W1 axis in sequence, including a speed setting period t spd Displacement setting period t dis . The system allows for discontinuous writing of the same instruction; at this time, one or more t s need to be inserted between different parameter setting periods W And waiting for a period.
Period t W 、t C0 (i.e. t) ax-dr )、t C4 、t C9 (i.e. t) enMT )、t spd 、t dis Corresponding to the duration ofOne reference clock CLK period, XYZWX1Y1Z1W1 axis set period t C1 、t C2 、t C3 、t C5 、t C6 、t C7 、t C8 Each including a corresponding speed setting period t spd And a corresponding displacement setting period t dis Setting period t of W C4 Comprising only one speed setting period t spd Without setting the period t dis
With the queue mInstr not empty and currently no system motion, the module ExeInstr enters the period t shown in FIG. 11 in response to the reference clock CLK ax-dr Acquiring a motion axis, prohibiting the motion of the motion axis, setting direction signals of the motion axes, preparing parameter writing, and entering a period t C1 ;t C1 In the method, a module ExeInstr responds to a clock CLK and sets the speed and displacement parameters of a motion axis 1; the above operations are circulated until the period t C1 And realizing parameter setting of all motion axes. Finally, exeInstr responds to the CLK clock and enters the motion start period t C8 And enabling each motion axis again and executing the command motion.
Similarly, when the motion parameter setting is executed, when the motion instruction queue mInstr is empty, the system inserts a waiting period t W And waiting for writing of the motion parameters. Unlike a three-axis linkage system or a two-axis linkage system, 17 clock cycles are needed for the complex multi-axis linkage execution control module ExeInstr to execute a motion instruction, and even if a motion axis corresponding to the cycle does not participate in the motion of the current instruction, the cycle cannot be skipped. At this time, the mInstr module only simply corresponds to a clock signal and does not perform any processing.
5363 method for realizing complex multi-axis linkage economical numerical control of 9.3.5
1) The system structure is as follows: the complex multi-axis linkage economical numerical control adopts the implementation structure shown in FIG. 9. Compared with the implementation structure of fig. 2, the complex multi-axis linkage system is additionally provided with an X1, Y1, Z1 and W1 motion control module and an additional AD acquisition and conversion control module which are all universal modules. The executing components are mechanisms and objects of a complex multi-axis numerical control system X, Y, Z, X1, Y1, Z1 and W1, such as a feed motor, a spindle motor, a machine tool body and the like.
2) An instruction system: the basic instruction format, basic instruction set, extended instruction set, and extended instruction set described above are used.
3) An upper control system: the data processing is finished by combining a standard PC system with special processing software such as editing and decoding of a complex multi-axis linkage numerical control system, and the instruction data is transmitted to a lower control system through high-speed communication (generally adopting a high-speed serial port) according to the requirement of an instruction system.
4) Feeding movement: the motion of seven axes including XYZX1Y1Z1W1 is realized by an XYZX1Y1Z1W1 direction servo system and a motor general control module.
5) Cutting main motion (taking a numerical control machine tool as an example): the main shaft moves, and when the main motion has a relatively accurate rotating speed control requirement or has a speed matching requirement with the feeding motion, the main motion can be realized by a W-direction servo system and a control module; the requirement of rotating speed precision is general, and the requirement of coordinated control with the feeding motion is not required, and the special PWM control module, the external power amplifier circuit and the corresponding motor can be adopted to realize
6) A lower control system: the method is realized by a standard embedded system and a seven-axis linkage special control program. When the processing is executed, the special control program drives and receives the basic command and the extended command, and writes the parameters into the special integrated circuit to realize the motion of the main shaft, the XYZX1Y1Z1W1 feeding shaft and other functions. The lower control system collects coordinates and strokes at regular time and sends the coordinates and strokes to a standard PC through high-speed communication, so that display updating is realized.
7) Application specific integrated circuit: receiving control commands of feeding motion, main motion and the like sent by a standard embedded system, outputting signals corresponding to an XYZWX1Y1Z1W1 motor, PWM control and the like, and driving an execution component to realize corresponding functions; meanwhile, information such as coordinates and travel switches is collected, the request of the standard embedded system is responded regularly, and corresponding data information is sent out.
8) Inputting switching values such as travel: the switching value input module and the corresponding conversion circuit are used for realizing the switching value input.
9) Other switch control requirements: the method is realized through a switching value output module and a corresponding conversion and power amplification circuit.
10 Analog detection requirement: the analog quantity acquisition of at most two paths can be realized by AD acquisition and conversion control or additional AD acquisition and conversion control and a necessary amplifying and converting circuit.
By combining the process, a more complex multi-axis linkage control processing system can be constructed, and when more complex industrial production field control is met, the more complex processing control system can be constructed by properly modifying the data processing and special control program of the upper and lower control systems, properly increasing the control instruction, modifying and executing the ExeInstr module through adding the PWM control module, the feed axis control module, the W axis control module and the AD acquisition and conversion control module.

Claims (8)

1. A reconfigurable system for multi-axis linkage numerical control comprises an upper control system, a lower control system and a controlled object;
the upper control system completes the man-machine interface and control of the industrial control system and realizes the data processing algorithm and data processing;
the lower control system consists of an embedded system, a control special integrated circuit and a basic supporting circuit;
the embedded system realizes management scheduling of the control process, processing related control algorithm and hardware driving function; the control special integrated circuit receives the instruction information sent by the embedded system, executes data conversion according to the requirement of the controlled equipment, sends the converted instruction data to the corresponding control circuit, and drives the corresponding execution component of the controlled object to realize corresponding action; meanwhile, the control application specific integrated circuit collects the state information of the controlled object to the embedded control system; the basic supporting circuit comprises an embedded processor, a power supply for controlling the application-specific integrated circuit, a starting circuit, a clock circuit and an external storage circuit;
the basic logic structure unit of the control application specific integrated circuit is characterized by comprising the following components: an SPI reading module SpiRd, an SPI writing module SpiWr, an instruction decoding module DecInstr, a PWM output control module U1PwmDrv, an AD acquisition conversion control module U0MaxDrv, a switching value output module DigOutP, a switching value input module DigInP, a motion instruction queue module mInstr, a motion instruction execution control module ExeInst, and:
XYZ three-axis feeding motion control module U X MtDrv、U Y MtDrv、U Z MtDrv or X/Y/Z/X1/Y1/Z1/W1 seven-axis motion control module U 0 MtDrv~U 6 MtDrv, the function, the logic structure and the realization circuit of the feed motion control module are the same; the W-axis motion control module UwJetMt only requires speed control, and other axes require speed and displacement control and have the requirement of linkage control;
then through adding AD acquisition and conversion control module U 1 Maxdrv increases analog quantity acquisition conversion control, its module circuit and U 0 MaxDrv is the same;
SpiRd and SpiWr jointly realize SPI read-write control;
DigOutP and DigInP realize switching value input/output control;
when the controlled object has 7 feed axes and 1 main motion, U 0 MtDrv~U 6 MtDrv and UwJetMt realize the control of the feed axes of X, Y, Z, X, Y1, Z1 and W1 of the controlled object and the main motion in the W direction;
when the controlled object has 3 feed axes and 1 main motion, U X MtDrv、U Y MtDrv、U Z MtDrv and UwJetMt realize the control of the feed axis of X, Y, Z of the controlled object and the main motion in the W direction;
SpiWr receives MOSI, SCK and NSS signals of the SPI bus, executes data analysis and data discrimination, calculates a command code CMD, command data DInst and a data sequence number DIndx, then sends a calculation result to a DecInstr module, and executes command decoding;
the SpiRd responds to SCK and NSS signals of the SPI bus and sends data in the SPI sending register TBuf to an MISO port of the SPI bus according to a preset time sequence;
the DecInstr receives the instruction data output by the SpiWr, realizes instruction decoding and executes a part of instructions;
a. receiving a motion instruction, calculating a write pointer WrP of an mInstr instruction queue, judging a queue full state QueF, inputting data into the mInstr instruction queue according to the write pointer WrP, and waiting for the instruction to execute the processing of a control module ExeInstr;
b. receiving PWM output, collecting conversion or switching value outputIf the instruction is given, the DecInstr sends the instruction parameters to the corresponding PWM output, acquisition conversion or switching value output module circuit, and starts U1PwmDrv, U0MaxDrv and U 1 The MaxDrv or the DigOutP outputs a preset PWM waveform, starts acquisition and conversion or outputs a specified switching value;
c. receiving switching value input, coordinate acquisition, AD acquisition data acquisition or motion state acquisition instructions, retrieving a corresponding register DIBuf, mtCor, wData1 or MtBsy by the DecInstr, sending the data to an SPI sending register TBuf, and sending the data to an SPI bus by the SpiRd;
the data in the MtCor register is the current coordinate information of each direction, namely U 0 MtDrv~U 6 MtDrv or U X MtDrv、U Y MtDrv、U Z Current coordinates Cor of each direction sent by MtDrv;
the data in the MtBsy register is the current state of each axis, namely U 0 MtDrv~U 6 MtDrv or U X MtDrv、U Y MtDrv、U Z The current busy and idle state Bsy in each direction is sent by the MtDrv;
the DigOutP responds to an enabling signal EnDO sent by the instruction decoding DecInstr and sends the data of the switching value output buffer DObuf to a switching value output port DO of the SPI bus;
the DigInP acquires a switching value input port DI of an SPI bus, sends related input data to a switching value input buffer DIbuf, responds to an enable signal EnDI output by the DecInstr, sends the data of the DIbuf to a sending buffer TBuf of the SpiRd, and finally sends the data of the DIbuf out of the integrated circuit by the SpiRd; u0MaxDrv, U 1 The MaxDrv receives enable signals EnAd and EnAd1 sent by the DecInstr, and generates control signals of mSK, mSK1, mCS and mCS required by an external AD device; at the same time, U 1 MaxDrv and U0MaxDrv dynamically acquire serial data ports DM1 and DM of the SPI bus according to the time sequence requirement of the AD device, and send the obtained conversion data to registers wData1 and wData; then, responding to the acquired data reading instruction by the DecInstr, sending the wData1 and wData data to the TBuf, and sending the wData and wData data to the SPI bus by the SpiRd;
u1PwmDrv responds to an enable signal EnPWM sent by DecInstr and outputs a specified PWM waveform according to a pulse width parameter wDur and an inter-pulse parameter wInt output by DecInstr;
an ExeInstr receives an mInstr write pointer WrP sent by a DecInst, acquires the instruction data of the mInstr, calculates a read pointer RdP, a motion segment end stop mark Stp and an mInstr motion instruction queue empty mark QueE of each motion direction Dr and mInstr, and directly outputs direction control signals of each motion axis of the XYZW or each axis of X/Y/Z/W/X1/Y1/Z1/W1; then, the command speed Spd, the displacement Dis, the moving direction Dr and the moving segment stop mark Stp are sent to the specified U X MtDrv、U Y MtDrv、U Z MtDrv and UwJetMt or U 0 MtDrv~U 6 MtDrv and UwJetMt output corresponding driving pulses xCp, yCp, zCp, x1Cp, y1Cp, z1Cp, w1Cp and wCp to realize corresponding movement; the motion direction of each axis of X/Y/Z/W/X1/Y1/Z1/W1 is also realized by ExeInstr, and the ExeInstr directly outputs the motion direction according to instructions;
when the system is executed to move, the ExeInstr acquires an instruction from an instruction queue mInstr, corrects a queue read pointer pRd and a queue empty mark QueE, acquires and distributes motion parameters, and coordinates and controls the XYZW to execute corresponding motion to a motion control module; a read pointer pRd and a write pointer pWr of the queue mInstr respectively point to 1-word data;
the work cycle of ExeInstr comprises a waiting period t W Moving axis and direction setting period t C0 Parameter setting period t with 1 st to 4 th motion axes C1 -t C5 ;t C1 -t C4 Sequentially corresponding to the control period of the XYZW axis, and divided into a speed setting period t spd Displacement setting period t dis (ii) a Allowing discontinuous writing of the same instruction in consideration of the capacity of the instruction queue; at this time, one or more t are inserted between different parameter setting periods W A waiting period;
period t W 、t C0 、t C4 、t C5 、t spd 、t dis Corresponding to a reference clock CLK period, XYZ-axis set period t C1 、t C2 、t C3 Each including a corresponding speed setting period t spd And a corresponding displacement setting period t dis Setting period t of W C4 Comprising only one speed setting period t spd Without, however, havingPeriod t of displacement setting dis
In the running process of the system, the ExeInstr responds to a reference clock CLK and executes an operation time sequence; CLK till, exeInstr searches an XYZ direction motion busy mark Bsy and an instruction queue mInstr empty mark QueE; queE or Bsy mark in any direction is set, and ExeInstr is inserted into a waiting period t W (ii) a Bsy marks in directions of QueE and XYZ are both '0', exeInstr reads mInstr queue data of 1 word, and execution cycle t ax-dr Acquiring the enabling condition of the movement axis of 1 byte and the direction of the movement axis of 1 byte; then, the ExeInstr module searches the enabling conditions of the XYZW axis from low to high in sequence according to the data bit sequence of the enabling condition bytes of the motion axis according to the instruction format, pulls down the enabling mark En participating in each motion axis in the instruction, prohibits the motion axis of the instruction from acting, and prepares to write in motion parameters; then, the ExeInstr module sequentially retrieves the motion directions of the XYZW axes from low to high according to the data bit sequence of the motion direction bytes and outputs the corresponding motion directions DR according to the instruction format; then, the ExeInstr adds one to the read pointer pRd of the queue mInstr, and compares the read-write pointer pWr with pRd; setting an empty mark QueE of the mInstr when the mInstr and the mInstr are equal, and emptying queue data; otherwise, no processing is performed; finally, the ExeInstr waits for the next CLK clock and enters the motion parameter setting of each axis;
when the motion parameter setting of each axis is executed, the ExeInstr responds to the clock CLK and enters the period t in sequence C1 -t C4 Setting the parameter settings of 1 st to 4 th movement axes at most; enter t C1 T of (a) spd Period, if QueE is set, insert wait period t W (ii) a Otherwise, the ExeInstr searches the D0 bit of the byte of the instruction enabling status, namely the X enabling bit, if the D0 bit is '1', reads 2 bytes of mInstr data, and sends the data into the X speed Spd; then, adding one to the reading pointer pRd, comparing with pWr, modifying the empty mark QueE, and finishing the X speed setting; then, wait for CLK and enter X shift setting t dis (ii) a The X enable bit is '0', directly enters the X displacement setting t dis (ii) a Enter t C1 T of (a) dis Period, queE set, insert t W (ii) a Otherwise, the ExeInstr acquires the D0 bit of the byte of the enabling status, and if the D0 bit is '1', 2 bytes of mInstr data are taken and sent into the X displacement Dis; followed byAdding one to the reading pointer pRd, comparing with pWr, modifying the null mark QueE, and finishing the setting of X displacement; then, wait for CLK and enter t C2 (ii) a The X enable bit is '0', and the period t is directly entered C2 Setting Y-axis parameters;
y, Z axis parameter settings are the same as the X axis;
after the parameter setting of the XYZ axis is finished, entering the ExeInstr into the parameter setting of the W axis; at the moment, the ExeInstr responds to the CLK, and the parameter setting of all motion axes is completed by writing the motion speed of the W axis; then, exeInstr enters t C5 A parameter validation period; when the CLK comes again, the ExeInstr sets the enabling bit of each motion axis of the XYZW according to the enabling status byte of the motion axis of the instruction, namely, starts the motion axis and executes a preset instruction; at the moment, the ExeInstr enters a waiting state, a busy mark of an XYZ axis is adopted according to CLK timing, and when all the idle state exists, the ExeInstr reads the queue mInstr again to obtain and execute a new instruction;
in the system operation process, a module ExeInstr continuously monitors a queue write pointer pWr, a new motion instruction or instruction data is written, pWr changes, and the ExeInstr immediately clears an empty mark QueE to prepare for instruction reading and execution;
the system reconfiguration method of the reconfigurable system comprises the following steps:
when a system is constructed, an SPI reading module SpiRd, an SPI writing module SpiWr, an instruction decoding module DecInstr, a movement instruction queue module and a movement instruction execution control module are respectively provided, and the number of the control modules is one;
the PWM output control module, the AD acquisition conversion control module, the switching value output module, the switching value input module and the W-axis motion control module are all standard reconstruction modules, and the modules are increased according to the requirements of the system on the number of PWM, AD acquisition conversion, switching value input and output and W-axis motion;
feed motion control module U X MtDrv、U Y MtDrv、U Z MtDrv or X/Y/Z/X1/Y1/Z1/W1 seven-axis motion control module U 0 MtDrv~U 6 The MtDrv has the same structure, function and implementation circuit and is a standard reconstruction module; according to the requirement of the number of motion axes of the system, 1 or more motion control modules are used for realizing a plurality of motions;
the system reconstruction process comprises the following steps:
1) The system structure is as follows: determining the number of feed motion, main motion, AD acquisition, PWM and switching value control modules according to the number of feed shafts, the number of main motion, PWM, acquisition conversion and the number requirements of switching value input and output of a system realization structure and the system; the execution component selects a feeding servo motor, a spindle motor, a machine tool body mechanism and an object of the complex multi-axis numerical control system;
2) An instruction system:
the three-axis two-linkage system uses a basic instruction set and a motion instruction execution module ExeInstr controlled by three feed shafts in a linkage manner or a module ExeInstr controlled by 7 feed shafts in a linkage manner;
the three-feed shaft linkage system uses a basic instruction set and an extended instruction set, a motion instruction execution module ExeInstr controlled by the three-feed shaft linkage or a module ExeInstr controlled by a 7-feed shaft linkage;
the complex multi-axis linkage system uses a basic instruction set, an extended instruction set and a 7-feed-axis linkage module ExeInstr;
3) An upper control system: the data processing is finished by combining a standard PC system with special editing and decoding processing software of a multi-axis linkage numerical control system, and the instruction data is transmitted to a lower control system through high-speed communication according to the requirement of an instruction system;
4) Feeding movement: comprises a 1-7-axis feeding motion, which is realized by an X one-way to XYZX1Y1Z1W1 seven-way servo system and a motor universal control module;
5) Cutting main motion:
the main shaft moves, and when the main motion has an accurate rotating speed control requirement or has a speed matching requirement with the feeding motion, the main motion can be realized by a W-direction servo system and a control module;
the requirement on the precision of the rotating speed is not high, and when the requirement on the coordinated control of the rotating speed and the feeding motion is not met, a special PWM control module, an external power amplifier circuit and a corresponding motor are adopted for realizing;
6) A lower control system: the method is realized by a standard embedded system and a one-seven-axis linkage special control program;
when the processing is executed, the special control program receives the basic command, the expansion command and the expansion command, writes the parameters into the special integrated circuit and realizes the motion function of the main shaft and the X unidirectional-XYZX 1Y1Z1W1 seven-direction feed shaft;
the lower control system collects coordinates and strokes at regular time and sends the coordinates and strokes to a standard PC through high-speed communication to realize display updating;
7) Application specific integrated circuit: receiving a feed motion and main motion control instruction sent by a standard embedded system, outputting a motor and a PWM control signal corresponding to XYZWX1Y1Z1W1, and driving an execution component to realize corresponding functions; meanwhile, collecting coordinate and travel switch information, responding to the request of the standard embedded system at regular time and sending out corresponding data information;
8) Inputting a travel switching value: the switching value input module and the corresponding conversion circuit are used for realizing the switching value input; according to the system requirement, increasing the switching value input/output module to expand the switching value;
9) Other switch control requirements: the switching value output module and the corresponding conversion and power amplification circuit are used for realizing the switching value output;
10 Analog detection requirement: the analog quantity acquisition of at most two paths is realized through AD acquisition and conversion control or additional AD acquisition and conversion control and a necessary amplification conversion circuit; according to the system requirements, the number of the expanded analog quantity detection of the AD acquisition and conversion control module is increased;
the complex multi-axis linkage control processing system is constructed by combining the process, and when the more complex industrial production field control is met, the more complex processing control system is constructed by adding the PWM control module, the feed axis control module, the W axis control module and the AD acquisition and conversion control module, properly modifying the data processing and special control program of the upper and lower control systems, properly adding the control instruction, and modifying and executing the ExeInstr module.
2. A reconfigurable system according to claim 1, wherein:
a. the work cycle of the motion instruction execution module ExeInstr controlled by the three feed shafts in a linkage mode comprises a waiting cycle t W Moving axis and direction setting period t C0 Parameter setting period t of 1 st-4 th movement axis C1 -t C5 ;t C1 -t C4 Sequentially corresponding to the control period of the XYZW axis; the control period of XYZ axes is divided into a speed setting period t spd Displacement setting period t dis (ii) a The control period of the W axis is only speed setting, and only speed setting period t spd Without setting the period t dis (ii) a Allowing discontinuous writing of the same instruction in consideration of the capacity of the instruction queue; at this time, one or more t s need to be inserted between different parameter setting periods W A waiting period;
period t W 、t C0 I.e. t ax-dr 、t C4 、t C5 I.e. t enMT 、t spd 、t dis Corresponding to a reference clock CLK period, XYZ-axis set period t C1 、t C2 、t C3 Each including a corresponding speed setting period t spd And a corresponding displacement setting period t dis Setting period t of W C4 Comprising only one speed setting period t spd Without setting the period t dis
b. The working period of the motion instruction execution module ExeInstr under the linkage control of the seven feeding shafts comprises the control of an XYZWX1Y1Z1W1 eight motion shaft, and is consistent with a three-feeding shaft linkage system, and the whole control cycle comprises a waiting period t W Moving axis and direction setting period t C0 Parameter setting period t of each motion axis C1 -t C8 Motion start period t enMT ;t C1 -t C8 Sequentially corresponding to the control period of the XYZWX1Y1Z1W1 axis, the control period of the feed motion axis XYZX1Y1Z1W1 including the speed setting period t spd Displacement setting period t dis (ii) a The control period of the W axis is only speed setting, and only speed setting period t spd Without setting the period t dis (ii) a The system allows for non-sequential writing of the same instruction; at this time, one or more t s need to be inserted between different parameter setting periods W A waiting period;
period t W 、t C0 I.e. t ax-dr 、t C4 、t C9 I.e. t enMT 、t spd 、t dis Corresponding to a period of one reference clock CLK, the setting period t of the XYZX1Y1Z1W1 axis C1 、t C2 、t C3 、t C5 、t C6 、t C7 、t C8 Each including a corresponding speed setting period t spd And a corresponding displacement setting period t dis Setting period t of W C4 Comprising only one speed setting period t spd Without setting the period t dis
c. The seven-feed-shaft linkage control motion instruction execution module ExeInstr is functionally compatible with the three-feed-shaft linkage control motion instruction execution module ExeInstr, namely, the seven-feed-shaft linkage control motion instruction execution module ExeInstr replaces the three-feed-shaft linkage control motion instruction execution module ExeInstr, but the structure is complex.
3. A reconfigurable system according to claim 1, wherein the instruction set of the integrated circuit is:
1) Instruction format and transmission method
The basic constitution of the instruction comprises an instruction code, an instruction parameter and an operation content of the instruction indicated by the instruction code, and occupies 1 byte; the instruction parameter indicates the parameter used by the execution instruction, and the basic instruction set instruction occupies 4-18 bytes;
according to functions and completed operations, system instructions are divided into two types of motion instructions and non-motion instructions, wherein the motion instructions are used for realizing motion required in processing; the non-motion instruction is used for setting processing parameters, acquiring a system state or realizing output and input control except for processing motion;
the instruction transmission is realized by adopting a 16-bit SPI process, and according to the sequence, the embedded control system sequentially transmits instruction codes and instruction parameters to the integrated circuit through the SPI bus in sequence, namely, the instruction transmission is finished; when the embedded control system acquires state and coordinate position data in the execution component and sends a command to the last SPI cycle, the embedded control system receives the requested 16-bit data;
2) Basic instruction set non-motion instructions
The non-motion instruction comprises switching value output, switching value read-in, analog quantity input, PWM output, acceleration setting, coordinate reading and state reading, and the format of the non-motion instruction is defined as follows;
2.1 Output switching value
The switching value output is used for setting 16-bit output switching value, and the basic structure of the command is shown in table 1; the instruction code 17H, the byte 2 and the byte 3 are respectively a high byte DOH and a low byte DOL of 16-bit preset switching value data;
TABLE 1 switching value output instruction Format
Instruction code Byte 1 Byte 2 Byte 3 17H 00H (unused) DOH DOL
When the output switching value is set, the SPI firstly sends out a command code and data 1700H of byte 1, then the SPI sends out 16-bit data consisting of DOH and DOL, and the special integrated circuit outputs 16-bit switching values of which the high-low order bytes are DOH and DOL respectively;
2.2 Input the switching value
The switching value input is used for acquiring state data of 16-bit input switching values, and the basic composition of the instruction is shown in table 2; instruction code 15H, parameter bytes 1, 2, 3 are 00H, XXH and XXH, respectively; wherein XXH is arbitrary data;
TABLE 2 switching value input command Format
Instruction code Byte 1 Byte 2 Byte 3 15H 00H (unused) XXH XXH
When the input switching value is obtained, the SPI firstly sends out an instruction code and data 1500H of byte 1, then the SPI sends out data XXXXH of parameter byte 2 and parameter byte 3, and meanwhile 16-bit state data of the input switching value are received;
2.3 ) enable operation
Enabling operation enables/disables corresponding system devices by pulling up/resetting different flag bits, the basic composition of the instruction is shown in table 3;
TABLE 3 Enable operation instruction Format
Figure FDA0003902614200000051
Instruction code 1BH, parameter bytes 1 and 2 are both 00H; the D0 bit of the byte 3 is used for starting and stopping the acquisition conversion control module U0MaxDrv, 1 bit represents starting/0 represents prohibition, the D1 bit is used for starting/prohibition of the PWM output control module U1PwmDrv, and 1 bit represents starting/0 represents prohibition; the rest bits are reserved for system expansion;
2.4 State acquisition
The state acquisition instruction is mainly used for acquiring the working condition of a system circuit before a system sends out an instruction, so as to avoid misoperation, and the basic composition and related meanings of the instruction are shown in a table 4; instruction code 14H, parameter bytes 1 and 2 are both 00H; the D0, D1 and D2 bits of byte 3 are respectively a busy sign of X, Y, Z moving to the direction of movement, the D3 bit is a busy sign of an acquisition conversion control module, and the D4 and D5 bits are respectively full and empty signs of a movement instruction queue mInstr;
TABLE 4 State get instruction Format
Figure FDA0003902614200000052
Other bits of parameter bytes 1, 2 and parameter byte 3 are temporarily unused and can be used for system expansion;
2.5 Analog input
The input of the analog quantity needs to start acquisition conversion control firstly, and then wait for the acquisition conversion to finish to obtain a conversion result;
2.5.1 Start digital-to-analog conversion: starting digital-to-analog conversion, firstly, according to an enabling operation instruction shown in the table 3, forbidding acquisition conversion, and clearing a conversion result of the last time; then, restarting the module U0MaxDrv, and starting new acquisition and conversion;
2.5.2 Wait for the end of the transition: when the conversion is finished, the system acquires the system state according to the instruction shown in the table 4, the AdBsy is 0, and an analog input result is acquired; otherwise, continuing to wait;
2.5.3 Obtaining an analog quantity: the basic configuration of the analog quantity acquisition instruction is shown in table 5; instruction code 16H, parameter bytes 1, 2, 3 are 00H, XXH and XXH, respectively; wherein XXH is arbitrary data;
TABLE 5 analog get instruction Format
Instruction code Byte 1 Byte 2 Byte 3 16H 00H (unused) XXH XXH
When an input result of the analog quantity is obtained, the SPI firstly sends out 16-bit data 1600H, the high byte is an instruction code 16H, the low byte is a value 00H of a parameter byte 1, then the SPI sends out data XXXXH of a parameter byte 2 and a parameter byte 3, and simultaneously the low 12 bits of the 16-bit data are input analog quantity to be obtained;
2.6 PWM parameter setting and output instruction
The PWM parameter setting and output instruction comprises three types of PWM pulse interval setting, pulse width setting and PWM output, and is respectively used for pulse interval of PWM waveform, pulse width parameter setting and output of specified PWM waveform;
2.6.1 PWM inter-pulse setting: the inter-pulse parameter is set to unit μ s, and the basic composition of the command is shown in table 6; the instruction code 19H, the byte 2 and the byte 3 are respectively an upper eight-bit wPulIntH and a lower 8-bit wPulIntL of a set value of wPulInt between pulses;
TABLE 6 PWM Interpulse set instruction Format
Instruction code Byte 1 Byte 2 Byte 3 19H 00H (unused) wPulIntH wPulIntL
When the setting between the PWM pulses is executed, the SPI firstly sends out an instruction code and data 1900H of byte 1, and then sends out 16-bit parameters between the pulses consisting of wPulIntH and wPulIntH, so as to realize the setting between the PWM pulses;
2.6.2 PWM pulse width setting: the basic configuration of the pulse width parameter setting command is shown in table 7; the instruction code 1AH, byte 2 and byte 3 are respectively the upper eight-bit wPulDurH and the lower 8-bit wPulDurL of the set value of wPulDur between pulses;
TABLE 7PWM pulse Width setting instruction Format
Instruction code Byte 1 Byte 2 Byte 3 1AH 00H (unused) wPulDurH wPulDurL
The difference between the pulse width setting method and the setting between pulses is only that the instruction codes are different;
2.6.3 PWM waveform output: the PWM waveform output is completed by enabling an operation instruction, and the instruction format is shown in a table 3; after setting parameters between pulse width and pulse, the SPI firstly sends out an enabling operation code and a data byte 1B00H; then, setting the PWM enabling position by the external processor, and recalculating the parameter byte 3; finally, the external processor sends the parameter byte 200H and the calculated parameter byte 3 to the application specific integrated circuit through the SPI, and outputs a predetermined PWM waveform;
2.7 Acceleration setting
Acceleration setting is used for setting acceleration parameters of XYZ-direction movement, so that instructions are simplified, the same acceleration is adopted for three-axis movement, and the basic composition of the instructions is shown in a table 8;
TABLE 8 Accelerator setting Command Format
Instruction code Byte 1 Byte 2 Byte 3 18H 00H (unused) mAccH mAccL
The instruction code 18H, the byte 2 and the byte 3 are respectively a high byte mACCH and a low byte mACCL of 16-bit preset acceleration;
2.8 Coordinate reading)
Coordinate reading comprises acquiring XYZ coordinate data, wherein a W axis only rotates forwards or reversely, and no coordinate control requirement exists; the basic composition of the instruction is shown in table 9; the instruction codes obtained by XYZ coordinates are 11H, 12H and 13H respectively, and the parameter bytes 1, 2 and 3 are 00H, XXH and XXH respectively; wherein XXH is arbitrary data;
TABLE 9 coordinate READ COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 11H/12H/13H 00H (unused) XXH XXH
When coordinate information is acquired, the SPI firstly sends out data 1100H, 1200H or 1200H of an instruction code and byte 1 according to requirements, then sends out 16-bit data XXXXH formed by parameter byte 2 and byte 3, and simultaneously receives corresponding 16-bit coordinate data;
3) Basic instruction set motion instruction
3.1 General format of motion commands
The machining motion types comprise one-way motion, two-axis linkage and XYW three-axis linkage; wherein, the unidirectional movement is divided into X, Y, Z and W-direction movement; the two-axis linkage is divided into XY, YW and XW linkage motion; the motion instructions also correspond to the motion classifications one by one, and the format is shown in table 10;
TABLE 10 motion instruction general Format
Figure FDA0003902614200000061
The instruction code 10H, the parameter byte 1 is not used, the parameter byte 2 is the enabling state of the motion axis, D0-D4 are X, Y, Z and set to be '1' if W moves or not in sequence, and the motion axis moves; conversely, the motion axis does not participate in the motion; the parameter byte 3 is the instruction movement direction, D0-D4 are the movement directions of X, Y, Z and the W axis in sequence, set to be '1', and the movement axis moves in the negative direction; conversely, the motion axis moves in the positive direction;
parameter bytes 4 and 5 are 16-bit instruction speed of motion, unit: step/s; parameter bytes 6 and 7 are 16-bit instruction displacements of motion, in units of: step (2); sequentially distributing the parameters to X, Y, Z or W shafts participating in movement according to the sequence, wherein W only sets the movement speed and has no displacement parameter;
3.2 ) one-way motion instruction
The unidirectional motion has 8 conditions of forward motion and reverse motion of a X, Y, Z, W shaft:
3.2.1 X unidirectional motion: the structure of the X unidirectional motion command is shown in table 11; the instruction code 10H, the parameter byte 1 is not used, the parameter byte 2 is 01H, and the movement is indicated as X-axis movement; the parameter byte 3 indicates the direction of motion, 00H is positive motion, and 01H is negative motion; parameter bytes 4-5 specify a 16-bit movement speed in units of "steps", and parameter bytes 6-7 specify a 16-bit movement displacement amount in units of "steps";
TABLE 11X Axis unidirectional motion Command Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 10H 00H (unused) 01H 00H positive/01H negative 16 bit instruction speed 16 bit instruction displacement
3.2.2 Y unidirectional motion: the instruction structure is shown in table 12; the instruction code 10H, the parameter byte 1 is not used, the byte 2 is 02H, and the Y-axis motion is designated; byte 3 is 00H, Y is moving forward; 02H, negative Y motion; bytes 4-5 and 6-7 specify 16 bit speed and displacement, respectively;
TABLE 12Y Axis UNIDIRECTIONAL MOTION COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 10H 00H (unused) 02H 00H positive/02H negative 16 bit instruction speed 16 bit instruction displacement
3.2.3 Z unidirectional motion: the instruction structure is shown in table 13; parameter byte 2 is 04H, and Z-axis motion is specified; parameter byte 3 is 00H, and Z axis positive motion; 04H, Z-negative movement; the parameter bytes 4-5 and 6-7 specify 16-bit speed and displacement, respectively;
TABLE 13Z Axis Unidirectionally moving Command Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 10H 00H (unused) 04H 00H positive/04H negative 16 bit instruction speed 16 bit instruction displacement
3.2.4 W unidirectional motion: the instruction structure is shown in table 14; parameter byte 2 is 08H, specifying W-axis motion; parameter byte 3 is 00H, and the W axis rotates in the positive direction; is 08H, W is negatively rotated; the parameter bytes 4-5 specify the 16-bit movement speed/frequency of the W axis, and the W axis only executes rotation speed control and does not execute angular displacement control;
TABLE 14W Axis Unidirectionally moving Command Format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 10H 00H (unused) 08H 00H positive/08H negative 16 bit instruction speedDegree of rotation
3.3 Two-axis linkage control command
The device is used for XY diagonal motion or X/Y unidirectional track, and is divided into 3 types of linkage of XY, YW and XW according to a motion axis;
3.3.1 XY linkage: the XY axis coordinated control command structure is shown in table 15; the command code is still 10H, parameter byte 2 is 03H, indicating that the motion axis is X, Y; the parameter byte 3 indicates the movement direction, and the parameters 00H-03H sequentially indicate positive-direction Y positive-direction X, negative-direction Y positive-direction X, positive-direction Y negative-direction X and negative-direction Y negative-direction X;
table 15 XY axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 10H 00H (unused) 03H 00H-03H 16 bit X speed 16 bit X shift 16 bit Y speed 16 bit Y shift
The parameter bytes 4-5 and 6-7 sequentially specify 16-bit movement speed and displacement in the X direction, and the parameter bytes 8-9 and 10-11 respectively specify 16-bit movement speed and displacement in the Y direction;
3.3.2 YW linkage: the structure of the YW axis linkage control command is shown in Table 16; parameter byte 2 is 0AH, indicating axis of motion Y, W; the parameters 00H, 02H, 08H and 0AH of the parameter byte 3 sequentially designate the instruction movement directions of positive Y-direction W, negative Y-direction W, positive Y-direction W, negative Y-direction W and negative Y-direction W;
table 16 YW axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 10H 00H (unused) 0AH 00H、02H、08H、0AH 16 bit Y speed 16 bit Y shift 16 bit W speed
The parameter bytes 4-5 and 6-7 sequentially specify the 16-bit movement speed and displacement in the Y direction, and the parameter bytes 8-9 specify the 16-bit movement speed in the W direction;
3.3.3 XW linkage: the XW shaft linkage control instruction structure is shown in Table 17; parameter byte 2 is 09H, indicating axis of motion is X, W; the parameters 00H, 01H, 08H and 09H of the parameter byte 2 sequentially designate the instruction movement directions of X positive direction W positive direction, X negative direction W positive direction, X positive direction W negative direction and X negative direction W negative direction;
TABLE 17 XW Axis coordinated control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 10H 00H (unused) 09H 00H、01H、08H、09H 16 bit X speed 16 bit X shift 16 bit W speed
The parameter bytes 4-5 and 6-7 sequentially specify the 16-bit movement speed and displacement in the X direction, and the parameter bytes 8-9 specify the 16-bit movement speed in the W direction;
3.3.4 XYW triaxial linkage control instruction
For the XY diagonal trajectory, the instruction structure is shown in Table 18; the command code is still 10H, parameter byte 2 is 0BH, indicating axes of motion are X, Y and W; the parameter byte 3 indicates the movement direction, and the parameters 00-03H and 08-0BH sequentially indicate the movement of X positive direction Y positive direction W positive direction, X negative direction Y positive direction W positive direction, X positive direction Y negative direction W positive direction, X negative direction Y negative direction W positive direction, X positive direction Y positive direction W negative direction, X negative direction Y negative direction W negative direction, X positive direction Y negative direction W negative direction, and X negative direction Y negative direction W negative direction;
TABLE 18 XYW THREE-AXIS LINKAGE CONTROL COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 10H 00H (unused) 0BH 00-03H,08-0BH X speed X displacement Speed of Y Y displacement W speed
The parameter bytes 4-5 and 6-7 sequentially specify 16-bit movement speed and displacement in the X direction, the parameter bytes 8-9 and 10-11 respectively specify 16-bit movement speed and displacement in the Y direction, and the parameter bytes 12-13 specify 16-bit movement speed in the W direction;
4) Extended instruction set
4.1 Two-axis linkage extended command
According to the motion axes involved, the two-axis linkage extension is divided into 4 types of YZ and XZ axis linkage, and a reference basic instruction set is defined in a related way;
(1) YZ linkage:
table 19 YZ axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 10H 00H (unused) 06H 00/02/04/06H (Direction control) 16 bit Y speed 16 bit Y shift 16 bit Z velocity 16 bit Z displacement
(2) XZ linkage:
table 20 XZ axle linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 10H 00H (unused) 05H 00/01/04/05H (Direction control) 16 bit X speed 16 bit X shift 16 bit Z velocity 16 bit Z displacement
4.2 Three-axis linkage extension instruction
(1) XYZ linkage:
table 21 XYZ three-axis linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 Bytes 14-15 10H 00H (unused) 07H 00-07H (Direction control) X speed X displacement Y speed Y displacement Z velocity Z displacement
(2) XZW linked:
TABLE 22 XZW THREE-AXIS LINKAGE CONTROL COMMAND FORMAT
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 10H 00H (unused) 0DH Direction control X speed X displacement Z velocity Z displacement W speed
(3) YZW linkage:
table 22 YZW three-axis linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 10H 00H (unused) 0EH Direction control Speed of Y Y displacement Z velocity Z displacement W speed
4.3 Four-axis linkage extended command
Table 23 XYZW four-axis linkage control instruction format
Instruction code Byte 1 Byte 2 Byte 3 Bytes 4-5 Bytes 6-7 Bytes 8-9 Bytes 10-11 Bytes 12-13 Bytes 14-15 Bytes 14-15 10H 00H 0FH Direction control X speed X displacement Speed of Y Y displacement Z velocity Z displacement W speed
5) Extended instruction set
5.1 Non-motion augmentation instruction
(1) An expansion enable operation: the expansion enabling operation is compatible with the enabling operation of the basic instruction, and the additional AD acquisition and conversion control U is expanded 1 Enable control bits for MaxDrv, as shown in table 24;
table 24 extended enable operation instruction format
Figure FDA0003902614200000091
The D0 and D1 bit functions of byte 3 are unchanged, D0 is the EnAd of U0MaxDrv, 1 represents Enable/0 represents Disable, D1 is the EnPwm of U1PwmDrv, 1 represents Enable/0 represents Disable; d2 is newly added with an AD control module U 1 EnAd1 is enabled for MaxDrv, and the rest bits are reserved;
(2) An extended state acquisition instruction: compatible with the state acquisition instruction of the basic instruction, and expanded with an additional AD control module U 1 Busy status flags for MaxDrv, X1, Y1, Z1, and W1, as shown in table 25;
TABLE 25 extended state acquire instruction Format
Figure FDA0003902614200000092
D0-D5 of byte 3 are unchanged, X, Y, Z axes, U respectively 0 MaxDrv busy flag, empty and full flags of queue mlstr; d6 and D7 are busy signs of x1 and y1 respectively; byte 2 with D0 as the z1 busy flag and D1 as the additional AD acquisition and conversion control U 1 Busy flag of MaxDrv;
(3) Additional analog quantity acquisition instruction: the basic configuration of the additional analog quantity acquisition instruction is shown in table 26; instruction code 16H, parameter bytes 1, 2, 3 are 00H, XXH and XXH, respectively; wherein XXH is arbitrary data;
table 26 additional analog fetch instruction format
Instruction code Byte 1 Byte 2 Byte 3 26H 00H (unused) XXH XXH
(4) An extended coordinate reading instruction: comprises X, Y, Z, X, Y1, Z1 and W1 to coordinate data acquisition, the basic composition of the instruction is shown in Table 27; XYZ coordinate acquisition instruction codes 11-13H, X1, Y1, Z1 and W1 coordinate acquisition instruction codes 21-24H;
table 27 coordinate read instruction format
Instruction code Byte 1 Byte 2 Byte 3 11-13H/21-24H 00H (unused) XXH XXH
5.2 Extend the motion instruction
The extended motion instruction is compatible with the basic motion instruction and the extended motion instruction, and simultaneously extends the directional motion of X1, Y1, Z1 and W1, and the instruction format is shown in a table 28;
table 28 motion instruction generic format
Figure FDA0003902614200000093
Byte 2, high 4 bits D4-D7 are X1, Y1, Z1 and W1 enable status, D0-D4 remain unchanged, and whether XYZW is moving or not; byte 3 high 4 bits D4-D7 are the X1, Y1, Z1 and W1 motion directions; D0-D4 are unchanged and are X, Y, Z and the W axis in sequence; the 2 nd to 7 th words of the motion instruction are the 1 st to 3 rd motion axis speed and the displacement parameter in sequence; the 8 th word is the speed of the 4 th motion axis W; the 9 th to 16 th are the 5 th to 8 th shaft speeds and displacements in sequence;
the motion instruction is the condition that all motion axes of the system participate in motion, and when the system axes do not participate in motion, the motion instruction parameters are subjected to frequency division motion parameters in sequence according to the sequence of X, Y, Z, W, X, Y1, Z1 and W1; other methods of use of the movement instructions are consistent with the basic instructions;
in the control-specific integrated circuit (ASIC),
U 0 MtDrv~U 6 the MtDrv, the 7 modules realize the processing and feeding actions of the X, Y, Z, X1, Y1, Z1 and W1 of the controlled object;
the UwJetMt module realizes the control of the W-direction movement of the controlled component, and the W-direction movement only executes speed control without displacement or rotation angle control;
when executing processing motion control, exeInstrProgram coordination and management and control U 0 MtDrv~U 6 MtDrv and UwJetMt, which drive the corresponding executing mechanism of the executing component to realize corresponding operation;
the control of the feeding actions of X, Y, Z, X1, Y1, Z1 and W1 is divided into brake control of motion, speed-up control of motion, speed-down control of motion and uniform control of motion.
4. A reconfigurable system according to claim 3, wherein
X, Y, Z, X1, Y1, Z1 and W1 are given by motion control command in motion direction, and output directly via ExeInstr; the driving pulse of the movement is provided by U 0 MtDrv~U 6 The 7 modules MtDrv are implemented respectively;
the 7 modules respectively receive the motion acceleration Acc sent by a reference clock CLK and a DecInstr, the command speed SpdI sent by an ExeInstr, the command displacement Dis, the motion enable G, the motion direction DR and a stop mark bStp after the end of the segment, and respectively output a driving pulse CP of a corresponding axis, a current coordinate Coor of the motion direction and a busy motion mark Bsy;
U 0 MtDrv~U 6 the MtDrv comprises a motion control clock submodule Ck10KP, a state conversion control submodule StaCon, a brake displacement calculation submodule CalDis, a displacement operation submodule DisCtrl, a driving pulse submodule CPGen and a speed counting calculation submodule CalCnt;
ck10KP uses reference clock CLK to realize the control clock signal Ck10K of the feed motion;
StaCon collects and outputs feed motion control parameters, executes speed, displacement discrimination and state conversion, and realizes the whole process control of feed motion;
CalCnt obtains the current movement speed, and calculates the corresponding speed meter value tSpdCnt according to the driving pulse principle;
the CPGen acquires a speed count value and sends out a matched driving pulse to drive a servo motor so as to realize movement;
the DisCtrl samples the driving pulse of the servo motor and calculates the current displacement;
the CalDis obtains the braking speed when the current moving shaft does not participate in the movement of the next instruction, and calculates the braking displacement of the current feeding movement;
the U is 0 MtDrv~U 6 The logic implementation of these 7 modules of MtDrv includes:
1) Controlling the clock submodule Ck10KP
According to the control requirements of the movement speed and precision of the three-dimensional printing and numerical control system, a 1MHz active crystal oscillator is selected by a system reference clock CLK, the system control period is 10 microseconds, the control clock frequency is set to be 100KHz, and the control is realized through Ck10 KP;
ck10KP receives the reference clock CLK of the system, and executes 10 frequency division to the CLK clock to obtain a 100KHz control clock signal Ck10K;
2) StaCon sub-module for state transition control
StaCon realizes the conversion and control of motion state, exeInstr sets the motion enable G, staCon starts the motion process and executes the conversion control of motion state, and the basic process comprises the motion preparation and the control of motion process;
(1) Preparing for exercise: the method comprises the steps of A, judging the motion type, and B, setting initial parameters;
A. starting the motion, acquiring the acceleration data Acc sent by the DecInstr, the instruction speed SpdI, the displacement Dis, the direction DR and the stop mark bStp after the current segment is ended from the motion execution control module ExeInstr by the StaCon, comparing the current speed Spd with the instruction speed SpdI, and executing the motion acceleration and deceleration type judgment and the brake judgment by combining the stop mark bStp after the motion is ended;
B. setting initial parameters, finishing the motion discrimination, sending the Spd into a CalCnt by the StaCon, and calculating a current speed count value; if the movement is stopped after finishing, sending SpdI serving as a braking speed BrkSpd into CalDis, and calculating braking displacement; then, the StaCon sets a corresponding motion speed increasing and decreasing control state, an enabling CPGen and a setting motion busy sign Bsy according to the motion speed increasing and decreasing type;
(2) Controlling the motion process: the motion process control comprises motion end judgment and motion state conversion;
A. judging the end of the exercise: in the process of movement, staCon continuously samples DisCtrl, current displacement iDisCur is obtained, command displacement Dis is reached, a module clears a busy movement mark Bsy, and movement is finished; if the Dis is not reached, switching to the motion state;
B. and (3) motion state conversion:
a) Speed control, namely, the control clock Ck10K is up, staCon samples CalCnt are output, a count value tSpdCnt is obtained and is sent to the CPGen as SpdCnt, and then state processing is carried out;
b) State processing, then, staCon performs motion state processing;
a. when the motion is in brake control, the acceleration selection-Acc and StaCon call a formula (10), acceleration integration is executed, the motion speed Spd is recalculated, the Spd is sent to CalCnt, and a count value tSpdCnt is calculated for the next use;
b. the motion is in acceleration control, if Spd is smaller than SpdI, the acceleration is selected Acc, staCon calls a formula (10), acceleration integration is executed, the speed Spd is recalculated and sent to CalCnt, and a count value tSpdCnt is calculated for the next use; if the Spd is larger than or equal to SpdI, the movement is switched to the constant speed control;
c. the movement is in deceleration control, if Spd is larger than SpdI, the acceleration is selected to-Acc, staCon calls a formula (10), acceleration integration is executed, the movement speed Spd is recalculated and sent to CalCnt, and a counting value tSpdCnt is calculated for the next use;
d. if bStp = '1', the current motion is finished, the motion of the axis is stopped, staCon collects the current displacement iDisCur sent by DisCtrl, the residual displacement is less than or equal to RemDis, and the motion is switched to brake control;
c) The speed calculation method comprises the following steps:
a. principle of velocity calculation
Setting a speed unit 'step/s', an acceleration unit 'mm/s', setting a motion step equivalent of 0.01mm, setting an integration period delta t consistent with the selection of a motion control period to be 10 mu s, and setting the speed v at the moment k according to a formula (4) k Can be expressed as:
Figure FDA0003902614200000111
definition of integral remainder sigmaMa k ,sigMa k Is an integral
Figure FDA0003902614200000112
For the remainder of divisor 1000, equation (6) evolves to:
Figure FDA0003902614200000113
wherein int is the rounding operation, rm is the decimal operation, and the parameter Spd is defined k
Figure FDA0003902614200000114
Since there is no decimal value for the speed in steps/s, spd k The actual motion speed at time k:
Figure FDA0003902614200000115
b. formula for calculation
Summarizing equations (6) - (9), the velocity calculation is implemented using equation (10), where the Rem () operation is a modulo 1000 operation:
Figure FDA0003902614200000116
c. calculation process
When performing acceleration integration, first calculate sum formula sigmaMa K-1 +a k-1 The result is; formula of calculation
Figure FDA0003902614200000117
By adding the formula sigmaMa K-1 +a k-1 The calculation result of (2) is right shifted by 10 bits; calculating Rem (sigMa) k-1 +a k-1 ) In time, directly taking and summing type sigmaMa K-1 +a k-1 The lower 10 bits of the result;
3) Caldis sub-module for calculating brake displacement
CalDis obtains the acceleration Acc sent by DecInstr and the braking speed BrkSpd sent by StaCon to calculate the braking displacement, and according to a formula (5), the braking displacement RemDis is calculated;
CalDis comprises a multiplying circuit with 12 bits, a de-multiplying circuit with 24 bits dividend and a de-multiplying circuit with 13 bits divisor; the multiplying circuit executes square operation of 12-bit speed, the speed value is 0-4000 steps/s, namely 0-40mm/s, and 12-bit data are occupied; the division circuit realizes the division operation of the sum of the square of the speed of 24 bits and the acceleration of 13 bits; 1/2 in the formula (5) is realized by logic right shift and is not completed by a special neutralization circuit;
4) Calcnt sub-module for calculating velocity count
(1) Principle of implementation
The motion control counts a reference clock by using a speed meter value, and pulls up/clears a pulse output port of a motion control motor at fixed time to realize the pulse width and pulse interval of equidistant driving pulses of the servo motor; assuming a speed of motion v, in units of "steps/s", the frequency f of the reference clock CLK CLK Then the speedometer value k C Comprises the following steps:
k c =f CLK /2v (11)
according to the principle of the formula (11), calCnt acquires the current speed Spd sent by the state transition control StaCon, calculates the corresponding count value tSpdCnt, and returns the count value tSpdCnt to the StaCon for standby; setting the equivalent of motion step of 0.01mm and the frequency f of reference clock CLK CLK Setting 1MHz, determining the count value tsspdcnt as:
tSpdCnt=5×10 5 /Spd (12)
(2) Implementation procedure
Calcnt calculates the velocity count value tSpdCnt by using a standard neutralization circuit with a 20-bit dividend and a 12-bit divisor, wherein the dividend is a fixed value of 5 × 10 in the above formula 5 The divisor is the 12-bit speed Spd;
5) Displacement operation submodule DisCtrl
The DisCtrl samples a driving pulse internal signal iCP output by the CPGen and performs counting operation on the driving pulse internal signal iCP, calculates the instant displacement iDisCur of the movement, and then sends the displacement iDisCur into a state conversion control StaCon to realize the state control of the movement;
meanwhile, the DisCtrl is combined with the motion direction DR sent by the ExeInstr to calculate the current coordinate value Coor of DR motion as U 0 MtDrv~U 6 The outputs of the three modules MtDrv;
6) Drive pulse submodule CPGen
The sub-module CPGen outputs a servo motor driving pulse CP to drag the servo motor to realize movement; the CPGen receives and responds to an enabling mark CPEn sent by the state conversion control submodule StaCon, counting operation is carried out on a 1MHz reference pulse CLK, a pulse counting value SpdCnt is reached, the output of the module is inverted, and a new round of counting is restarted; the motor driving pulse is realized by the reciprocating circulation;
CPGen simultaneously sends the homologous signal iCP of CP to the displacement operator module DisCtrl, and carries out displacement and coordinate calculation; staCon timely monitors the displacement and coordinate operation result, and when the instruction displacement is reached, CPEn can be forbidden, and the current motion is finished.
5. A reconfigurable system according to claim 4, wherein UwJetMt only requires speed and direction control of motion; the direction signal of the W axis is given by a motion instruction and is directly output through ExeInstr, the motion control of the W axis to the corresponding motor is composed of a speed counting calculation submodule CalCnt and a driving pulse submodule CPEn, and the realization principle and the function of the speed counting calculation submodule CalCnt and the driving pulse submodule CPEn are the same as those of the feeding control;
CalCnt obtains the W-axis movement speed Spd sent by ExeInstr, calculates a pulse count value SpdCnt and sends the pulse count value SpdCnt to a driving pulse CPGen; controlled by a W-axis motion enabling signal G sent by the ExeInstr, CPGen generates a motion driving pulse signal CP with a corresponding frequency.
6. A reconfigurable system according to claim 5, wherein ExeInstr coordinates control of U 0 MtDrv~U 6 The MtDrv and UwJetMt are linked to realize the linkage motion of each shaft, including the linkage of the linear motion and the space curve motion of two shafts, three shafts, four shafts and shafts more than four shafts;
a. linear linkage
1) Data preprocessing:
the control circuit receives a motion command containing the speed and displacement of each linkage shaft through an SPI bus;
2) Linkage execution:
acquiring instruction parameters by the ExeInstr, simultaneously resetting the enabling bits of the XYZW linkage shafts in the enabling register according to the sequence numbers of the linkage shafts, and forbidding the action of each linkage shaft; then, the ExeInstr acquires the motion direction of each linkage shaft and sets a direction control signal participating in linkage of each shaft; then, writing the ExeInstr into the speed and displacement parameters participating in linkage of each shaft according to the instruction data; finally, the ExeInstr simultaneously sets the enabling positions of the XYZW linkage shafts in the enabling register again, takes effect of the motion parameters and starts linkage motion;
3) The linkage principle is as follows:
when linkage control is executed, the control modules U of all the shafts are linked 0 MtDrv~U 6 MtDrv and UwJetMt use the same reference clock CLK with-1 MHz, and each step of action of a motion motor is controlled by dividing frequency of the CLK, so that the linkage displacement of each shaft participating in linkage can be realized at a specified speed and at a specified time, and the requirements of the speed, the displacement and the track of the linkage motion are met;
4) Realizing two-dimensional oblique line linkage:
according to the scanning component speed and component displacement data of a X, Y shaft, an ExeInstr module firstly prohibits XY motion and acquires and sets XY direction signals; then, writing the speed and displacement of XY respectively; finally, the ExeInstr simultaneously starts the XY motion again, namely the diagonal scanning of XY at any angle is realized;
b. spatial curvilinear motion linkage
The motion trail of the space curve is approximated by a plurality of sections of space straight lines, and coarse interpolation and fine interpolation are realized;
1) Data preprocessing:
when coarse interpolation is executed, in combination with control precision, an upper computer firstly disperses a space curve into a series of space straight-line segments, respectively calculates the motion speed, displacement and direction parameters of each axis, and forms a series of space straight-line motion instructions according to an instruction format to complete coarse interpolation; then, the lower control system where the control band circuit is located realizes space curve motion, namely 'fine interpolation';
2) Linkage execution:
the control circuit continuously receives linear motion instructions of linear segments of each section of space through an SPI bus and stores the linear motion instructions into an mInstr; responding to a control clock Ck10K, reading mInstr by the ExeInstr, acquiring a linear motion instruction sequence, and executing each linear motion instruction one by one according to the motion sequence of prohibiting a motion axis, writing motion parameters and restarting the motion axis, namely realizing the preset space curvilinear motion, namely fine interpolation.
7. A method for reconfiguring a system in a reconfigurable system according to claim 1, characterized in that the reconfiguration method is
When a system is constructed, an SPI reading module SpiRd, an SPI writing module SpiWr, an instruction decoding module DecInstr, a motion instruction queue module and a motion instruction execution control module are respectively provided, and the number of the control modules is one;
the PWM output control module, the AD acquisition conversion control module, the switching value output module, the switching value input module and the W-axis motion control module are all standard reconstruction modules, and the modules are increased according to the requirements of the system on the number of PWM, AD acquisition conversion, switching value input and output and W-axis motion;
feed motion control module U X MtDrv、U Y MtDrv、U Z MtDrv or X/Y/Z/X1/Y1/Z1/W1 seven-axis motion control module U 0 MtDrv~U 6 The MtDrv has the same structure, function and realization circuit and is a standard reconstruction module; according to the requirement of the number of motion axes of the system, 1 or more motion control modules are used for realizing a plurality of motions;
the system reconstruction process comprises the following steps:
1) The system structure is as follows: determining the number of feed motion, main motion, AD acquisition, PWM and switching value control modules according to the number of feed shafts, the number of main motion, PWM, acquisition conversion and the number requirements of switching value input and output of a system realization structure and the system; the execution component selects a feeding servo motor, a spindle motor, a machine tool body mechanism and an object of the complex multi-axis numerical control system;
2) An instruction system:
the three-axis two-linkage system uses a basic instruction set and a motion instruction execution module ExeInstr controlled by three feed shafts in a linkage manner or a module ExeInstr controlled by 7 feed shafts in a linkage manner;
the three-feed shaft linkage system uses a basic instruction set and an extended instruction set, a motion instruction execution module ExeInstr controlled by the three-feed shaft linkage or a module ExeInstr controlled by a 7-feed shaft linkage;
the complex multi-axis linkage system uses a basic instruction set, an extended instruction set and a 7-feed-axis linkage module ExeInstr;
3) An upper control system: the data processing is finished by combining a standard PC system with special editing and decoding processing software of a multi-axis linkage numerical control system, and the instruction data is transmitted to a lower control system through high-speed communication according to the requirement of an instruction system;
4) Feeding movement: comprises a 1-7-axis feeding motion, which is realized by an X one-way to XYZX1Y1Z1W1 seven-way servo system and a motor universal control module;
5) Cutting main motion:
the main shaft moves, and when the main motion has an accurate rotating speed control requirement or has a speed matching requirement with the feeding motion, the main motion can be realized by a W-direction servo system and a control module;
the requirement on the precision of the rotating speed is not high, and when the requirement on the precision of the rotating speed and the feeding motion is not met, the special PWM control module, the external power amplifier circuit and the corresponding motor are adopted for realizing;
6) A lower control system: the method is realized by a standard embedded system and a one-seven-axis linkage special control program;
when the processing is executed, the special control program receives the basic command, the expansion command and the expansion command, writes the parameters into the special integrated circuit and realizes the motion function of the main shaft and the X unidirectional-XYZX 1Y1Z1W1 seven-direction feed shaft;
the lower control system collects coordinates and strokes at regular time and sends the coordinates and strokes to a standard PC through high-speed communication to realize display updating;
7) Application specific integrated circuit: receiving a feed motion and main motion control instruction sent by a standard embedded system, outputting a motor and a PWM control signal corresponding to XYZWX1Y1Z1W1, and driving an execution component to realize corresponding functions; meanwhile, collecting coordinate and travel switch information, responding to the request of the standard embedded system at regular time and sending out corresponding data information;
8) Inputting a travel switching value: the switching value input module and the corresponding conversion circuit are used for realizing the switching value input; according to the system requirement, increasing the switching value input/output module to expand the switching value;
9) Other switch control requirements: the switching value output module and the corresponding conversion and power amplification circuit are used for realizing the switching value output;
10 Analog detection requirement: the analog quantity acquisition of at most two paths is realized through AD acquisition and conversion control or additional AD acquisition and conversion control and a necessary amplification conversion circuit; according to the system requirements, the number of the expanded analog quantity detection of the AD acquisition and conversion control module is increased;
the complex multi-axis linkage control processing system is constructed by combining the process, and when the more complex industrial production field control is met, the more complex processing control system is constructed by adding a PWM (pulse width modulation) control module, a feed shaft control module, a W (Central processing) shaft control module and an AD (analog-to-digital) acquisition and conversion control module, properly modifying a data processing and special control program of an upper and lower control system, properly adding a control instruction, and modifying and executing an ExeInstr control module.
8. The system reconfiguration method according to claim 7, wherein the characteristic is
The three-axis two-linkage system comprises an FDM or other three-dimensional printing, drilling or planing machine system;
the three-feed-shaft linkage system comprises a milling machine or a lathe system;
the complex multi-axis linkage system includes more than 3-axis feeds, multiple analog acquisition, or multiple power control systems.
CN201911403078.7A 2019-12-31 2019-12-31 Reconfigurable system and reconfigurable method for multi-axis linkage numerical control Active CN111026041B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911403078.7A CN111026041B (en) 2019-12-31 2019-12-31 Reconfigurable system and reconfigurable method for multi-axis linkage numerical control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911403078.7A CN111026041B (en) 2019-12-31 2019-12-31 Reconfigurable system and reconfigurable method for multi-axis linkage numerical control

Publications (2)

Publication Number Publication Date
CN111026041A CN111026041A (en) 2020-04-17
CN111026041B true CN111026041B (en) 2022-12-13

Family

ID=70199940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911403078.7A Active CN111026041B (en) 2019-12-31 2019-12-31 Reconfigurable system and reconfigurable method for multi-axis linkage numerical control

Country Status (1)

Country Link
CN (1) CN111026041B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112015118A (en) * 2020-08-31 2020-12-01 浙江水晶光电科技股份有限公司 Method and device for controlling movement of automation equipment, controller and storage medium
CN113238518B (en) * 2021-05-06 2024-04-09 上海御微半导体技术有限公司 Motion control system and driver switching method
CN113359124B (en) * 2021-05-20 2024-02-23 陕西长岭电子科技有限责任公司 Airborne hover indicator

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BE819415A (en) * 1973-09-06 1974-12-16 MAIN COOLING PUMP FOR NUCLEAR REACTORS
CN106426941A (en) * 2016-11-18 2017-02-22 中南大学 Orthogonal decomposition motion control method and device for extrusion head of 3D printing machine
WO2018072034A1 (en) * 2016-10-21 2018-04-26 Mosaic Manufacturing Ltd. Joiners, methods of joining, and related systems for additive manufacturing
CN108819228A (en) * 2018-08-17 2018-11-16 南京工程学院 A kind of FDM 3 D-printing control system
CN110465422A (en) * 2019-08-29 2019-11-19 内蒙古大学 A kind of flush coater kinetic control system and its motion control method based on FPGA

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BE819415A (en) * 1973-09-06 1974-12-16 MAIN COOLING PUMP FOR NUCLEAR REACTORS
WO2018072034A1 (en) * 2016-10-21 2018-04-26 Mosaic Manufacturing Ltd. Joiners, methods of joining, and related systems for additive manufacturing
CN106426941A (en) * 2016-11-18 2017-02-22 中南大学 Orthogonal decomposition motion control method and device for extrusion head of 3D printing machine
CN108819228A (en) * 2018-08-17 2018-11-16 南京工程学院 A kind of FDM 3 D-printing control system
CN110465422A (en) * 2019-08-29 2019-11-19 内蒙古大学 A kind of flush coater kinetic control system and its motion control method based on FPGA

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
3D打印嵌入式工业控制***硬件设计;葛红宇等;《工业控制计算机》;20180125(第01期);全文 *

Also Published As

Publication number Publication date
CN111026041A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN111026041B (en) Reconfigurable system and reconfigurable method for multi-axis linkage numerical control
CN110879568B (en) Motion control method of multi-axis linkage economic numerical control system
CN1349141A (en) Device and method for industrial control based on distributable technology target
CN104133400B (en) Rotary grinder embedded controller based on digital bus
CN110244660B (en) peripheral configurable CT/PET-CT motion control system
CN103576614A (en) Multi-axis motion control system
CN105892412A (en) Multi-axis motion control hardware configuration based on custom bus
CN112327954B (en) High-precision positioning method for linear motor controlled by asymmetric S-shaped speed curve
CN107783501A (en) A kind of numerical control interpolation system of PCIe controls
CN108508857B (en) Multi-axis linkage control method and device
CN103744353A (en) Motion control system and motion control method
CN110879563A (en) Control circuit of multi-axis linkage economical system and application of control circuit in FDM (frequency division multiplexing) -oriented system
CN101349907B (en) Numerical control system and method for optimizing data stream
CN105929796B (en) The small line segment interpolation coprocessor of three-axis numerical control system high-speed high-precision and its operation method
CN206242053U (en) Driving stepper motor three freedom degree manipulator arm based on DSP control system
CN109093624B (en) Continuous interpolation motion control method for complex curve of mechanical arm
CN103926877B (en) A kind of multi-axis linkage numerical control system and its processing method
CN110543095A (en) Design method of numerical control gear chamfering machine control system based on quantum frame
CN1405674A (en) Method for realizing software of numerical control system down machine
CN101846993B (en) Method for controlling process parameter and related data stream in real time
CN114706351A (en) Drive control device and drive control method for multi-axis device, and machine tool device
CN205485481U (en) Multi -axis motion controller
CN1095556C (en) Omnibearing integrated PC digit control system
CN103809519A (en) Polar coordinate interpolation extremum region smooth processing method for numerical control system
JP4819515B2 (en) AC servo system having distributed movement control device providing multi-axis control for movement and control method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200417

Assignee: Nanjing Kaitong Automation Technology Co.,Ltd.

Assignor: NANJING INSTITUTE OF TECHNOLOGY

Contract record no.: X2024980001801

Denomination of invention: Reconfigurable System and Reconstruction Method for Multi axis Linkage CNC

Granted publication date: 20221213

License type: Common License

Record date: 20240202