A kind of method and apparatus of system controlled volume being debugged by host computer
Technical field
The present invention relates to a kind of method and apparatus of system controlled volume being debugged by host computer.
Background technology
In the production debug process, because the existence of the discreteness of signal conditioning circuit and analog-digital converter, quantization error will appear in the value of feedback of controlled volume, usually, this quantization error will superpose through closed loop computing and controlled volume, and further develop into output error or display error.Existing solution is in the deviation range that allows, and the adjustable device of design potentiometer and so in signal conditioning circuit in conjunction with detecting instrument, is regulated adjustable device and made corresponding its standard value of controlled volume.But the existing method of adjustable device exists many problems in this adjusting hardware circuit: 1, hardware design has a plurality of signal IO channel usually, needs the adjustable device of adjusting a lot, and the production debug process bothers complexity, poor operability very much; 2, debugging method is original, can not realize the Remote debugging, if slave computer is in the environment that the commissioning staff can not arrive, just can't debug.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of method and apparatus of system controlled volume being debugged by host computer, the adjustable device in the hardware circuit had both been saved in this invention, had realized long-range production debugging again, had improved debugging efficiency.
To achieve these goals, the present invention adopts a kind of method of system controlled volume being debugged by host computer, and this method may further comprise the steps:
Detect the actual value of controlled volume;
The standard value that the actual value of above-mentioned controlled volume is corresponding with it is made comparisons, if equate, and execution in step A then; Otherwise, execution in step B;
Steps A: the operation upper computer software sends preservation reference quantization value (AD to slave computer
Set) instruction;
Step B: the operation upper computer software sends increasing or decreasing reference quantization value (AD to slave computer
Set) instruction.
In the method for the present invention, described step B is further comprising the steps of:
If the actual value of described controlled volume is greater than the standard value corresponding with it, execution in step B1; If the actual value of described controlled volume is less than the standard value corresponding with it, execution in step B2 then;
Step B1: the operation upper computer software sends reference quantization value (AD to slave computer
Set) subtract 1 the instruction;
Step B2: the operation upper computer software sends reference quantization value (AD to slave computer
Set) add 1 the instruction.
The present invention also provides a kind of device of system controlled volume being debugged by host computer, comprises upper computer software, detecting instrument, slave computer.
Described upper computer software is used for sending instruction to slave computer;
Described detecting instrument is used to measure the actual value of slave computer controlled volume;
Described slave computer comprises CPU, analog-digital converter and data storage element.
Wherein,
Described CPU is used to control computing;
Described analog-digital converter is used to quantize controlled volume;
Described data storage element is used to store reference quantization value (AD
Set).
The key distinction of technical scheme of the present invention and prior art is: the present invention is by revising the reference quantization value (AD in the upper computer software
Set), the sampling deviation that the compensation controlled volume occurs behind signal processing circuit or analog-digital converter had both been saved the adjustable device in the hardware circuit, had realized long-range production debugging again, had improved debugging efficiency.
Description of drawings
Fig. 1 is the schematic flow sheet that the present invention debugs system controlled volume by host computer;
The structural representation of Fig. 2 device that to be the present invention debug system controlled volume by host computer.
Embodiment
In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with accompanying drawing.
The core of the inventive method is that the standard value that the actual value of controlled volume is corresponding with it makes comparisons, and regulates reference quantization value (AD according to comparative result
Set), the sampling deviation that the compensation controlled volume occurs behind signal processing circuit or analog-digital converter.
Fig. 1 is the schematic flow sheet that the present invention debugs system controlled volume by host computer.This flow process starts from step 101.In step 102, the commissioning staff uses detecting instrument to read the actual value of slave computer controlled volume.In step 103, the standard output valve that the result of step 102 is corresponding with it compares.
If the result of step 103 be " greater than ", then enter step 104; If the result of step 103 be " less than ", then enter step 105; If the result of step 103 then enters step 106 for " equaling ".
In step 104, the operation upper computer software sends reference quantization value (AD to slave computer
Set) subtract 1 instruction, after the computing of CPU closed loop, detecting instrument shows that the actual value of this controlled volume reduces.This step of repeatable operation is " equaling " until the result of step 103.
In step 105, the operation upper computer software sends reference quantization value (AD to slave computer
Set) add 1 instruction, after the computing of CPU closed loop, detecting instrument shows that the actual value of this controlled volume increases.This step of repeatable operation is " equaling " until the result of step 103.
In step 106, upper computer software sends to slave computer and preserves reference quantization value (AD
Set) instruction, at this moment, slave computer is with reference quantization value (AD
Set) be solidificated in the data storage element.Each when slave computer starts, with reference quantization value (AD
Set) carry out the closed loop computing as the closed loop input quantity.
In step 107, finish debugging.
Method of the present invention is compared with prior art, and prior art is the adjustable device in the conditioning signal modulate circuit, and the shortcoming of this adjustment method is that the process trouble is complicated, poor operability; The present invention is by upper computer software, revises reference quantization value (AD
Set), and then compensation to replace adjustment method of the prior art, both saved the adjustable device in the hardware circuit because of the sampling error that signal conditioning circuit and analog-digital converter cause, again for realized long-range debugging provide may, improved debugging efficiency.
Adopt method of the present invention, must make the device of system controlled volume being debugged by host computer adapt to the enforcement of this method, the structural representation of the device that Fig. 2 debugs system controlled volume by host computer for the present invention.The device of system controlled volume being debugged by host computer comprises upper computer software, detecting instrument and slave computer.
Wherein upper computer software is used for sending instruction to slave computer;
Detecting instrument wherein is used to measure the actual value of slave computer controlled volume;
Wherein slave computer comprises CPU, analog-digital converter and data storage element.
CPU in the slave computer is used to control computing;
Analog-digital converter in the slave computer is used to quantize controlled volume;
Data storage element in the slave computer is used to store reference quantization value (AD
Set).