Direction adjusting method, device and system for mobile machine

文档序号:1360985 发布日期:2020-08-11 浏览:5次 中文

阅读说明:本技术 移动机器的方向调整方法、装置及系统 (Direction adjusting method, device and system for mobile machine ) 是由 黄飞 常鸿洁 吴雄峰 朱江源 李云峰 李振 程昊天 于 2020-04-30 设计创作,主要内容包括:本申请实施例提供一种移动机器的方向调整方法、装置及系统,该方法包括:获取位移传感器当前检测值;根据标定的映射关系,计算位移传感器当前检测值对应的编码器预测值;输出第一转向信号,使编码器实时检测值从编码器预测值转变为标准值;输出在预设范围内往复转动的第二转向信号,当接收到编码器定位信号时,输出停止转向信号。本申请实施例提供的技术方案,在移动机器刚开机时,可以调整移动机器的启动方向处于预设的一个标准方向,例如车头正前方,提高行驶的安全性。(The embodiment of the application provides a method, a device and a system for adjusting the direction of a mobile machine, wherein the method comprises the following steps: acquiring a current detection value of a displacement sensor; calculating a predicted value of an encoder corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation; outputting a first steering signal to enable the real-time detection value of the encoder to be converted from the predicted value of the encoder to a standard value; and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder. According to the technical scheme provided by the embodiment of the application, when the mobile machine is just started, the starting direction of the mobile machine can be adjusted to be in a preset standard direction, for example, the front of a vehicle head, so that the driving safety is improved.)

1. A method of directional adjustment of a mobile machine, comprising:

acquiring a current detection value of a displacement sensor;

calculating a predicted value of an encoder corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation;

outputting a first steering signal to enable the real-time detection value of the encoder to be converted from the prediction value of the encoder to a standard value;

and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

2. The method of claim 1, wherein prior to calculating an encoder detection value corresponding to a current detection value of the displacement sensor, the method further comprises:

acquiring a numerical combination corresponding to a first direction and a numerical combination corresponding to a second direction; the numerical combination comprises a displacement sensor detection value and an encoder detection value;

and calibrating the mapping relation between the detection value of the displacement sensor and the detection value of the encoder according to the numerical value combination corresponding to the first direction and the numerical value combination corresponding to the second direction.

3. The method of claim 2, wherein the first direction is a zero direction, and the obtaining a combination of values corresponding to the first direction comprises:

when the encoder positioning signal point coincides with the zero point direction, the encoder real-time detection value is returned to zero and used as the encoder detection value;

and combining the displacement sensor detection value of the current position and the encoder detection value to form a numerical value combination corresponding to the first direction.

4. The method of claim 3, wherein after zeroing the encoder real-time detection values, the method further comprises:

and assigning the real-time detection value of the encoder which is reset to zero to the standard value.

5. The method of claim 3, wherein the photoelectric detection device of the encoder is installed in advance in alignment with the zero point direction, and before zeroing the real-time detection value of the encoder, the method further comprises:

and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

6. The method of claim 1, further comprising:

acquiring a detection value of an encoder and a detection value of a displacement sensor in the moving process of the mobile machine;

judging whether the encoder detection value and the displacement sensor detection value are both in a standard range;

if any one numerical item of the encoder detection value or the displacement sensor detection value is not in the standard range, calculating the correct numerical value of the numerical item not in the standard range according to the calibrated mapping relation and the numerical item in the standard range;

replacing the numerical terms that are not within the standard range with the correct numerical values.

7. The method of claim 6, wherein after determining whether the encoder detection value and the displacement sensor detection value are both within a standard range, the method further comprises:

and if the detection value of the encoder and the detection value of the displacement sensor are not in the standard range, sending an alarm signal.

8. A method of directional adjustment of a mobile machine, comprising:

acquiring a current detection value of a displacement sensor;

calculating a predicted value of an encoder corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation;

outputting a first steering signal to enable the real-time detection value of the encoder to change from the predicted value of the encoder to the standard value;

and if the encoder positioning signal is not received when the real-time detection value of the encoder is converted into the standard value, outputting a steering stopping signal when the encoder positioning signal is received in a first preset range beyond the standard value.

9. The method of claim 8, further comprising: and if the real-time detection value of the encoder is converted into the standard value, receiving an encoder positioning signal, and outputting a steering stopping signal.

10. The method of claim 8, further comprising:

if the encoder real-time detection value is converted into a standard value, the encoder positioning signal is not received in a first preset range beyond the standard value, a second steering signal which rotates in a reciprocating mode in the first preset range is output, and when the encoder positioning signal is received, a steering stopping signal is output;

and if the encoder positioning signal is not received by the reciprocating rotation within the first preset range, continuously expanding the reciprocating rotation range until the encoder positioning signal is received, and outputting a steering stopping signal.

11. The method of claim 10, wherein outputting a stop steer signal upon receiving the encoder positioning signal comprises:

when an encoder positioning signal is received, zeroing a real-time detection value of an encoder;

when the real-time detection value of the encoder returns to zero again, the turning stopping signal is output.

12. A directional adjustment device for a mobile machine, comprising:

the data acquisition module is used for acquiring the current detection value of the displacement sensor;

the numerical value calculation module is used for calculating the encoder predicted value corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation;

the steering control module is used for outputting a first steering signal to enable the real-time detection value of the encoder to be converted into a standard value from the prediction value of the encoder;

and the deviation adjusting module is used for outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

13. An electronic device, characterized in that the electronic device comprises:

a processor;

a memory for storing processor-executable instructions;

wherein the processor is configured to perform the method of directional adjustment of a mobile machine of any of claims 1-11.

14. A computer-readable storage medium, characterized in that the storage medium stores a computer program executable by a processor to perform the method of directional adjustment of a mobile machine according to any one of claims 1-11.

15. A directional adjustment system for a mobile machine, comprising:

the displacement sensor is used for converting the displacement generated by the mobile machine into a first electric signal;

an encoder for converting an angular displacement of the mobile machine into a second electrical signal;

a controller connected to the displacement sensor and the encoder, for converting the first electrical signal into a current detection value of the displacement sensor, converting the second electrical signal into a real-time detection value of the encoder, and performing the method of any one of claims 1 to 11; and the number of the first and second groups,

and the steering motor is connected with the steering motor and used for receiving the first steering signal, the second steering signal and the stopping steering signal and executing corresponding actions.

Technical Field

The present disclosure relates to the field of intelligent control technologies, and in particular, to a method, an apparatus, and a system for adjusting a direction of a mobile machine, an electronic device, and a computer-readable storage medium.

Background

The mobile machine is a device capable of moving, and examples thereof include a wheeled mobile robot, a walking mobile robot, a snake robot, a crawler mobile robot, and a crawling robot. A vehicle is a common type of mobile machine.

For example, in a vehicle, the wheels are driven by a motor to move the vehicle forward or backward. At present, after a vehicle is started, a driver cannot generally judge the current wheel direction, and needs to judge whether the wheel direction faces the front direction or not by rotating a steering wheel, so that the operation is complicated, and the intelligence level is low.

Disclosure of Invention

The embodiment of the application provides a direction adjusting method of a mobile machine, which comprises the following steps: acquiring a current detection value of a displacement sensor; calculating a predicted value of an encoder corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation; outputting a first steering signal to enable the real-time detection value of the encoder to be converted from the prediction value of the encoder to a standard value; and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

According to the technical scheme, the current detection value of the displacement sensor is obtained, the corresponding encoder prediction value is calculated according to the mapping relation, the direction of the mobile machine is adjusted by outputting the first steering signal firstly, the real-time detection value of the encoder is changed from the encoder prediction value to a standard value, then the second steering signal is output to enable the mobile machine to swing left and right in a small range, when the encoder positioning signal is received in the left-right swinging process, the steering stopping signal is output, therefore, when the mobile machine is just started, the starting direction of the mobile machine can be adjusted to be in a preset standard direction (for example, the front of a vehicle head), and the driving safety is improved.

In one embodiment, before calculating the encoder detection value corresponding to the displacement sensor detection value, the method further comprises the steps of acquiring a numerical combination corresponding to a first direction and a numerical combination corresponding to a second direction; the numerical combination comprises a displacement sensor detection value and an encoder detection value; and calibrating the mapping relation between the detection value of the displacement sensor and the detection value of the encoder according to the numerical value combination corresponding to the first direction and the numerical value combination corresponding to the second direction.

In the above embodiment, the mapping relationship between the detection value of the displacement sensor and the detection value of the encoder is calibrated by obtaining two groups of numerical combinations including the detection value of the displacement sensor and the detection value of the encoder, so that the accuracy of the mapping relationship is improved.

In an embodiment, the obtaining the numerical combination corresponding to the first direction includes: when the encoder positioning signal point coincides with the zero point direction, the encoder real-time detection value is returned to zero and used as the encoder detection value; and combining the displacement sensor detection value of the current position and the encoder detection value to form a numerical value combination corresponding to the first direction.

In the above embodiment, the zero point direction is set as the first direction, and when the encoder positioning signal point coincides with the zero point direction, the real-time detection value of the encoder is zeroed, so that the encoder detection value in the first direction is 0, and the displacement sensor detection value when the mobile machine is in the zero point direction and the encoder detection value 0 form a numerical value combination in the first direction, which can reduce the complexity of calculation.

In an embodiment, after zeroing the encoder real-time detection value, the method further comprises: and assigning the real-time detection value of the encoder which is reset to zero to the standard value.

In the above embodiment, the standard value is also set to zero, which can reduce the complexity of calculation and ensure that the starting direction of the mobile machine is the zero-point direction.

In one embodiment, the photoelectric detection device of the encoder is installed in advance in alignment with the zero point direction, and before the real-time detection value of the encoder is zeroed, the method further comprises: and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

In the above embodiment, the second steering signal is output to enable the steering motor to rotate in a reciprocating manner within the preset range, so as to drive the encoder to rotate in a reciprocating manner, when the encoder positioning signal is received, the encoder positioning signal point is aligned with the photoelectric detection device, and the photoelectric detection device of the encoder is installed in a way of aligning with the zero point direction, so that the encoder positioning signal point is overlapped with the zero point direction, and at this time, the steering signal is output to stop the encoder from rotating, so that the encoder positioning signal point is overlapped with the zero point direction.

In an embodiment, the method provided in the embodiment of the present application further includes: acquiring a detection value of an encoder and a detection value of a displacement sensor in the moving process of the mobile machine; judging whether the encoder detection value and the displacement sensor detection value are both in a standard range; if any one numerical item of the encoder detection value or the displacement sensor detection value is not in the standard range, calculating the correct numerical value of the numerical item not in the standard range according to the calibrated mapping relation and the numerical item in the standard range; replacing the numerical terms that are not within the standard range with the correct numerical values.

In the above embodiment, when one of the values of the encoder detection value and the displacement sensor detection value is not within the standard range, the correct value of the value item not within the standard range may be calculated by using one of the correct value types according to the mapping relationship, so as to perform the function of correcting the detection result.

In one embodiment, after determining whether the encoder detection value and the displacement sensor detection value are both within a standard range, the method further comprises: and if the detection value of the encoder and the detection value of the displacement sensor are not in the standard range, sending an alarm signal.

In the embodiment, the alarm signal is sent out when the detection value of the encoder and the detection value of the displacement sensor are not within the standard range, so that the reminding effect is achieved, and the safety is improved.

The embodiment of the application also provides another direction adjusting method of a mobile machine, which comprises the following steps:

acquiring a current detection value of a displacement sensor;

calculating a predicted value of an encoder corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation;

outputting a first steering signal to enable the real-time detection value of the encoder to change from the predicted value of the encoder to the standard value;

and if the encoder positioning signal is not received when the real-time detection value of the encoder is converted into the standard value, outputting a steering stopping signal when the encoder positioning signal is received in a first preset range beyond the standard value.

In an embodiment, the method further includes: and if the real-time detection value of the encoder is converted into the standard value, receiving an encoder positioning signal, and outputting a steering stopping signal.

In an embodiment, the method further includes:

if the encoder real-time detection value is converted into a standard value, the encoder positioning signal is not received in a first preset range beyond the standard value, a second steering signal which rotates in a reciprocating mode in the first preset range is output, and when the encoder positioning signal is received, a steering stopping signal is output;

and if the encoder positioning signal is not received by the reciprocating rotation within the first preset range, continuously expanding the reciprocating rotation range until the encoder positioning signal is received, and outputting a steering stopping signal.

In one embodiment, the outputting the stop steering signal when the encoder positioning signal is received by the method includes: when an encoder positioning signal is received, zeroing a real-time detection value of an encoder; when the real-time detection value of the encoder returns to zero again, the turning stopping signal is output.

An embodiment of the present application further provides a direction adjustment apparatus for a mobile machine, including:

the data acquisition module is used for acquiring the current detection value of the displacement sensor;

the numerical value calculation module is used for calculating the encoder predicted value corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation;

the steering control module is used for outputting a first steering signal to enable the real-time detection value of the encoder to be converted into a standard value from the prediction value of the encoder;

and the deviation adjusting module is used for outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

In an embodiment, the apparatus provided in the embodiment of the present application further includes:

the combination obtaining module is used for obtaining a numerical combination corresponding to the first direction and a numerical combination corresponding to the second direction; the numerical combination comprises a displacement sensor detection value and an encoder detection value;

and the relationship calibration module is used for calibrating the mapping relationship between the detection value of the displacement sensor and the detection value of the encoder according to the numerical value combination corresponding to the first direction and the numerical value combination corresponding to the second direction.

In an embodiment, the first direction is a zero point direction, and the combination obtaining module includes:

the numerical value zeroing unit is used for zeroing the real-time detection value of the encoder when the positioning signal point of the encoder coincides with the zero point direction, and the zeroing value is used as the detection value of the encoder;

and the combination construction unit is used for forming a numerical combination corresponding to the first direction by using the displacement sensor detection value of the current position and the encoder detection value.

In an embodiment, the apparatus provided in the embodiment of the present application further includes:

and the assignment module is used for assigning the real-time detection value of the encoder which returns to zero to the standard value.

In one embodiment, the photoelectric detection device of the encoder is installed in advance aligned with the zero point direction, and the deviation adjustment module is further configured to output a second steering signal that rotates back and forth within a preset range before the real-time detection value of the encoder is reset to zero, and output a steering stopping signal when receiving the positioning signal of the encoder.

In an embodiment, the apparatus provided in the embodiment of the present application further includes:

the mobile data acquisition module is used for acquiring a detection value of the encoder and a detection value of the displacement sensor in the moving process of the mobile machine;

the data judgment module is used for judging whether the detection value of the encoder and the detection value of the displacement sensor are both in a standard range;

the correct value calculating module is used for calculating the correct value of the numerical item which is not in the standard range according to the calibrated mapping relation and the numerical item which is in the standard range if any one numerical item of the detection value of the encoder or the detection value of the displacement sensor is not in the standard range;

and the data replacement module is used for replacing the numerical item which is not in the standard range with the correct numerical value.

In an embodiment, the apparatus provided in the embodiment of the present application further includes: and the alarm module is used for sending an alarm signal if the detection value of the encoder and the detection value of the displacement sensor are not in the standard range.

An embodiment of the present application further provides an electronic device, where the electronic device includes:

a processor;

a memory for storing processor-executable instructions;

wherein the processor is configured to perform any one of the above-described methods of directional adjustment of a mobile machine.

The embodiment of the application also provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program can be executed by a processor to complete the direction adjusting method of the mobile machine.

An embodiment of the present application further provides a direction adjustment system of a mobile machine, including:

the displacement sensor is used for converting the displacement generated by the mobile machine into a first electric signal;

an encoder for converting an angular displacement of the mobile machine into a second electrical signal;

the controller is connected with the displacement sensor and the encoder and is used for converting the first electric signal into a current detection value of the displacement sensor, converting the second electric signal into a real-time detection value of the encoder and executing the direction adjusting method of the mobile machine provided by the embodiment of the application; and the number of the first and second groups,

and the steering motor is connected with the steering motor and used for receiving the first steering signal, the second steering signal and the stopping steering signal and executing corresponding actions.

The direction adjusting device, the system, the electronic device and the storage medium of the mobile machine have the same technical effects as the direction adjusting method of the mobile machine, and can adjust the starting direction of the mobile machine to be in a preset standard direction (such as the right front of a vehicle head) when the mobile machine is just started, so that the driving safety is improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below.

FIG. 1 is a block diagram of a directional adjustment system for a mobile machine according to an embodiment of the present disclosure;

fig. 2 is a schematic diagram of a frame of an electronic device provided in an embodiment of the present application;

FIG. 3 is a schematic diagram of a computer-readable storage medium provided by an embodiment of the present application;

fig. 4 is a schematic flowchart of a method for adjusting a direction of a mobile machine according to an embodiment of the present disclosure;

fig. 5 is a schematic flowchart of mapping relationship calibration provided in the embodiment of the present application on the basis of the corresponding embodiment of fig. 4;

FIG. 6 is a schematic flow chart illustrating a process of obtaining a numerical combination corresponding to a first direction in the embodiment corresponding to FIG. 5;

fig. 7 is a schematic flowchart of a method for adjusting a direction of a mobile machine according to an embodiment of the present application based on the embodiment of fig. 4;

FIG. 8 is a flow chart illustrating a method for adjusting the orientation of a mobile machine according to another embodiment of the present disclosure;

fig. 9 is a block diagram of a direction adjustment device of a mobile machine according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.

Like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.

Fig. 1 is a schematic diagram of a frame of a directional adjustment system of a mobile machine according to an embodiment of the present disclosure. The adjustment system may be part of a mobile machine for adjusting the orientation of the mobile machine. In one embodiment, the mobile machine may be a vehicle, mobile robot, or other mechanical device requiring adjustment of direction. As shown in fig. 1, the adjustment system 110 includes: displacement sensor 111, encoder 112, controller 113 and steering motor 114.

The displacement sensor 111 is used for converting the angular displacement of the mobile machine into a first electric signal. The displacement sensor 111 may be a potentiometer or a hall element. In one embodiment, the first electrical signal may be a voltage signal output by a potentiometer. In one embodiment, the angular displacement of the mobile machine may be considered a change in the direction of the vehicle head, i.e., the steering wheel angle of rotation. For example, when the front of the vehicle head is considered to be the zero point direction, and the head faces the front, the potentiometer outputs a voltage signal of 2.5V (volts). When the steering wheel rotates clockwise or anticlockwise, the sliding piece of the potentiometer is driven to move, so that the resistance of the potentiometer is changed, and the output voltage is changed. In one embodiment, when the steering wheel rotates anticlockwise, the potentiometer outputs a 0-2.5V voltage signal according to different rotation angles, and when the steering wheel rotates clockwise, the potentiometer outputs a 2.5V-5V voltage according to different rotation angles. The steering wheel rotation angle (i.e., the direction of the vehicle head) can be determined based on the output voltage of a potentiometer connected to the steering wheel.

The encoder 112 is used to convert the angular displacement of the mobile machine into a second electrical signal. In one embodiment, the encoder 112 may be an incremental encoder. The incremental encoder converts the angular displacement into a periodic electric signal, converts the electric signal into counting pulses, and expresses the size of the angular displacement by the number of the pulses. The second electrical signal may be an electrical signal representative of the number of pulses output by the incremental encoder. For example, in one embodiment, the steering wheel is rotated 90 degrees clockwise, and the number of pulses is 3000.

The controller 113 is connected to the displacement sensor 111 and can receive the first electrical signal transmitted by the displacement sensor 111. The first electrical signal is then converted into a current detection value of the displacement sensor 111 through analog-to-digital conversion. For example, the current detection value of the displacement sensor 111 may be 2V, thereby indicating that the steering wheel rotates counterclockwise by a corresponding angle, and the head of the vehicle is displaced from the zero point direction.

The controller 113 may also be connected to the encoder 112, receive the second electrical signal sent by the encoder 112, and convert the second electrical signal into a real-time encoder detection value. For example, the controller 113 may convert the second electrical signal into a number of pulse signals through analog-to-digital conversion, and use the number of pulse signals as a real-time detection value of the encoder. Thereafter, the controller 113 may output a first steering signal, a second steering signal, and a stop steering signal for controlling the rotation of the steering motor 114 to adjust the direction of the mobile machine using a direction adjustment method of the mobile machine provided in an embodiment of the present application described below.

The steering motor 114 is connected to the controller 113, and can perform corresponding actions by receiving the first steering signal sent by the controller 113, performing corresponding actions by receiving the second steering signal sent by the controller 113, and performing corresponding actions by receiving the third steering signal sent by the controller 113. In one embodiment, the steering motor 114 may be coupled to a wheel, and the wheel may be rotated by the rotation of the steering motor 114, so that the direction of the mobile machine may be adjusted.

Fig. 2 is a schematic diagram of a framework of an electronic device provided in an embodiment of the present application. The electronic device 210 may be the controller 113 in the above-described embodiments. The electronic device 210 comprises a processor 211 and a memory 212 for storing processor-executable instructions; the processor 211 may be configured to execute a direction adjustment method of a mobile machine provided in the following embodiments of the present application.

The processor 211 may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. Which may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application.

The Memory 212 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk.

Fig. 3 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The storage medium 310 stores a computer program 311, and the computer program 311 can be executed by the processor 211 to implement the method for adjusting the direction of the mobile machine according to the following embodiments of the present application.

The following provides a detailed description of a method for adjusting the direction of a mobile machine according to an embodiment of the present application.

Fig. 4 is a flowchart illustrating a method for adjusting a direction of a mobile machine according to an embodiment of the present disclosure. The method may be performed by the controller 113 in the above-described embodiment, and as shown in fig. 4, the method includes the following steps S410 to S440.

Step 410: and acquiring the current detection value of the displacement sensor.

Referring to the description of the above embodiment, the controller may receive the first electrical signal sent by the displacement sensor, and obtain the current detection value of the displacement sensor by performing AD (analog-to-digital) conversion on the first electrical signal. The current detection value of the displacement sensor is used for representing the angular displacement of the mobile machine detected at the current moment relative to the zero point direction. The zero point direction is a preset direction, and may be a direction in which the mobile machine travels straight, for example, a direction directly in front of the vehicle. For example, the current detection value of the displacement sensor may be 0-5V, 2.5V indicates that the mobile machine is in the zero-point direction, less than 2.5V indicates that the mobile machine has rotated counterclockwise relative to the zero-point direction, and more than 2.5V indicates that the mobile machine has rotated clockwise relative to the zero-point direction.

Step 420: and calculating the encoder predicted value corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation.

The mapping relation is a functional relation between the displacement detection result of the displacement sensor on the mobile machine and the displacement detection result of the encoder on the mobile machine. The mapping relation can be obtained by calibration in advance, namely a set of displacement detection results are known to be (x)1And y1) And the other set of displacement detection results is (x)2And y2) And calculating a and b to obtain a functional relation y between x and y, wherein the functional relation is ax + b. x represents the displacement detection result of the displacement sensor, and y represents the displacement detection result of the encoder.

In one embodiment, based on the mapping relationship y ═ ax + b, the current detection value of the displacement sensor may be used as the x value, and the x value may be substituted into the formula, and the calculated y value may be used as the corresponding predicted encoder value. The predicted value of the encoder is calculated according to the current detection value of the displacement sensor, and the predicted value of the encoder is calculated according to the current detection value of the displacement sensor. The real-time detection value of the encoder is the actual detection result of the encoder on the displacement, and the real-time detection value of the encoder and the predicted value of the encoder can represent the angular displacement of the mobile machine by the number of pulses. In one embodiment, the number of pulses may be 0 when the mobile machine is in the zero direction, the number of pulses when the mobile machine is rotating clockwise is represented by a positive number, the number of pulses when the mobile machine is rotating counterclockwise is represented by a negative number, and the larger the rotation angle, the larger the absolute value of the number of pulses.

Step 430: and outputting a first steering signal to enable the encoder real-time detection value to be converted from the encoder prediction value to a standard value.

The standard value is an actual detection value of the encoder in the zero point direction calibrated by the potentiometer, and in one embodiment, the standard value may be 0. The first steering signal is used for controlling the steering motor to rotate, so that the wheels are driven to rotate, and the direction of the mobile machine is changed. Because the grating disk of the encoder is coaxial with the steering motor, the rotation of the steering motor can drive the grating disk of the encoder to rotate, and therefore the real-time detection value of the encoder is changed.

In one embodiment, assuming that the predicted value of the encoder is 5000 pulses, the controller outputs a first steering signal to the steering motor to drive the steering motor to rotate, so as to change the real-time detected value of the encoder from 5000 to 0. In one embodiment, the controller may output the first steering signal to drive the steering motor to rotate by the corresponding rotation amount, and may calculate the rotation amount of the steering motor corresponding to the change from the predicted value to the standard value of the encoder according to a relationship between the rotation amount of the steering motor and the change of the detected value of the encoder.

Step 440: and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

The encoder can output three groups of pulses A, B and Z phase, the phase difference between A and B two groups of pulses is 90 degrees, so the rotation direction can be judged, and the real-time detection value of the encoder can be obtained by counting the number of A pulses. The encoder is provided with a positioning signal point, and a positioning signal, namely Z-phase pulse, can be output when the encoder rotates for one circle. Because the detection results of the encoder and the potentiometer have errors, when the real-time detection value of the encoder reaches a standard value, the direction of the mobile machine may slightly deviate from the zero point direction. The positioning signal point of the encoder can be arranged in the zero point direction, so that the moving machine can be adjusted to the zero point direction by swinging the direction of the moving machine leftwards and rightwards by a small amplitude when the positioning signal is received, and the moving machine can be controlled to stop rotating.

In order to realize the small-amplitude left-right swing of the mobile machine, the controller can output a second steering signal which rotates in a reciprocating manner within a preset range to the steering motor, so that the steering motor is controlled to rotate clockwise and anticlockwise in a small-amplitude manner. Wherein, the preset range is less than the motor rotation amount corresponding to one rotation of the encoder. That is, when the steering motor drives the encoder to rotate back and forth, the rotation amount of the encoder is less than one turn. When the controller receives a positioning signal (Z-phase pulse signal) in the process of small left-right rotation of the mobile machine, the controller indicates that the mobile machine rotates to the zero point direction at the moment, so that the controller outputs a steering stopping signal to the steering motor, and the steering motor receives the steering stopping signal to stop rotating, so that the mobile machine can stop in the zero point direction.

In an embodiment, before the step 420, as shown in fig. 5, the method provided in the embodiment of the present application further includes the following steps S510 and S520.

Step S510: acquiring a numerical combination corresponding to a first direction and a numerical combination corresponding to a second direction; the combination of values includes a displacement sensor detection value and an encoder detection value.

Wherein the first direction and the second direction refer to the mobile machine being in two different directions. For the sake of distinction, it is referred to as a first direction and a second direction. The combination of values corresponding to the first direction refers to the detection value of the displacement sensor and the detection value of the encoder when the mobile machine is in the first direction. The combination of values corresponding to the second direction is the detection value of the displacement sensor and the detection value of the encoder when the mobile machine is in the second direction.

Step S520: and calibrating the mapping relation between the detection value of the displacement sensor and the detection value of the encoder according to the numerical value combination corresponding to the first direction and the numerical value combination corresponding to the second direction.

For example, the combination of the values corresponding to the first direction may be (x)1,y1) Denotes x1Indicating the detected value of the displacement sensor corresponding to the first direction, y1Indicating the encoder detection value corresponding to the first direction. The numerical value combination corresponding to the second direction can be (x)2,y2) Denotes x2Indicating the detected value of the displacement sensor corresponding to the second direction, y2Indicating the encoder detection value corresponding to the second direction.

According to (x)1,y1) And (x)2,y2) The a-value and the b-value in the mapping relationship y ═ ax + b between the detected value of the displacement sensor and the detected value of the encoder can be calculated.

In an embodiment, the first direction may be a zero point direction, and as shown in fig. 6, acquiring the value combination corresponding to the first direction may include the following steps S511 and S512.

Step S511: and when the positioning signal point of the encoder is coincident with the zero point direction, the real-time detection value of the encoder is reset to zero to serve as the detection value of the encoder.

Before the mobile machine leaves factory, the encoder positioning signal point can be adjusted in advance to be overlapped with the zero point direction of the mobile machine. The encoder positioning signal point refers to a mark point of a grating disc of the encoder which rotates for one circle, and a gap is formed at the mark point of the grating disc. The light emitting diode and the photoelectric detection device are arranged corresponding to the gap, and light sent by the light emitting diode can reach the photoelectric detection device after passing through the gap, so that the photoelectric detection device receives one-time illumination and indicates that the grating disk rotates for one circle. Therefore, the gap of the grating disk and the zero point direction of the moving machine are overlapped, and the real-time detection value of the encoder at this time is recorded as 0. The encoder detection value in the first direction is 0. The encoder positioning signal point is overlapped with the zero point direction, namely the connecting line from the center of the grating disk to the encoder positioning signal point is overlapped with the zero point direction.

In one embodiment, the zeroed encoder real-time detection values may be assigned to the standard values. Since the real-time detection value of the encoder is 0 when the mobile machine is in the zero point direction, the standard value of the encoder may be 0.

Step S512: and combining the displacement sensor detection value of the current position and the encoder detection value to form a numerical value combination corresponding to the first direction.

When the first direction is the zero-point direction, the encoder detection value in the zero-point direction obtained in step S511 is 0, and the displacement sensor detection value at that time is obtained. When the mobile machine is in the zero point direction, the detection value of the encoder and the detection value of the displacement sensor are combined as a numerical value corresponding to the first direction.

In one embodiment, in order to make the encoder positioning signal point coincide with the zero point direction of the mobile device, thereby resetting the encoder to zero, the photoelectric detection device of the encoder may be installed in advance in alignment with the zero point direction before the mobile device is shipped, and the encoder positioning signal point may be made to coincide with the zero point direction by the following step S500 before the real-time detection value of the encoder is reset to zero.

Step S500: and outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the positioning signal of the encoder.

The controller outputs a second steering signal, and the second steering signal is used for controlling the steering motor to rotate in a reciprocating mode within a preset range. The reciprocating rotation refers to clockwise and counterclockwise back-and-forth rotation, and as mentioned above, the preset range is smaller than the motor rotation amount corresponding to one rotation of the encoder.

The rotation of the steering motor can drive the grating disc of the encoder to rotate, so that in the process of driving the encoder to rotate in a reciprocating manner by the reciprocating rotation of the steering motor, when an encoder positioning signal is received, the photoelectric detection device is aligned to an encoder positioning signal point, and because the photoelectric detection device is installed in a way of being aligned to the zero point direction in advance, the photoelectric detection device is aligned to the zero point direction, so that when the encoder positioning signal is received, the encoder positioning signal point is indicated to be overlapped with the zero.

In an embodiment, as shown in fig. 7, the method provided in the embodiment of the present application may further include the following steps S710 to S720.

Step S710: and acquiring a detection value of the encoder and a detection value of the displacement sensor during the moving process of the mobile machine.

For example, during normal running of the vehicle, the encoder detection value and the displacement sensor detection value are acquired.

Step S720: and judging whether the encoder detection value and the displacement sensor detection value are both in a standard range.

And judging whether the detection value of the encoder is in the standard range and whether the detection value of the displacement sensor is in the standard range according to the preset standard range of the detection value of the encoder and the preset standard range of the detection value of the displacement sensor. Wherein, the standard range of the encoder detection value and the standard range of the displacement sensor detection value may be different.

Step S730: and if any one numerical item of the detection value of the encoder or the detection value of the displacement sensor is not in the standard range, calculating the correct numerical value of the numerical item which is not in the standard range according to the calibrated mapping relation and the numerical item which is in the standard range.

In one embodiment, assuming that the encoder detection value is not within the standard range, the displacement sensor detection value is substituted into the above expression as the x value to calculate the y value, and the calculated y value is used as the correct value of the encoder detection value, based on the displacement sensor detection value and the mapping relationship y being ax + b. At this time, the detection value of the encoder belongs to the numerical item which is not in the standard range, and the calculated y value represents the correct numerical value of the numerical item which is not in the standard range.

In one embodiment, if the detected value of the displacement sensor is not within the standard range, the detected value of the encoder is substituted into the above expression as the y value based on the detected value of the encoder and the mapping relationship y being ax + b, and the x value is calculated as the correct value of the detected value of the displacement sensor. At this time, the detection value of the displacement sensor belongs to the numerical item which is not in the standard range, and the calculated x value represents the correct numerical value of the numerical item which is not in the standard range.

Step S740: replacing the numerical terms that are not within the standard range with the correct numerical values.

For example, if the encoder detection value is not within the standard range, the encoder detection value can be replaced by the correct value of the encoder detection value calculated by the mapping relation. For example, if the detected value of the displacement sensor is not within the standard range, the correct value of the detected value of the displacement sensor calculated by the mapping relationship may replace the detected value of the displacement sensor. By the method, the wrong detection result can be corrected, and the data accuracy is improved.

In an embodiment, after determining in step S720 whether the encoder detection value and the displacement sensor detection value are both within the standard range, the method provided in this embodiment may further include the following step S750: and if the detection value of the encoder and the detection value of the displacement sensor are not in the standard range, sending an alarm signal.

When the detection value of the encoder and the detection value of the displacement sensor are not in the standard range, the mobile machine may break down, so that the controller may send an alarm signal for safety. In one embodiment, the controller may send an alert signal to the display screen to display a corresponding reminder message on the display screen. In one embodiment, the controller may send an alarm signal to the indicator lights, so as to illuminate the corresponding indicator lights for reminding.

Fig. 8 is a flowchart illustrating a method for adjusting a direction of a mobile machine according to another embodiment of the present disclosure, and as shown in fig. 8, the method may include the following steps S910 to S940.

Step S910: acquiring a current detection value of a displacement sensor;

step S920: calculating a predicted value of an encoder corresponding to the current detection value of the displacement sensor according to the calibrated mapping relation;

step S930: outputting a first steering signal to enable the real-time detection value of the encoder to change from the predicted value of the encoder to the standard value;

step S940: and if the encoder positioning signal is not received when the real-time detection value of the encoder is converted into the standard value, outputting a steering stopping signal when the encoder positioning signal is received in a first preset range beyond the standard value.

The steps S910 to S930 may refer to the steps S410 to S430 in the embodiment corresponding to fig. 4. The difference from the corresponding embodiment of fig. 4 is that the encoder rotates from the predicted value (e.g. 100) to 0 (i.e. the standard value) in step S930, and continues to rotate forward by a certain angle (i.e. the first preset range, which may be-300 pulses) if the encoder positioning signal is not received in step S940 when passing 0. If an encoder positioning signal is received during this rotation, it can be stopped at this position, i.e. rotated to the zero direction of the moving machine.

In one embodiment, if the encoder positioning signal is received when the real-time detection value of the encoder is converted into the standard value, the steering stopping signal is output.

That is, if the encoder receives an encoder positioning signal while passing 0, it may stop at this position.

In one embodiment, if the encoder real-time detection value is converted into a standard value, an encoder positioning signal is not received, and the encoder positioning signal is not received in a first preset range beyond the standard value, a second steering signal rotating in a reciprocating manner in a second preset range is output, and when the encoder positioning signal is received, a steering stopping signal is output; and if the reciprocating rotation within the second preset range does not receive the encoder positioning signal, continuously expanding the reciprocating rotation range until the encoder positioning signal is received, and outputting a steering stopping signal.

That is, if the encoder does not receive the encoder positioning signal when passing through 0, continues to rotate forward by a certain angle, and does not receive the encoder positioning signal, the controller outputs a second steering signal that reciprocates within a second preset range, thereby rotating the encoder back by a certain angle (e.g., +300 pulses). Assuming that the encoder positioning signal is received back at the pulse 105, it stops at this position. Conversely, if the encoder positioning signal is not received after the encoder is rotated back by a certain angle, the reciprocating rotation range can be enlarged, for example, from-1000 pulses to +1000 pulses, and then from-2000 pulses to +2000 pulses, so as to continuously enlarge the reciprocating rotation range of the encoder until the encoder positioning signal is received, and the encoder positioning signal is stopped at the position.

In one embodiment, outputting the stop steer signal upon receiving the encoder positioning signal may include: when an encoder positioning signal is received, zeroing a real-time detection value of an encoder; when the real-time detection value of the encoder returns to zero again, the turning stopping signal is output.

That is, when receiving the encoder positioning signal, the encoder may not stop immediately, and may continue to rotate in the previous rotation direction, and return to the position where the real-time detection value of the encoder is 0 again, thereby avoiding the occurrence of shock when the encoder stops suddenly.

The following are embodiments of the apparatus of the present application that may be used to implement embodiments of the method for adjusting the orientation of a mobile machine of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method for adjusting the direction of the moving machine of the present application.

Fig. 9 is a block diagram of a direction adjustment apparatus of a mobile machine according to an embodiment of the present application, and as shown in fig. 9, the direction adjustment apparatus 800 of the mobile machine includes: a data acquisition module 810, a numerical calculation module 820, a steering control module 830, and a deviation adjustment module 840.

And the data acquisition module 810 is configured to acquire a current detection value of the displacement sensor.

And a numerical calculation module 820, configured to calculate, according to the calibrated mapping relationship, an encoder prediction value corresponding to the current detection value of the displacement sensor.

And a steering control module 830, configured to output a first steering signal, so that the real-time detection value of the encoder is converted from the prediction value of the encoder to a standard value.

And the deviation adjusting module 840 is used for outputting a second steering signal which rotates in a reciprocating manner within a preset range, and outputting a steering stopping signal when receiving the encoder positioning signal.

In an embodiment, the direction adjustment apparatus 800 of the mobile machine provided in the embodiment of the present application further includes:

a combination obtaining module 850, configured to obtain a numerical combination corresponding to the first direction and a numerical combination corresponding to the second direction; the numerical combination comprises a displacement sensor detection value and an encoder detection value;

and a relation calibration module 860, configured to calibrate a mapping relation between the detection value of the displacement sensor and the detection value of the encoder according to the numerical combination corresponding to the first direction and the numerical combination corresponding to the second direction.

In an embodiment, the first direction is a zero point direction, and the combination obtaining module 850 includes:

a numerical value zeroing unit 851, configured to zero the real-time detection value of the encoder when the encoder positioning signal point coincides with the zero point direction, as the encoder detection value;

a combination construction unit 852, configured to construct a numerical combination corresponding to the first direction by using the displacement sensor detection value of the current position and the encoder detection value.

In an embodiment, the direction adjustment apparatus 800 of the mobile machine provided in the embodiment of the present application further includes:

and an assigning module 870 for assigning the zeroed encoder real-time detection value to the standard value.

In an embodiment, the photoelectric detection device of the encoder is installed in advance aligned with the zero point direction, and the deviation adjustment module 840 is further configured to output a second steering signal that rotates back and forth within a preset range before the real-time detection value of the encoder is reset to zero, and output a steering stopping signal when receiving the encoder positioning signal.

In an embodiment, the direction adjustment apparatus 800 of the mobile machine provided in the embodiment of the present application further includes:

a movement data acquisition module 801, configured to acquire a detection value of an encoder and a detection value of a displacement sensor during a movement process of the mobile machine;

a data determining module 802, configured to determine whether the encoder detection value and the displacement sensor detection value are both within a standard range;

a correct value calculating module 803, configured to calculate, if any one of the value items of the encoder detection value or the displacement sensor detection value is not within the standard range, a correct value of the value item not within the standard range according to the calibrated mapping relationship and the value item within the standard range;

a data replacing module 804, configured to replace the numerical item that is not within the standard range with the correct numerical value.

In an embodiment, the direction adjustment apparatus 800 of the mobile machine provided in the embodiment of the present application further includes: and an alarm module 805, configured to send an alarm signal if the encoder detection value and the displacement sensor detection value are not within the standard range.

The implementation processes of the functions and actions of the modules in the above-mentioned device are specifically described in the implementation processes of the corresponding steps in the above-mentioned direction adjustment method for the mobile machine, and are not described herein again.

In the embodiments provided in the present application, the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:光纤光栅边缘叠加滤波的波长解调方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类