Summary of the invention
The object of the present invention is to provide a kind of parameter method for self-calibrating and operating control, in order to realize the automatic calibration of parameter.
For this reason, the present invention adopts following technical scheme:
The embodiment of the present invention provides a kind of parameter method for self-calibrating, is applied to the parameter in operating control is carried out to self-alignment process, and the method comprises:
In the time meeting self calibration entry condition, according to the reference input parameter of preserving in the actual input parameter of this operation of operating control and operating control, obtain the input parameter maximal value of operating control and preserve;
According to the input parameter maximal value of described operating control, the median of operating control, and according to the determined output parameter scope of the output parameter maximal value of operating control, the actual input parameter of this operation of operating control is converted to output parameter the output of this operation, and makes within the output parameter of this operation is in described output parameter scope.
The embodiment of the present invention also provides a kind of operating control, comprising: memory module, acquisition module and processing module, wherein:
Described memory module, for storing input parameter maximal value, the median of operating control and the output parameter maximal value of operating control of operating control;
Described acquisition module, in the time that self calibration entry condition meets, according to the reference input parameter of preserving in the actual input parameter of this operation of operating control and operating control, obtains the input parameter maximal value of operating control;
Described processing module, be used for according to the input parameter maximal value of described operating control, the median of operating control, and according to the determined output parameter scope of the output parameter maximal value of operating control, the actual input parameter of this operation of operating control is converted to output parameter the output of this operation, and makes within the output parameter of this operation is in described output parameter scope.
In the embodiment of the present invention, once meet self calibration entry condition, according to the input parameter of the reference of the actual input parameter of this operation of operating control and preservation, obtain the input parameter maximal value of operating control and preserve, operating control is according to the input parameter maximal value of preserving, the median of operating control, and according to the determined output parameter scope of the output parameter maximal value of operating control, by this operation of operating control actual input parameter be converted to this operation output parameter and output, and within the output parameter that makes this operation is in described output parameter scope, thereby by the dissimilar input parameter of various operating controls, and the input parameter of different spans, automatically within being transformed into default output parameter numerical range, not only unify output parameter numerical range, for follow-up measurement, calculating provides convenience, also without artificial parameters, save cost of labor, reduce the time of production debugging.
Embodiment
Below in conjunction with the accompanying drawing in the present invention, the technical scheme in the present invention is carried out to clear, complete description, obviously, described embodiment is a part of embodiment of the present invention, rather than whole embodiment.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skills obtain under the prerequisite of not making creative work, belongs to the scope of protection of the invention.
The operating control that the embodiment of the present invention provides has from adjusting, self-alignment function, has CAN communication function between its internal module, carries out the transmission of signal.
As shown in Figure 3, this operating control can comprise: memory module 31, acquisition module 32, processing module 33, wherein: memory module 31, for storing input parameter maximal value, the median of operating control and the output parameter maximal value of operating control of operating control; Acquisition module 32, in the time that self calibration entry condition meets, for the reference input parameter to preserve according to the actual input parameter of this operation of operating control, obtains the input parameter maximal value of operating control; Processing module 33, be used for according to the input parameter maximal value of the operating control of memory module 31 storages and the median of operating control, and according to the determined output parameter scope of the output parameter maximal value of operating control, the actual input parameter of this operation of operating control is converted to output parameter the output of this operation, and makes within the output parameter of this operation is in described output parameter scope.
Acquisition module 31 specifically for, judge the relation between duration and the schedule time threshold value of this operation, exceed the schedule time when threshold value when this duration, according to the reference input parameter of preserving in the actual input parameter of this operation of operating control and operating control, obtain the input parameter maximal value of operating control.
Wherein, output parameter maximal value can be set as 65535 (being that output parameter scope is-65535~65535), in the present embodiment, preferably, can set output parameter maximal value is 32767, that is, parameter self-calibrating device output parameter scope is-32767~32767.
The embodiment of the present invention describes as an example of handle example, and those skilled in the art are known, and operating control can include but not limited to: handle, telepilot, the devices such as pot.
When handle powers on, handle carries out initialization, in memory module 33, record the initial median of handle, now, handle is conventionally in reset position, for one direction handle, reset position is the initial boundary position of handle, i.e. the position of input value minimum (being 0), and for twocouese handle, reset position is the centre position of handle twocouese range of control, the position that input value is 0.
As shown in Figure 1, be the parameter self calibration schematic flow sheet that the embodiment of the present invention provides, comprise the following steps:
Step 11, in the time that acquisition module judgement meets self calibration entry condition, starts self calibration flow process.
Concrete, acquisition module judges the relation between duration and the schedule time threshold value of this operation of handle, if this duration exceedes schedule time threshold value, starts self calibration flow process.For example, this schedule time threshold value can be set to for 2 seconds.
Step 12, acquisition module, according to the reference input parameter of the actual input parameter of this operation of handle and preservation, obtains the input parameter maximal value of handle.
Concrete, acquisition module, by the absolute value of the actual input parameter value of this operation, compares with the absolute value of the reference input parameter value of preserving; If the former is greater than the latter, the input parameter maximal value using actual input parameter as handle is also preserved, and as the reference input parameter of next time operation, otherwise abandons the former, will handle in the reference input parameter of current preservation as input parameter maximal value.
Acquisition module also can obtain after the input parameter maximal value of handle according to the reference input parameter of the actual input parameter of this operation of handle and preservation, obtain median corresponding to this input parameter maximal value, for example, in the time determining that the actual input parameter of this operation is input parameter maximal value, obtain the median of this operation; Visible, by the Real-time Obtaining median corresponding with input parameter maximal value, the median now obtaining is more accurate, and corresponding, the output parameter in the output parameter span after the conversion obtaining is also more accurate.
In actual application, in memory module, only preserve initial median, or the preservation median corresponding with input parameter maximal value, can both realize technical scheme of the present invention, can select according to the needs of programming.
Step 13, memory module is stored the input parameter maximal value obtaining in step 12.
In this step, memory module can also be preserved the median corresponding with input parameter maximal value.
Step 14, processing module, according to the median of the input parameter maximal value of the handle of preserving in memory module, handle and output parameter maximal value, is converted to parameter the output in output parameter span by the actual input parameter of this operation of handle.
Concrete, input parameter maximal value comprises forward input parameter maximal value and/or the negative sense input parameter maximal value of handle.Concrete, the output parameter value of this operation can obtain by following formula:
Wherein, if the actual input parameter value of this operation is greater than median, zone bit is 1, and input parameter maximal value is forward input parameter maximal value, and handle is positive movement, the actual output parameter value that draws this operation also on the occasion of; If the actual input parameter value of this operation is less than median, zone bit is-1, and input parameter maximal value is negative sense input parameter maximal value, and handle is negative movement, and the actual output parameter value that draws this operation is also negative value; If the absolute value of the actual input parameter value of this operation is less than the absolute value of median, zone bit is 0, thinks that handle is reset mode.
Wherein, handle median can repeatedly obtain, in the peaked process of the input parameter that obtains handle, when user's control crank for example, to certain position and keep input state overtime threshold value (2 seconds), obtain after the actual input parameter value of this operation user's release handle, handle automatically resets, in the time that handle keeps this state to exceed 2 seconds, think that handle resets, the input value of the handle now obtaining is handle median.Handle repeatedly obtains input parameter value, corresponding, and each handle all can obtain corresponding median while reset, in the time that actual input parameter maximal value is arrived in study, record and preserve corresponding median, as the median in formula (1).
Under ideal state; median is 0; in practical operation, owing to there being the factor such as machine error, performance accuracy, median conventionally can be near 0 o'clock; compared with the actual input parameter value of handle; median is very little numerical value, therefore, if the absolute value of actual input parameter value is less than or equal to the absolute value of median; and handle obtains the lasting time of this actual input parameter and exceedes 2 seconds (being that handle keeps this state to exceed 2 seconds), can think that handle is in reset mode.
Due to the reason of mechanical part structure itself, handle all resets (returning 0) completely at every turn, can unavoidably produce error, therefore need to gather the median (error amount) of handle reality, and in parametric calibration process, this error amount is taken into account.For one direction handle and twocouese handle, the peaked ratio of median and input parameter is conventionally at (1%~1%).
Handle median also can be only in the time that system powers on (the study number of times of input parameter maximal value, median is all 0 o'clock) obtain once.
Preferably, judge that the duration of this operation of handle for example exceedes, after schedule time threshold value (2 seconds), then record this median, to prevent from touching the maloperation of handle etc. by mistake.
Fig. 2 shows one and obtains the peaked flow process of handle input parameter, and this flow process comprises:
Step 21, judges whether to meet self calibration entry condition, if meet, performs step 22, otherwise execution step 23.
Concrete, sentence the relation between duration and the schedule time threshold value of this operation of handle, if this duration exceedes schedule time threshold value, meet self calibration entry condition.
Step 22, records the actual input parameter value of handle.
Step 23, continues to wait for to meet self calibration entry condition.
Step 24, judges whether to learn this actual input parameter value, concrete, if the absolute value of the actual input parameter value of this operation of handle is greater than the absolute value of the reference input parameter of current preservation, performs step 25; Otherwise, execution step 26.
Step 25, preserves this actual input parameter value, and as the reference input parameter operating next time, the actual input parameter value of this operation is the input parameter maximal value of handle.
Step 26, abandons the actual input parameter of this operation, will handle in the reference input parameter of current preservation as input parameter maximal value.
For one direction handle, only need obtain the input parameter maximal value (forward input parameter maximal value or negative sense input maximal value) of a direction, complete above-mentioned steps 21-26, for twocouese handle, also need to obtain the input parameter maximal value of another direction, that is, input parameter maximal value comprises forward input parameter maximal value and/or the negative sense input parameter maximal value of handle, and detailed process can to obtain the peaked flow process of input parameter identical with one direction handle.
Take bidirectional handle as example, describe the flow process of the present embodiment parameter method for self-calibrating in detail below.
The output parameter maximal value of setting handle is 32767.Handle powers on, first user's joystick arrives forward boundary position, the input parameter value of this operation of handle is 127, and the input parameter value 127 of this operation is preserved and the next reference input parameter value (now input parameter maximal value is 127) operating of conduct; When user's release handle, handle automatically resets, and judges that the duration of this operation of handle exceeded for 2 seconds, records the median of handle, and in the present embodiment, this median is 1; If the input parameter value of the 2nd operation of handle is 128, handle is positive movement, because this input parameter value 128 is greater than reference input parameter value 127 (last time input parameter value), input parameter maximal value is 128, and using 128 as preserving with reference to input parameter value.When user's release handle, handle automatically resets, and judges that the duration of this operation of handle exceeded for 2 seconds, records this median of handle, if the median of this handle is also 1, can show that by formula (1) this output parameter value is 32767; If the input parameter value of the 3rd operation of handle is 126, the input parameter maximal value of handle is still 128 (abandoning 126).Handle median, this actual input parameter value 126 and the input parameter maximal value 128 of obtaining after handle is automatically reset brought formula (1) into and can obtain the output parameter value of this operation.In the present embodiment, be to arrive handle forward border with 3 operating grips of user, obtaining forward input parameter maximal value is the explanation that example is carried out, and in actual application, this number of times can be controlled voluntarily by user.
Negative sense input parameter maximal value obtains according to same method, and in the present embodiment, negative sense input parameter maximal value is-126.Positive and negative after input parameter maximal value when getting handle, user just can operate by joystick, and the actual input parameter value of handle is converted into the output parameter value in regulation output numerical range in real time.
For example, in the time that the actual input parameter value of handle is 100, because actual input parameter value 100 is greater than median 1, handle is positive movement, zone bit is 1, calculates the output parameter value after conversion: (100-1)/(128-1) × 32767 × 1=25542 according to formula (1).
Again for example, in the time that the actual input parameter value of handle is-80, because actual input parameter value-80 are less than median 1, handle is negative movement, zone bit is-1, calculates the output parameter value after conversion according to formula (1): (80-1)/(126-1) × 32767 × (1)=-20899.
The embodiment of the present invention is by the time meeting self calibration entry condition, according to the input parameter of the reference of the actual input parameter of this operation of operating control and preservation, obtain the input parameter maximal value of operating control and preserve, operating control is according to the input parameter maximal value of preserving, the median of operating control, and according to the determined output parameter scope of the output parameter maximal value of operating control, by this operation of operating control actual input parameter be converted to this operation output parameter and output, and within the output parameter that makes this operation is in described output parameter scope, thereby by the dissimilar input parameter of various operating controls, and the input parameter of different spans, automatically within being transformed into default output parameter numerical range, not only unify output parameter numerical range, for follow-up measurement, calculating provides convenience, also without artificial parameters, save cost of labor, reduce the time of production debugging.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be looked protection scope of the present invention.