Sports control chip
The PCI bus is an advanced high-performance 32/64-bit address data multiplexed partial bus that can also support multiple sets of peripherals. There are two main methods for implementing the PCI bus interface: First, use the CPLD or FPGA design PCI interface, which is more flexible, but its difficulty is large, the design cycle is also longer. The second is to adopt a dedicated PCI interface chip, which can greatly reduce the workload of the designer, thus shortening the development cycle, reducing development costs. The motion control card is designed by PLX's PCI9052 interface chip, which is in line with PCI2.1 specification.
In ISA mode, the use of EEPROM is required, in order to make PCI9052 in ISA mode, first ensure that the EEPEOM can be found, and the pci9052's top 68 pin is lowered. The content of EEPROM is very important. It is directly related to whether the entire board can work properly, pay special attention when designing.
Sports control chip
Traditional motion controllers are realized in more than embedded high-performance microcontrollers or DSPs, but the system integration is not high, the circuit is complex, soft, and hardware development cycle. The use of a dedicated motion controller can improve system integration, interpolation speed, and reliability while simplifying circuitry and shortens development cycle.
There are currently a variety of sports controllers in the market, such as PMD companies in the United States and Nova, Kyopal, and Seek, Japan. This design uses NOVA's MCX312, which can simultaneously control the motion control chip of independent servo motors or step motors. In the form of a burst, the servo motor and the stepping motor can be positioned, interpolated drive, speed control, etc.
● Separate two-axis drive
One chip can control the movement of two motor drive shafts, respectively. Each axis can be used for a fixed speed drive, a linear addition / deceleration drive, a S-curve drive, etc., the 2 axis is the same; the output drive pulse ranges from 1 pps to 4 Mpps, and when using a 16MHz clock, the output pulse frequency accuracy is less than ± 0.1%. .
● Quantitative drive and continuous drive
Quantitative drive refers to a fixed speed or add / deceleration output to output a number of pulses to move to a determined position or perform a determined action, continuously driving the continuous output drive pulse until the high stop command or the external stop signal is effective. Original search, scanning operation, and motor rotation speed control.
● Interpolation driver
2-axis linear interpolation and arc interpolation relative to the current position range - 8 388 607 ~ + 8 388 607, the interpolation accuracy is ± 0.5LSB, the speed range is 1PPs ~ 4MPPS, and 2 can be used continuously The axial straight line and the arc interpolation are driven in each interpolated node, with a maximum speed of 2 MHz.
● Location control
There are two 32-bit position counters per axis, one is the logical position counter inside the chip management drive pulse output, and the other is to manage the actual position counter from the pulse from the external encoder, and can be set by the internal register so that When the positional counter varies in the size of the comparison register, it generates an interrupt.
● Real-time monitoring
During the driving process, information such as logical position, actual position, driving speed, acceleration, and plus / deceleration status (acceleration, fixed speed, deceleration) areas can be obtained by real-time reading.
● Other features
The MCX312 also has many other important functions: quantitative drive, continuous drive; hardware restrictions; emergency stop; drive status output; Pulse output mode selection; input signal filtering, etc.
system design
In the hardware system, the PCI9052 is used as a bridge that connects the CPU and the motion control chip, and completed the transition from the PCI bus to the ISA bus. The CPU controls the motion control chip to achieve control of two-axis motion by programming.
The design hardware structure is shown in the figure below, and the PCI9052 is connected to the PCI bus, and AD [31: 0], CBE [3: 0], PAR, TrDYN, IDSEL, STOPN, PerRn, Serrn, CLK, RST0, INTA0, LOCKN, etc. are The signals, EESK, EEDO, EEDI, DDCs must be implemented, and the CPU is controlled by 16-bit data to control the MCX312 to make it an X and Y direction pulse signal to control the motion on the two direction axes.
The CNC system returns to it including NLMTP, NLMTM, NINPOS, NALARM, and other system location information, and thereby realizes the function of left and right direction limits, servo in place and alarms. The encoder input signal causes a change in the actual position counter of the MCX312, which can obtain the actual moving position of the two axis relative to the origin. The general input and output extends the system function, which can be used as different purposes according to the actual situation.
Figure PCI bus motion control card hardware structure diagram
Consider a few points while the circuit design:
(1) According to the PCI protocol, the length of the CLK signal line of the PCI bus is 2500mil, and the length of other signal lines should be within 1500 mIL;
(2) Due to the multi-switch input and output in the system, in practice, the interference of the external signal should be avoided. In order to achieve this, an optoelectronic coupling device is used in the system, and the input is configured, and the output is light. In the input of the input circuit, the interference is separated from the photocoupler.
(3) Digital circuit signal level conversion will produce a large impact current and produce a larger voltage drop in the transmission line and the power supply, form a serious interference. In order to suppress this interference, a high frequency characteristic is connected to about 0.1μF decoupling capacitance in the power source and ground of the chip;
(4) There must be a ground in the PRSNT2 # of the bus signal PRSNT1 #, which indicate the existence of the board and provides information about the power supply requirements.
Function library and driver design
Sports Control Card provides users with a software-hardware usage platform, and users can choose the functions you need according to their needs, and for functional implementation, the function library is necessary. The function library is used for secondary development of the motion control system. Programmers can use advanced languages, through the call to the library function, to implement control of the motion control system. The library function of the system includes a 5 class.
(1) Basic parameter setting, including the initialization and release of the card, pulse output mode, soft
Hardware limit setting, pulse output mode, and encoder input work mode, plus / deceleration mode setting and input signal filter function settings;
(2) Setting and reading of motion parameters, including the setting, addition / deceleration setting and reading, driving speed setting and reading, initial speed setting, logic / actual position Setting and reading of the counter, setting of the Comp + / Comp - Register, etc .;
(3) Drive state check, including the driving state of each axis and the interpolation drive state;
(4) Pulse drive output and set, including two-axis linear interpolation, clockwise / counterclockwise arc interpolation, quantitative drive, continuous drive, and drive stop and immediately stop;
(5) The switch input and output, including all the input outputs of the switch and the control of a single input output.
Developing applications under Windows should consider the system's restrictions, the Windows system is divided into the protection system to divide the user's access, and the level of the user is masked by the system, and the user cannot directly access the hardware resources. In order to achieve the purpose of communicating with hardware, the driver must be written.
Tools for Windows Driven Development include Windriver, DriversTUDIO, and DDK (Driver Develop Kit). WinDriver uses simple, no special information about system-driven knowledge, short development time, low efficiency, not easy to release; DDK efficiency and reliability, but use cumbers, development cycle; DriverWorks, Softice, DirverAgent and other tools It has the powerful function of developing debugging, encapsulating the DDK in the form of classes and is simple. This article is to drive development with DriveStudio.
DriverWorks provides the DriverWizard wizard that uses it to generate a driver's framework, where the most critical step adds the corresponding I / O port, memory resources, DMA, interrupts and other corresponding hardware resources, and add code in the corresponding handler.
in conclusion
The system uses the PCI bus interface and the MCX312 motion control chip, which supports plug and play, can be used in a variety of operating systems, high output pulse frequency, accurate control, easy to multi-axis expansion, etc., can be widely used in robots, based on PC CNC system.
Editor in charge: GT, read full text
Our other product: