[background technology]
Continuous development along with modern enterprise, it is very extensive that the application of large-scale unit becomes, corresponding this just detects to real time fail to a certain extent and brought inconvenience, how the running status of motor is carried out real time on-line monitoring, the record trouble source, thus and implement fault alarm and associated motor control and better each member of unit is effectively detected and just become the focus that current people pay close attention to.The eighties in 20th century, a kind of appearance of novel control system-field bus control system (FCS) has brought the method for dealing with problems to people, so we realize fault detect to large-scale unit by means of the notion of fieldbus.Compare with traditional control system, field bus control system is a kind of full distribution, digital, control system that standard-sized sheet is put.It is as the connection tie of smart machine, the smart machine that is articulated on the bus is connected to network system as node, and further constitute automated system, realize the comprehensive automation function of basic controlling, parameter modification, monitoring, demonstration, optimization and control integration, be with a wide range of applications.At present the product of fieldbus is numerous, and influential nearly kind more than 40 is wherein used many have CAN bus, FF bus, ProfiBUS bus, DeviceNET, ControlNET, P-NET or the like.Every kind of fieldbus all has advantage and the main application fields of oneself.The standard species class of fieldbus is many simultaneously, has restricted the application of fieldbus to a certain extent.
The CAN bus is to be to solve the communication protocol that control numerous in the Hyundai Motor and the exchanges data between the testing tool are developed by German Bosch company at first, its application has expanded to process control, machine-building, robot and building automatic field at present, and becomes international standard the earliest in the bus at the scene.In the Engineering Control field, the CAN bus can be used as the communication bus of field apparatus level, compares with other buses, has very high reliability and cost performance.On the CAN network any node all can be used as host node on one's own initiative with other node switching data problems, make flexible design, and can improve the performance of system greatly.The information frame of CAN network node can be told priority, and this provides convenience for the user who has real-time to require, and simultaneously, the Physical layer of CAN and link layer adopt unique design, make it anti-interference, and the performance of aspects such as error detection capability is fine.In addition, from realizing angle, CAN is simple in structure, and device is bought easily, and the price of each node is lower, and development technique is grasped easily, can make full use of existing microcomputer development instrument.
The industrial measurement and control scene exists a large amount of sensors, topworks and electronic control unit usually, they are generally distributed more widely, and real-time requires very high, characteristics in conjunction with the CAN bus, so native system has adopted on-site bus type distributing system (Field Distributed Control System) FDCS structure, each dispersion, isolated commercial unit are coupled together and monitored with the CAN bus network.Native system adopts the topological structure network, is transmission medium with the twisted-pair feeder, and host computer is connected on the CAN bus by the CAN Bus PC Adapter, and each slave computer node is linked to each other with the CAN bus by the CAN driver by the Single-chip Controlling of band CAN controller.In a broad sense, host computer also belongs to an intelligent node on the CAN bus, so just, constituted the industry spot network of many main frames, each node all is on an equal footing on the CAN bus, can carry out data transmission according to ID number of message, avoid thus causing the paralysis of total system because of main frame or a certain handset break down.
[summary of the invention]
The objective of the invention is to overcome the deficiencies in the prior art, a kind of online fault detection system based on the CAN bus is provided.
The objective of the invention is to be achieved through the following technical solutions:
A kind of online fault detection system based on the CAN bus comprises the host computer man-machine interface, slave computer intelligent object and CAN bus; Host computer links to each other with the CAN bus by the CAN adapter; The slave computer intelligent object links to each other with the CAN bus by the CAN driver, it is characterized in that described slave computer intelligent object comprises interface portion, the Electric Machine Control part, the part of voltage, electric current, rotating speed, moment of torsion, vibration, temperature etc. and various signals and various signals collecting; Wherein,
Interface portion comprises Keysheet module and LCD Liquid Crystal Module, and Keysheet module scans keyboard by the chip of Keysheet module, and key assignments is stored in its key assignments register, and the slave computer chip passes through I
2The key assignments register that the C bus reads on the chip of Keysheet module is finished keypad function, and the LCD Liquid Crystal Module is connected on the slave computer chip by the DCB form;
The Electric Machine Control part, comprise 12 DA modular converters, control signal output ends, servo-driver, control signal is divided into Digital Signals and simulating signal control, digital controlled signal is produced by common I/O mouth, realizes motor is just changeed the control of counter-rotating and start and stop state indirectly by the high-low level of control end; Analog control signal is produced by 12 DA modular converters that the slave computer chip carries, and realizes the control of motor speed by the size of regulating simulating signal;
The part of signals collecting, comprise 12 AD modular converters, the photoelectric encoder acquisition module, three tunnel simulating signals are divided into electric moter voltage, output torque and temperature, via corresponding sensor acquisition, after amplifying, AD620 all imports AD modular converter, the timer module collection that the photoelectric encoder signal is carried by the slave computer chip again with differential mode;
Described CAN bus, comprise twisted-pair feeder, PC adapter and CAN driver, the signal transmission medium of twisted-pair feeder, the PC adapter is mainly realized the data transmit-receive function, the data forwarding that adapter transmits intelligent data sampling module is given host computer, and the order that host computer is sent and establish data forwarding to each intelligent node on the CAN; The monitoring management function is finished monitoring and management work to being connected each intelligent node on the CAN bus; The CAN bus portion couples together total system, is responsible for the transmission work of data.
Compared with prior art, good effect of the present invention is:
(1) controlling object of the present invention is large-scale unit, site environment is more special, and various electromagnetic interference signals all have very big influence to the collection of Electric Machine Control and data, thereby has influence on the analysis to electrical fault, so we are to interference problem, FEEDBACK CONTROL etc. have been made new requirement;
(2) cost of hardware design of the present invention is relatively low, MCU selects the C8051F040 chip of Cygnal for use, himself is integrated real 12, the ADC module of 100ksps, two 12 DAC modules, controller local area network (CAN2.0B) controller, and other digital peripherals and functional part, it is a fully-integrated mixed-signal system level chip (SoC), thereby simplified the hardware configuration design, improved antijamming capability, guaranteed that the real-time of detection system, reliability have reduced cost again;
(3) the present invention has adopted 2 personal-machine interfaces, can be provided with parameters respectively at host computer and slave computer, thereby make upper and lower computer have certain independence;
(4) the present invention adopts the topological structure network, this host computer and slave computer belong to the intelligent node on the CAN bus, so just, constituted the industry spot network of many main frames, each node all is on an equal footing on the CAN bus, can carry out data transmission according to ID number of message, avoid thus causing the paralysis of total system because of main frame or a certain handset break down;
(5) the present invention has adopted closed loop controlling structure, and the data that host computer advances collection are analyzed and compared, and again the result are sent to slave computer, realize the real-time rewriting to setup parameter.
[embodiment]
The present invention below is provided a kind of embodiment of the online fault detection system based on the CAN bus.
See also accompanying drawing 1 and 2, a kind of online fault detection system based on the CAN bus comprises the host computer man-machine interface, slave computer intelligent object and CAN bus; Host computer links to each other with the CAN bus by the CAN adapter; The slave computer intelligent object links to each other with the CAN bus by the CAN driver, and described slave computer intelligent object comprises interface portion, Electric Machine Control part, the part of voltage, electric current, rotating speed, moment of torsion, vibration, temperature etc. and various signals and various signals collecting; Wherein,
Interface portion comprises Keysheet module and LCD Liquid Crystal Module, and Keysheet module scans keyboard by the chip of Keysheet module, and key assignments is stored in its key assignments register, and the slave computer chip passes through I
2The key assignments register that the C bus reads on the chip of Keysheet module is finished keypad function, and the LCD Liquid Crystal Module is connected on the slave computer chip by the DCB form;
The Electric Machine Control part, comprise 12 DA modular converters, control signal output ends, servo-driver, control signal is divided into Digital Signals and simulating signal control, digital controlled signal is produced by common I/O mouth, realizes motor is just changeed the control of counter-rotating and start and stop state indirectly by the high-low level of control end; Analog control signal is produced by 12 DA modular converters that the slave computer chip carries, and realizes the control of motor speed by the size of regulating simulating signal;
The part of signals collecting, comprise 12 AD modular converters, the photoelectric encoder acquisition module, three tunnel simulating signals are divided into electric moter voltage, output torque and temperature, via corresponding sensor acquisition, after amplifying, AD620 all imports AD modular converter, the timer module collection that the photoelectric encoder signal is carried by the slave computer chip again with differential mode.
Host computer is that PC is formed with the CAN adapter that is connected on the PC PCI slot; Select the PIC-5110 single channel intelligent CAN adapter of Guangzhou Zhiyuan Electronics Co., Ltd. for use, it has the standard pci interface, and PC is advantageously connected on the CAN bus, realizes the data communication of CAN2.0B agreement; This interface card carries photoelectric isolation module, make PC avoid since ground circulation damage, the reliability that enhanced system is used in rugged surroundings.The PCI-5110 intelligent interface card is furnished with the driver that can work under Win98/Me, Win2000/XP, use general CAN interface library, and development environment is simple, friendly, can support development environments such as VC++, C++builder, Delphi, VB;
The host computer structure, as shown in Figure 1, master controller is a PC, external printer, wherein PC links by network and ECC engineering control center.
The slave computer structure, as shown in Figure 2, the minimum system part, man-machine interface part (keyboard and LCD) extends out the EPROM part, the reseting module part, the Electric Machine Control part, the signals collecting part is with the interface section of CAN bus.Minimum system comprises central processing unit C8051F040, three road independent current source output modules, outside start-oscillation circuit.Wherein,
Power module, exchange introduction by 220v, change out the three paths of independent power supply by transformer, three-way power respectively behind the rectifying and wave-filtering and then voltage stabilizing become required voltage, last three-way power in the end supplies ground, the purpose of doing like this is that numeral power supply and simulation power supply are separated, to improve the stability of system, also can reduce simultaneously the interference of power supply to A/D and D/A conversion, improve conversion accuracy, proving effect is fine as a result;
The CAN driver, select for use the TJA1050 of Philips company to link to each other with bus, TJA1050 is the high-speed CAN bus driver that Philips company produces, this device provides the interface of CAN controller and physical bus, and realized difference transmission and the receiving function and the good anti-electromagnetic-radiation of CAN bus and prevented short-circuit capacity, in order to improve the antijamming capability of CAN node, between CAN transmitting-receiving pin CANTX, CANRX and CAN transceiver, added photoelectrical coupler 6N137;
The LCD Liquid Crystal Module, control by a simulation mouthful mode, P1.0~P1.5 with C8051F040 simulates control bus, the P2 mouth is made the I/O data bus, link to each other with data port with the control mouth of LCD respectively, be 240 * 128 liquid crystal of built-in T6963C control type, the driving control system of the LCD MODULE of described built-in T6963C control type is by LCD controller T6963C and peripheral circuit thereof, the line driver group, column driver bank and liquid crystal drive bias circuit are formed; The maximum characteristics of T6963C are to have unique hardware initial value function is set, parameter that display driver is required such as dutycycle coefficient, the byte number/row that drives transmission and the font selection of character etc. all have the pin level setting, the initialization of T6963C is finished with regard to basic setup when powering on like this, and software operation just can concentrate in the design of display frame;
Keysheet module, be selected from ZLG7290, can sample 64 buttons or sensor of described ZLG7290 can detect the double hit number of times of each button, adopt ZLG7290 to carry out key scan, and with scanning result by the I2C bus, pass to single-chip microcomputer (only needing 3 pins) but economizer port, and guarantee the reliability of collection; The ZLG7290 basic function is as follows: keyboard goes dithering process, two key interlock process, and the double hit key is handled, and function key is handled; So described keyboard goes dithering process to be meant level state may be occurred and change repeatedly and be called keyboard shake and can not cause that keypad order mistake will go dithering process to be as the criterion to read stable keyboard state if do not deal with when key is pressed and decontrol; The described pair of key interlock process be meant when two above buttons are pressed simultaneously ZLG7290 only sample the high button priority of priority for (S1>S2>...>S64 samples S2 when pressing S2 and S18 simultaneously); Described double hit key is handled and is meant that double hit time counter (RepeatCnt) can be distinguished out and clicks (some function does not allow double hit such as switch) or double hit; Judge the double hit number of times, can detect by by the time to prevent some function maloperation; Described function key is handled and is meant that " Shift, Ctrl, Alt " key typical case that the function bond energy realizes that 2 above buttons are pressed down on expansion number of keys or realization specific function such as the PC simultaneously uses;
The part of data acquisition, comprise three tunnel simulating signals (electric moter voltage, output torque and temperature) and after AD620 amplifies, all import AD module by signal, the timer module collection that the photoelectric encoder signal has the slave computer chip to carry again with differential mode via the interface of respective sensor; 12 A/D converters that native system has adopted C8051F040 inside to carry, simplify hardware circuit like this and made things convenient for simultaneously software programming again, the ADC0 subsystem of C8051F040 comprises the programmable analog MUX (AMUX0) of one 9 passage, the successive approximation register type ADC of a programmable gain amplifier (PGA0) and 100ksps, 12 bit resolutions, integrated track and hold circuit and windows detecting device able to programme among the ADC; Road digital quantity input among the design is in order to the monitoring rotating speed of motor, digital signal is by the grating encoder collection, grating encoder is linked to each other with electric machine main shaft, motor whenever circles, grating encoder just sends 1000 pulses, pulse signal is input to the P0.0 pin of C8051F040 by the J4 interface, this pin also is the pulse input end of timer T0, T0 is made as the counter works mode to be write down from the umber of pulse of P0.0 input, T1 is made as the timer working method, regularly read the umber of pulse that writes down among the T0, like this, umber of pulse/(1000 * timing) is the electric machine main shaft rotating speed.Native system adopts the photoelectric encoder of 1000p/r, and its precision can satisfy the accuracy requirement of system; Scrambler is powered with 9v, and A is arranged, B, and the output of Z three road pulse signals can realize positive and negative displacement counting;
The Electric Machine Control output comprises analog quantity output, switching value output and relay output,
The 12DA module output that analog quantity output is carried by the slave computer chip, the regulating and controlling rotating speed of motor, switching value is by corresponding different I/O mouth output, and the startup of control motor stops and rotating; Relay output is by P4.4 control, and control signal through the photoelectrical coupler input relay, is controlled the break-make of motor by the output of P4.4 pin, and motor can be controlled to the mode that slave computer transmits control signal by host computer, also can directly be controlled by slave computer CPU;
Warning device comprises 4 tunnel warning LED pipes by P4.0~P4.3 control, when occurring exceeding standard situation in 4 road monitor signals, controls the break-make of corresponding LED, sends failure warning.
The software section of native system, comprise upper computer software and slave computer software, upper computer software has CV++ to write, simultaneously the interface between CAN network interface card and the monitoring software is mainly realized by driver (Lib storehouse and DLL storehouse), host computer to the value of individual node measure in real time, analysis, node administration, warning, database data management, report output and graphic presentation etc.
(1) node administration
Inquire about each slave computer node state parameter, handle the back by analysis to its feedback control parameters.
(2) measurement function
Mainly finish the date and time that the data acquisition and the record of the various parameters of the motor in the total system (vibration, temperature etc.) are measured, can classify and show the measurement result of each measurement, can export all kinds of measurement data forms by printer prints, and measurement data is stored as database automatically for retrieval.
(3) analytic function and warning
Finish relatively, point out the isoparametric ultimate value of vibration, temperature of motor in each node and mean value etc. the analysis of measurement result.The mode of measurement data with image shown; Can also carry out trend analysis according to historical data; Warning on the host computer and long-range motor onsite alarming can be realized according to the result who analyzes, Long-distance Control can be realized simultaneously at any time motor.
(4) data management and graphic presentation
Monitoring software has been used database management language SQL Server and has been carried out data management in the system, uses a few days ago comparatively that the popular SQL engine carries out searching and locating of data, has realized the advantage that concrete storage space is little, seek rate is fast; All measurement results in the system and analysis result all can show in the mode of figure
(5) report output
System software provides powerful form editor and output function, and the various data that can access in the database are edited in form flexibly.
Slave computer software, by transplantability preferably the C language develop, by in development environment Keil, writing function program, and compile, by UEC-5 by the programming of JTAG mouth in chip, thereby realize the required function of slave computer intelligent object.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, without departing from the inventive concept of the premise; can also make some improvements and modifications, these improvements and modifications also should be considered within the scope of protection of the present invention.