The utility model content
The utility model provides a kind of motion controller, can carry out motion control by the Ethernet fieldbus.
The utility model has adopted following technical scheme:
On the one hand, the utility model discloses a kind of motion controller, comprise FPGA circuit and Ethernet interface, wherein, described FPGA circuit links to each other with Ethernet by described Ethernet interface;
The control command that control terminal sends is sent to described FPGA circuit through Ethernet by Ethernet interface, after the FPGA circuit receives described control command, control command is analyzed, is handled, according to the motion of control command control motor.
Among the embodiment of above-mentioned motion controller, also comprise USB interface, described FPGA circuit obtains control command by described USB interface from USB device, and after control command analyzed, handles, according to the motion of control command control motor.
Among the embodiment of above-mentioned motion controller, also comprise serial ports, described FPGA circuit obtains control command by described serial ports from serial equipment, and after control command analyzed, handles, according to the motion of control command control motor.
Among the embodiment of above-mentioned motion controller, described FPGA circuit comprises soft nucleus CPU and motion-control module, described soft nucleus CPU is used to receive described steering order, and after control command analyzed and handle, control command is sent to described motion-control module.
Among the embodiment of above-mentioned motion controller, described motion-control module comprises clock submodule, interface sub-module, cache sub-module, preset conuter, logical operation submodule, deceleration point controlling sub, acceleration and deceleration control submodule, frequency division submodule, frequency multiplication submodule, pulse output sub-module, straight line and circular interpolation submodule;
Wherein, described clock submodule is used to each submodule of motion-control module that time clock is provided;
Described interface sub-module is sent to cache sub-module with the control command of described soft nucleus CPU output;
Described cache sub-module is deposited control command;
Described preset conuter output count pulse is to deceleration point controlling sub and acceleration and deceleration control submodule;
Described logical operation submodule output control command is controlled its output to the deceleration point controlling sub;
The output signal of described acceleration and deceleration control submodule enters the frequency multiplication submodule after by frequency division submodule frequency division, and the frequency multiplication submodule produces high-frequency impulse, by pulse output sub-module output high-frequency impulse, realizes high-frequency impulse control;
Simultaneously, described pulse output sub-module output pulse is to straight line and circular interpolation submodule, by straight line and the output of circular interpolation submodule, the straight line and the circular interpolation of control motor.
Among the embodiment of above-mentioned motion controller, described FPGA circuit also comprises the media interviews control module, described media interviews control module comprises the transmission controlling sub and receives controlling sub, described transmission controlling sub is used for when sending data, judge whether to send data, if can send data, then add control information, and be sent to Physical layer with the form of regulation to data;
Described reception controlling sub is used for when receiving data, judges whether the data of input error of transmission takes place, if there is not error of transmission, then removes control information and is sent to data link layer.
On the other hand, the invention also discloses a kind of kinetic control system, comprise at least one above-mentioned motion controller, also comprise control terminal and Ethernet, wherein control terminal by Ethernet through sending controling instruction to described motion controller, described motion controller is analyzed, is handled control command, according to the motion of control command control motor.
Compared with prior art, the beneficial effects of the utility model are:
Motion controller of the present utility model comprises FPGA circuit and Ethernet interface, and wherein, described FPGA circuit links to each other with Ethernet by described Ethernet interface; The control command that control terminal sends is sent to described FPGA circuit through Ethernet by Ethernet interface, after the FPGA circuit receives described control command, control command is analyzed, is handled, according to the motion of control command control motor.Adopt Ethernet as fieldbus, can realize production line automation control, can also carry out remote firmware updating; Adopt the motion of FPGA control motor, simple in structure, powerful, cost is lower.
Embodiment
Contrast accompanying drawing and the utility model is further elaborated below in conjunction with embodiment.
The utility model discloses a kind of motion controller, comprise FPGA circuit and Ethernet interface, wherein, described FPGA circuit links to each other with Ethernet by described Ethernet interface; The control command that control terminal sends is sent to described FPGA circuit through Ethernet by Ethernet interface, after the FPGA circuit receives described control command, control command is analyzed, is handled, according to the motion of control command control motor.
Embodiment one:
As shown in Figure 1, a kind of motion controller comprises FPGA circuit and Ethernet interface, and wherein, described FPGA circuit links to each other with Ethernet by described Ethernet interface; The control command that control terminal sends is sent to described FPGA circuit through Ethernet by Ethernet interface, after the FPGA circuit receives described control command, control command is analyzed, is handled, according to the motion of control command control motor.
Control terminal refers to PC in embodiment of the present utility model, can comprise on-the-spot PC, also can be long-range PC.
Adopt Ethernet as fieldbus, can realize production line automation control, can also carry out remote firmware updating; Adopt the motion of FPGA control motor, simple in structure, powerful, cost is lower.
Above-mentioned motion controller also comprises USB interface, and described FPGA circuit obtains control command by described USB interface from USB device, and after control command analyzed, handles, according to the motion of control command control motor.
Above-mentioned motion controller also comprises serial ports, and described FPGA circuit obtains control command by described serial ports from serial equipment, and after control command analyzed, handles, according to the motion of control command control motor.
The multiple method of obtaining steering order has been expanded the use occasion of motion controller of the present utility model, provides more diversified, abundanter service to the user.
Motion controller of the present utility model also comprises peripheral circuits such as motor interface circuit, the CPLD circuit of ethernet interface circuit, single-ended transfer difference signal, general purpose I/O interface circuit that the photoelectricity isolation is arranged, serial interface circuit, USB flash disk interface circuit, and these peripheral circuits are controlled by the FPGA circuit.
Above-mentioned motion controller also comprises the CPLD circuit, and described CPLD circuit has two purposes, the one, be described FPGA firmware encrypting, and with the protection copyright, the protection independent intellectual property right.
The FPGA program is in the process of FPGA firmware in burning, and adopting CPLD is its firmware encrypting, can avoid being cracked, and can protect copyright, the protection independent intellectual property right.
Because the output of CPLD circuit when just powering on is in not stationary state, therefore, another purposes of CPLD is that the original levels that powers on is set, and makes its digital output end keep stable state when initially powering on, and can guarantee that entire equipment produces misoperation at the Shi Buhui that powers on because of not stationary state.
In the present embodiment, level is set toggle switch is set, the user can be provided with toggle switch by level, the original levels the when digital output port of definite CPLD powers on easily.
As shown in Figure 2, described FPGA circuit comprises soft nucleus CPU and motion-control module, and described soft nucleus CPU is used to receive described steering order, and after control command analyzed and handle, control command is sent to described motion-control module.
FPGA circuit in the present embodiment also comprises general utility functions modules such as serial ports control module, RAM control module, FLASH control module, USB flash disk control module, CPLD control module, does not repeat them here.
In the present embodiment, the inner soft nucleus CPU that embeds of FPGA is 32, and dominant frequency is 80MHZ.
Soft nucleus CPU is realized concrete functions such as TCP/IP communication module, serial communication module, PC command process module, user instruction explanation execution module, G code execution module, motion-control module, general purpose I/O control module, input detection module, input processing module, file storage module by software.
Adopt soft nucleus CPU in FPGA, computing power, processing power are stronger, can strengthen the control ability of motion controller, need not independent CPUs simultaneously, and be simple in structure, cost is low.
As shown in Figure 3, motion-control module is the core of motion controller, comprises clock submodule, interface sub-module, cache sub-module, preset conuter, logical operation submodule, deceleration point controlling sub, acceleration and deceleration control submodule, frequency division submodule, frequency multiplication submodule, pulse output sub-module, straight line and circular interpolation submodule;
Wherein, described clock submodule is used to each submodule of motion-control module that time clock is provided;
Described interface sub-module is sent to buffer circuit with the steering order of described soft nucleus CPU output;
Described buffer circuit is deposited steering order;
Described preset conuter output count pulse is to deceleration point controlling sub and acceleration and deceleration control submodule;
Logical operation submodule output control command is controlled its output to the deceleration point controlling sub;
The output signal of described acceleration and deceleration control submodule is by input frequency multiplication submodule behind the frequency division submodule frequency division, and the frequency multiplication submodule produces high-frequency impulse, by pulse output sub-module output high-frequency impulse, realizes high-frequency impulse control;
Simultaneously, described pulse output sub-module output pulse is to straight line and circular interpolation submodule, by straight line and the output of circular interpolation submodule, the straight line and the circular interpolation of control motor.
Control by pulse submodule, straight line and the output of circular interpolation submodule, can realize multiaxis control motor.
Depositing in the above-mentioned cache sub-module at most can 512 steering order.
Generally speaking, deposit many steering orders in the cache sub-module, can eliminate because the moment break of the orbiting motion that Ethernet and motion controller communication institute time-consuming are produced can improve the speed of motion controller when carrying out the high speed TRAJECTORY CONTROL and the flatness of track.
The FPGA circuit also comprises media interviews control module (ethernet mac), described media interviews control module comprises the transmission controlling sub and receives controlling sub, described transmission controlling sub is used for when sending data, judge whether to send data, if can send data, then add control information, and be sent to Physical layer with the form of regulation to data; Described reception controlling sub is used for when receiving data, judges whether the data of input error of transmission takes place, if there is not error of transmission, then removes control information and is sent to data link layer.
The steering order that adopts on the numerically-controlled machine is the ISO numerical control code, be commonly called as G code, among the embodiment of the present utility model, on the basis of ISO numerical control code, increased some special-purpose steering orders, as: condition judgment instruction, loop control instruction, I/O steering order and real-time multi-task call instruction etc.
Special-purpose control routine and the example thereof of following brief description the utility model embodiment.
1, condition judgment instruction: M94
Example: N10 M94 S3 V1 N50; When input port 3 effectively the time, it number is 50 instruction that row is put in the program redirect
2, loop control instruction: M91
Example: N40M91C6; The circulation beginning circulates 6 times;
N50 G00 X2.00; X-axis moves 2mm;
N60 G04 P500; Time-delay 500mS;
N70 M90; Loop ends
3, real-time multi-task call instruction: M97
When can realizing controlling motor movement, this instruction handles I/O in real time.
Example: N10 M97 N200; In master routine, open multitask subroutine N200
N20 G00 X400.00; X-axis motion 400mm;
……
N99 M02; Master routine finishes
N200 M94 S1 V0 N220; If input port 1 is 0, then N225 is put in redirect
N210 M80 S5; Input port 1 is 1, and delivery outlet 5 is opened
N215 G04 P300; Time-delay 300mS
N220 M95 N200; N200 is put in redirect
N225 M81 S5; Delivery outlet 5 is closed
N230 G04 P300; Time-delay 300mS
N235 M95 N200; N200 is put in redirect
N240 M99; End of subroutine
Embodiment two:
As shown in Figure 4, a kind of kinetic control system, comprise at least one above-mentioned motion controller, also comprise control terminal and Ethernet, wherein control terminal by Ethernet through sending controling instruction to described motion controller, described motion controller is analyzed, is handled control command, according to the motion of control command control motor.
Embodiment three:
The motion control method of an embodiment comprises following steps:
Step 101 is connected by the Ethernet net PC with motion controller.
In the present embodiment, adopt PC as control terminal.
Step 102, PC sends motion control instruction to motion controller by Ethernet, and obtains described motion controller feedback information.
Step 103, described motion controller are controlled the motion of motor according to motion control instruction.
In the present embodiment,, then be each motion controller numbering by the IP address if PC is to link to each other with an above motion controller.
The quantity of motion controller generally without limits, as long as be no more than the quantity of IP address.
When many motion controllers, the function that the control system program adopts higher level lanquage to call the various functions of motion controller is write and is formed.PC sends steering order by Ethernet to individual motion controller, can realize the automatic control of production line,
In the present embodiment, if PC links to each other with a motion controller, then motion controller can also instruct to motion controller by Ethernet interface, USB interface or serial ports downloading control.
When having only a motion controller, its program is write with G code, and this moment, G code also can directly be write on touch-screen.
Embodiment four:
The motion controller of an embodiment of the utility model comprises motor interface J21, I/O interface J11, D/A interface, two serial ports, expansion I/O mouth, and network interface, USB flash disk mouth, original levels are provided with toggle switch, power supply, pilot lamp.
Its key technical indexes is as follows:
Control motor number: 4
The command pulse of control motor:
Frequency range: 1~5.0MHz
Frequency accuracy: ± 0.1Hz
Pulse number :-2,147,483,647~+ 2,147,483,648 (32)
2--4 axle linear interpolation precision: ± 1 pulse equivalency
2 circular interpolation precision: ± 1 pulse equivalency
The I/O signal:
General digital delivery outlet: 24; Wherein: 8 road photoelectricity are isolated, 16 tunnel non-isolation
General digital input port: 32; Wherein: 16 road photoelectricity are isolated, 16 tunnel non-isolation
There is the RC low-pass filter general, special digital input port
The D/A signal:
8 D/A digital-to-analog conversions of two-way interface, output voltage range 0.07~4.45V
Pwm signal:
Two-way PWM width modulation interface, highest frequency 1MHz, 0~100% EDM Generator of Adjustable Duty Ratio software:
Function library: support Windows 98/NT/2000/XP/Win7 operating system to use VB, VC, Delphi, LabView software to carry out applied software development.
Instruction set: the built-in G code instruction set of controller.
Motion controller of the present utility model comprises FPGA circuit and Ethernet interface, and wherein, described FPGA circuit links to each other with Ethernet by described Ethernet interface; The control command that control terminal sends is sent to described FPGA circuit through Ethernet by Ethernet interface, after the FPGA circuit receives described control command, control command is analyzed, is handled, according to the motion of control command control motor.Adopt Ethernet as fieldbus, can realize production line automation control, can also carry out remote firmware updating; Adopt the motion of FPGA control motor, simple in structure, powerful, cost is lower.Simultaneously, deposit many steering orders in the cache sub-module among the FPGA of the present utility model, can eliminate because the moment break of the orbiting motion that Ethernet and motion controller communication institute time-consuming are produced can improve the speed of motion controller when carrying out the high speed TRAJECTORY CONTROL and the flatness of track.
Above content be in conjunction with concrete preferred implementation to further describing that the utility model is done, but this example of just lifting for ease of understanding should not think that concrete enforcement of the present utility model is confined to these explanations.For the utility model person of an ordinary skill in the technical field, under the prerequisite that does not break away from the utility model design, can make various possible being equal to and change or replacement, these changes or replacement all should belong to protection domain of the present utility model.