Encoder zero position adjustment method, device, computer equipment and storage medium
By using CAN bus communication and encoder in the swing servo mechanism, the zero position deviation is automatically calculated and compensated, which solves the problem of inflexible manual zero position adjustment in the existing technology and achieves simplification, stability and cost reduction of zero position adjustment. .
Patent Information
- Application Number
- CN202211326328.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-10-25
AI Technical Summary
In the existing technology, manual adjustment of the zero position of the swing mechanism after it is installed on the carrier is not flexible enough, resulting in large attitude control errors, complex adjustment processes and high costs.
By using the CAN bus communication protocol in the swing servo mechanism to receive the zero position deviation configuration command, and combining the absolute encoder and the incremental encoder, the zero position deviation is automatically calculated and compensated to realize the zero position adjustment in the servo control.
It simplifies the zero adjustment process, reduces errors, improves stability and reliability, and reduces labor costs.
Smart Images

Figure CN115686042B
Abstract
Description
Technical Field
[0001] The present application relates to the field of encoder control technology, and in particular to an encoder zero position adjustment method, device, computer equipment and storage medium. Background Art
[0002] In the design of the flight control swing servo software, it is necessary to drive the swing engine nozzle to deflect as required through the swing servo mechanism. The swing servo mechanism is an important component of the rocket's final stage swing engine. During the flight, it receives the position command signal from the control system and drives the swing engine nozzle to deflect as required, thereby achieving attitude control. The zero position judgment of the swing servo mechanism is particularly important and will directly affect the attitude control. It is very necessary to find the zero position, adjust the zero position, and add the zero position deviation to the servo control.
[0003] In the prior art, the swing mechanism is usually installed in the carrier and then the zero position is manually adjusted. This method is not flexible enough and is inconvenient to adjust when the carrier is large; it is easy to have large errors, which affects the swing servo control; if the adjustment is not in place, it needs to be repeatedly disassembled and assembled, which has high labor costs. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose an encoder zero position adjustment method, device, computer equipment and storage medium to solve the problem in the prior art that the zero position is not flexible enough by installing a swing mechanism in a carrier and then manually adjusting it.
[0005] In order to solve the above technical problems, the present application provides an encoder zero position adjustment method, which adopts the following technical solution including the following steps:
[0006] Before performing the zero position deviation configuration, the swing servo mechanism receives a command to turn on the zero position deviation configuration switch from the control system through the CAN bus communication protocol, sets the zero position deviation interval, and performs the zero position deviation configuration;
[0007] According to the zero deviation interval, the zero deviation is adjusted to obtain a first zero deviation;
[0008] An absolute encoder and an incremental encoder are provided on the actuator, and the actuator drives the swing engine nozzle to deflect as required, reads the absolute encoder signal, calculates the zero position deviation according to the absolute encoder signal, and obtains the second zero position deviation;
[0009] The first zero position deviation and the second zero position deviation are compensated together in the servo control.
[0010] Furthermore, before the zero deviation configuration is performed, the swing servo mechanism receives a command to turn on the zero deviation configuration switch from the control system through the CAN bus communication protocol, sets the zero deviation interval, and the steps of performing the zero deviation configuration specifically include:
[0011] Receive the control system zero deviation configuration switch command and set it;
[0012] Execute zero deviation configuration switch command response;
[0013] Receive the control system zero deviation configuration command and set it;
[0014] Execute zero offset configuration command response.
[0015] Furthermore,
[0016] The step of adjusting the zero deviation according to the zero deviation interval to obtain the first zero deviation specifically includes:
[0017] Receive a zero-bit deviation, determine whether the zero-bit deviation falls within the zero-bit deviation interval, and if so, perform a CRC check on the zero-bit deviation to obtain a first CRC check code;
[0018] Writing the zero bit deviation and the first CRC check code to a specified flash sector;
[0019] Power off and restart;
[0020] After initialization, the zero bit deviation and the first CRC check code of the specified flash sector are read in, and a CRC check is performed on the read zero bit deviation to obtain a second CRC check code;
[0021] The second CRC check code is compared with the first CRC check code. If they are consistent, the zero position deviation is added to the initial zero position to obtain the first zero position deviation.
[0022] Furthermore, the actuator is provided with an absolute encoder and an incremental encoder, and the actuator drives the swing engine nozzle to deflect as required, and the step of reading the absolute encoder signal and calculating the zero position deviation according to the absolute encoder signal to obtain the second zero position deviation specifically includes:
[0023] Waiting for the absolute encoder data to be stable;
[0024] Collecting multiple zero position deviations of the absolute encoder within a preset collection period;
[0025] An average value of the multiple zero-position deviations is taken to obtain a second zero-position deviation.
[0026] Furthermore, the step of compensating the first zero position deviation and the second zero position deviation together in the servo control specifically includes:
[0027] Get the incremental encoder feedback angle information;
[0028] When the control angle sent by the swing servo setting control system through the CAN bus is zero, the control angle information is not received, and a synthetic control is performed at the current position of the incremental encoder and the first zero position deviation to control towards the relative zero position;
[0029] determining whether the second zero position deviation is obtained, and if so, compensating the second zero position deviation to the control angle;
[0030] Carry out secondary synthesis control and control towards absolute zero position;
[0031] Receive position control instructions from the control system and perform synthetic output.
[0032] Furthermore, the step of adjusting the zero deviation according to the zero deviation interval also includes:
[0033] Receive the zero-position deviation, determine whether the zero-position deviation falls within the zero-position deviation interval, otherwise discard the zero-position deviation and return abnormal information.
[0034] Furthermore, the zero position deviation interval refers to [-10% zero position deviation unit, +10% zero position deviation unit].
[0035] In order to solve the above technical problems, the present application also provides an encoder zero position adjustment device, which adopts the following technical solution, including:
[0036] A setting module is used to use the zero position deviation configuration switch command as a preamble command of the zero position deviation configuration command, turn on the zero position configuration switch and set the zero position deviation interval before executing the zero position deviation configuration command;
[0037] An adjustment module, used for adjusting the zero position deviation according to the zero position deviation interval;
[0038] A calculation module is used for an actuator provided with an absolute encoder and an incremental encoder, the actuator drives the swing engine nozzle to deflect as required, reads the absolute encoder signal, and calculates the zero position deviation according to the absolute encoder signal;
[0039] The synthesis module is used to synthesize the calculated zero position deviation into the servo control.
[0040] In order to solve the above technical problems, the present application also provides a computer device, which adopts the technical solution described below, including a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the above-mentioned encoder zero position adjustment method when executing the computer-readable instructions.
[0041] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, which adopts the technical solution described below, and stores computer-readable instructions on the computer-readable storage medium. When the computer-readable instructions are executed by the processor, the steps of the above-mentioned encoder zero position adjustment method are implemented.
[0042] Compared with the prior art, the present application has the following beneficial effects: by providing an absolute encoder and an incremental encoder on the actuator, the absolute encoder is used to obtain the zero position deviation value of the swing servo installed in the carrier; the incremental encoder is used to obtain the feedback angle information of the current position of the incremental encoder, and the feedback angle information is used for servo control synthesis output; the zero position is adjusted by receiving the control system command. The zero position adjustment is simple and easy, with small error, stable and reliable, and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 It is a diagram of the execution architecture of the encoder zero position adjustment method of the present application;
[0045] Figure 2 is a flow chart of an embodiment of the encoder zero position adjustment method of the present application;
[0046] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S101;
[0047] Figure 4 yes Figure 2 A flowchart of a specific implementation of step S103;
[0048] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S104;
[0049] Figure 6 It is a structural schematic diagram of an embodiment of an encoder zero position adjustment device of the present application;
[0050] Figure 7 It is a structural diagram of an embodiment of a computer device of the present application. DETAILED DESCRIPTION
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0052] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0054] Figure 1 : is a diagram of the execution architecture of the encoder zero position adjustment method of the present application. Figure 1 As shown, the swing servo software runs in the swing servo, and the swing servo on the arrow is used as a carrier for illustration. The swing servo receives the position control command from the control system, synthesizes the output through the control algorithm, drives the swing engine nozzle to deflect as required, and thus realizes the attitude control. Figure 1 Explain based on.
[0055] Embodiment 1
[0056] refer to Figure 2 , shows a flow chart of an embodiment of the encoder zero position adjustment method of the present application. The encoder zero position adjustment method comprises the following steps:
[0057] Step S101, before performing zero position deviation configuration, the swing servo mechanism receives a command to turn on the zero position deviation configuration switch from the control system through the CAN bus communication protocol, sets the zero position deviation interval, and performs zero position deviation configuration.
[0058] Since the zero-position deviation setting will directly affect the servo control, when the control system sets the zero-position deviation, a safety measure is required to prevent misoperation. The zero-position deviation configuration switch command is used as a pre-order command for the zero-position deviation configuration. Before performing the zero-position deviation configuration, the zero-position configuration switch must be turned on to perform subsequent actions. If the zero-position configuration switch is not turned on, the program directly returns an exception message after receiving the zero-position deviation configuration command. At the same time, the zero-position deviation needs to be limited in range, and the set zero-position deviation directly returns an exception message if it is unreasonable. The range of the zero-position deviation can be flexibly adjusted according to the actual situation. For example, in this embodiment, the zero-position deviation interval can be [-10% zero-position deviation unit, +10% zero-position deviation unit]. The zero-position deviation unit can be millimeters, centimeters, etc. according to the actual situation.
[0059] In specific implementation, step S101 may include the following steps:
[0060] Receive the control system zero deviation configuration switch command and set it. The execution source of the zero deviation configuration switch command is the control system, and the sink is the swing servo. The source refers to the publisher of the information, that is, the uploader, and the sink refers to the receiver of the information;
[0061] Execute the zero deviation configuration switch command response, the execution source of the zero deviation configuration switch command response is the swing servo, and the sink is the control system;
[0062] Receive the control system zero deviation configuration command and set it. The execution source of the zero deviation configuration command is the control system, and the sink is the swing servo;
[0063] Execute the zero-position deviation configuration command response. The execution source of the zero-position deviation configuration command response is the swing servo, and the sink is the control system.
[0064] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S101 in FIG. Figure 3 As shown, in this embodiment, step S101 may also include:
[0065] S1011. Power on the system.
[0066] S1012, receiving a zero deviation configuration switch command and setting it.
[0067] The execution source of the zero deviation configuration switch command is the control system, and the sink is the swing servo.
[0068] Receiving the control system zero deviation configuration switch command and setting it refers to a handshake method of the CAN bus communication protocol.
[0069] The control system CAN bus communication adopts the extended frame format of the CAN2.0B standard, and the 29-bit identifier is defined. The bus protocol follows the little-endian mode for the encoding and storage of the data field, with the low byte stored in the low address and the high byte stored in the high address. The encoding of 8-bit single-byte data follows the mode of placing the high bit of the data in the high bit of the byte and the low bit of the data in the low bit of the byte.
[0070] There are many stand-alone devices on the Arrow. In order to prevent irrelevant information from interfering with the execution nodes, the computer module must filter the CAN bus node information and only respond to information related to this node.
[0071] Zero deviation configuration switch command:
[0072]
[0073] The zero deviation setting process includes the CAN bus communication interaction process between the swing servo and the control system.
[0074] S1013, update the zero deviation configuration switch status and reply the result, and enter step S1019.
[0075] After receiving the CAN protocol from the control system, the swing servo program performs a handshake response.
[0076] Zero deviation configuration switch command response:
[0077]
[0078] S1014. Receive a zero deviation configuration command.
[0079] After the system is powered on in step S1031, the process proceeds to step S1034.
[0080] Zero deviation configuration command:
[0081]
[0082] Zero offset configuration command response:
[0083]
[0084]
[0085] S1015. Determine whether the zero deviation configuration switch is turned on. If so, execute step S1016; otherwise, execute step S1018.
[0086] S1016. Determine whether the zero position value is reasonable. If so, execute step S1017; otherwise, execute step S1018.
[0087] S1017. Update the zero position value and reply to the configuration result.
[0088] S1038. Feedback abnormal information.
[0089] S1039, end.
[0090] Step S102, adjusting the zero deviation according to the zero deviation interval to obtain a first zero deviation.
[0091] In specific implementation, step S102 may include the following steps:
[0092] Receive a zero-bit deviation, determine whether the zero-bit deviation falls within the zero-bit deviation interval, and if so, perform a CRC check on the zero-bit deviation to obtain a first CRC check code;
[0093] Writing the zero bit deviation and the first CRC check code to a specified flash sector;
[0094] Power off and restart;
[0095] After initialization, the zero bit deviation and the first CRC check code of the specified flash sector are read in, and a CRC check is performed on the read zero bit deviation to obtain a second CRC check code;
[0096] The second CRC check code is compared with the first CRC check code. If they are consistent, the zero position deviation is added to the initial zero position to obtain the first zero position deviation.
[0097] If the zero-bit deviation falls within the zero-bit deviation interval, the zero-bit deviation is considered to be a legal zero-bit deviation; otherwise, the zero-bit deviation is discarded and an exception message is returned.
[0098] In this way, after the swing servo is installed, there is no need to set the zero position deviation every time the power is turned on. It only needs to be set once to set the zero position deviation to the correct position.
[0099] Step S103, an absolute encoder and an incremental encoder are provided on the actuator, the actuator drives the swing engine nozzle to deflect as required, reads the absolute encoder signal, calculates the zero position deviation according to the absolute encoder signal, and obtains the second zero position deviation.
[0100] Figure 4 yes Figure 2 A flowchart of a specific implementation of step S103 in FIG. Figure 4 As shown, in this embodiment, step S103 may further include the steps of:
[0101] S1031, wait for the absolute encoder data to stabilize.
[0102] There are many light channel lines on the absolute encoder optical code disk, and each line is arranged in 2 lines, 4 lines, 8 lines, and 16 lines in turn. In this way, at each position of the encoder, by reading the light and dark of each line, a set of unique binary codes (Gray code) from 2 to the power of 0 to 2 to the power of n-1 is obtained, which is called an n-bit absolute encoder. Such an encoder is memorized by the photoelectric code disk. The absolute encoder determines the encoding by mechanical position. It does not need to remember, find reference points, or count all the time. When you need to know the position, you can read its position. In this way, the anti-interference characteristics of the encoder and the reliability of the data are greatly improved.
[0103] The data stability of the absolute encoder is related to the characteristics of the absolute encoder, which mainly refers to the time it takes for the absolute encoder to stabilize from power-on. Generally, the absolute encoder manufacturer provides this parameter.
[0104] The actuator is a key component for implementing active vibration control and an important part of the active control system. The actuator, also known as the exciter, is used for dynamic tests and is the output device of dynamic tests. The function of the actuator is to exert control force on the control object according to a certain control law. With the development of active vibration control technology, the requirements for actuators are getting higher and higher. In recent years, based on traditional fluid actuators, gas actuators and electrical actuators, a variety of intelligent actuators have been developed, such as piezoelectric ceramic actuators, piezoelectric film actuators, electrostrictive actuators, magnetostrictive actuators, shape memory alloy actuators, servo actuators and electrorheological fluid actuators. The emergence of these actuators provides the necessary conditions for achieving high-precision active vibration control.
[0105] The actuator drives the rocking engine nozzle to deflect as required, and the absolute encoder is installed on the actuator. In this way, the deviation can be substituted into the compensation process by reading the absolute encoder signal through the program.
[0106] S1032. Collect encoder data at a certain frequency.
[0107] In the preset acquisition period, multiple zero position data of the absolute encoder are collected. The preset acquisition period can be 10ms, 20ms, 30ms, etc., and the preset acquisition period can be set according to actual needs.
[0108] S1033. Determine whether the specified number of acquisitions has been completed. If not, continue to execute step S1032. If completed, execute step S1034.
[0109] S1034. Take the average value of the results to obtain the second zero position deviation.
[0110] Take the average value of multiple zero-position data to get the second zero-position deviation. For example, you can take 10 zero-position values and then take the average value of these 10 zero-position values. The acquisition cycle and the number of averages can be flexibly adjusted according to the characteristics of the encoder.
[0111] Step S104: Compensate the first zero position deviation and the second zero position deviation together in servo control.
[0112] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S104 in FIG. Figure 5 As shown, in this embodiment, step S104 may further include the steps of:
[0113] S1041, power on initialization.
[0114] Initialize the program when it is powered on to avoid other uncertain factors affecting the zero adjustment.
[0115] S1042. Obtaining incremental encoder feedback angle information.
[0116] The incremental encoder feedback angle information can be obtained by the program. The program runs on the stm32 chip. By configuring the stm32 timer to encoder mode, the incremental encoder signal can be read to obtain the incremental encoder feedback angle information.
[0117] S1043, when the control angle sent by the swing servo control system through the CAN bus is zero, the control angle information is not received, and a synthetic control is performed on the current position of the incremental encoder and the first zero position deviation to control the incremental encoder toward the relative zero position.
[0118] The control angle refers to the angle sent by the control system through the CAN bus. If the control angle is zero, it means that the program does not receive the control angle information, and the current position of the incremental encoder is controlled to zero.
[0119] S1044, determine whether the second zero position deviation is obtained, if yes, execute step S1045, otherwise continue to execute step S1043.
[0120] Can be used Figure 4 The process shown obtains the zero position deviation.
[0121] S1045. Compensate the second zero position deviation to the control angle.
[0122] Before the zero position deviation is synthesized into the servo control, the position control command of the control system is not received. c0 =0, the servo control moves towards the current relative zero position. After calculating the zero position deviation dZero, the deviation is added to the control. At this time, the control angle is Pc1 =P c0 +dZero, the servo controls the absolute zero position after compensation. After that, after receiving the position control command from the control system, the servo controls the required posture.
[0123] S1046, perform secondary synthesis control and control towards absolute zero position.
[0124] Absolute zero position refers to the zero position after adding zero deviation compensation.
[0125] S1047, receiving the position control instruction from the control system and performing synthetic output.
[0126] Generally, there is an input quantity (control angle) and a feedback quantity (encoder feedback angle). After calculation, an output quantity (driving the swing engine nozzle deflection) is formed.
[0127] It can be seen that the first zero deviation and the second zero deviation are both compensated into the control angle, which means that the adjustment of the zero deviation has a correction process. For example, if only the second zero deviation is used for compensation, if the control angle is 0° after the second zero deviation compensation, and the user may feel that this 0° position is not good and wants an additional correction, then by first adding 0.5° to the first zero deviation, the angle used for compensation is 0.5°, which meets the needs of users and allows the zero deviation to be set flexibly.
[0128] In this embodiment, an absolute encoder and an incremental encoder are arranged on the actuator, and the absolute encoder is used to obtain the zero position deviation value of the swing servo installed in the carrier; the incremental encoder is used to obtain the feedback angle information of the current position of the incremental encoder, and the feedback angle information is used for the servo control synthesis output; and the zero position is adjusted by receiving the control system command. The zero position adjustment is simple and easy, with small error, stable and reliable, and low cost.
[0129] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0131] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0132] Embodiment 2
[0133] Further references Figure 6 , as a response to the above Figure 2 The present application provides an embodiment of an encoder zero position adjustment device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0134] like Figure 6 As shown, the encoder zero position adjustment device 400 described in this embodiment includes: a setting module 401, an adjustment module 402, a calculation module 403 and a synthesis module 404. Among them:
[0135] The setting module 401 is used for, before performing the zero deviation configuration, the swing servo mechanism receives a command to turn on the zero deviation configuration switch from the control system through the CAN bus communication protocol, sets the zero deviation interval, and performs the zero deviation configuration;
[0136] An adjustment module 402, configured to adjust the zero deviation according to the zero deviation interval to obtain a first zero deviation;
[0137] The calculation module 403 is used for the actuator to be provided with an absolute encoder and an incremental encoder, the actuator drives the swing engine nozzle to deflect as required, reads the absolute encoder signal, calculates the zero position deviation according to the absolute encoder signal, and obtains the second zero position deviation;
[0138] The synthesis module 404 is used to compensate the first zero position deviation and the second zero position deviation together in the servo control.
[0139] In this embodiment, an absolute encoder and an incremental encoder are arranged on the actuator, and the absolute encoder is used to obtain the zero position deviation value of the swing servo installed in the carrier; the incremental encoder is used to obtain the feedback angle information of the current position of the incremental encoder, and the feedback angle information is used for the servo control synthesis output; and the zero position is adjusted by receiving the control system command. The zero position adjustment is simple and easy, with small error, stable and reliable, and low cost.
[0140] Embodiment 3
[0141] To solve the above technical problems, the present application also provides a computer device. Figure 7 , Figure 7 This is a basic structural block diagram of the computer device in this embodiment.
[0142] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 6 having components of a memory 61, a processor 62, and a network interface 63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital processor (DSP), an embedded device, etc.
[0143] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0144] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk equipped on the computer device 6, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 61 can also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions of the encoder zero position adjustment method, etc. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.
[0145] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run computer-readable instructions or process data stored in the memory 61, such as computer-readable instructions for running the encoder zero position adjustment method.
[0146] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.
[0147] In this embodiment, an absolute encoder and an incremental encoder are arranged on the actuator, and the absolute encoder is used to obtain the zero position deviation value of the swing servo installed in the carrier; the incremental encoder is used to obtain the feedback angle information of the current position of the incremental encoder, and the feedback angle information is used for the servo control synthesis output; and the zero position is adjusted by receiving the control system command. The zero position adjustment is simple and easy, with small error, stable and reliable, and low cost.
[0148] Embodiment 4
[0149] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the encoder zero position adjustment method as described above.
[0150] In this embodiment, an absolute encoder and an incremental encoder are arranged on the actuator, and the absolute encoder is used to obtain the zero position deviation value of the swing servo installed in the carrier; the incremental encoder is used to obtain the feedback angle information of the current position of the incremental encoder, and the feedback angle information is used for the servo control synthesis output; and the zero position is adjusted by receiving the control system command. The zero position adjustment is simple and easy, with small error, stable and reliable, and low cost.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0152] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for adjusting the zero position of an encoder, characterized in that: The steps include: Before performing the zero position deviation configuration, the swing servo mechanism receives a command to turn on the zero position deviation configuration switch from the control system through the CAN bus communication protocol, sets the zero position deviation interval, and performs the zero position deviation configuration; The actuator is equipped with an absolute encoder and an incremental encoder, and the actuator drives the rocking engine nozzle to deflect as required; Receive a zero-bit deviation, determine whether the zero-bit deviation falls within the zero-bit deviation interval, and if so, perform a CRC check on the zero-bit deviation to obtain a first CRC check code; Writing the zero bit deviation and the first CRC check code to a specified flash sector; Power off and restart; After initialization, the zero bit deviation and the first CRC check code of the specified flash sector are read in, and a CRC check is performed on the read zero bit deviation to obtain a second CRC check code; Compare the second CRC check code with the first CRC check code, and if they are consistent, add the zero position deviation to the initial zero position to obtain a first zero position deviation; Waiting for the absolute encoder data to be stable; Collecting multiple zero position deviations of the absolute encoder within a preset collection period; Taking an average value of the multiple zero-position deviations to obtain a second zero-position deviation; Get the incremental encoder feedback angle information; When the control angle sent by the swing servo setting control system through the CAN bus is zero, the control angle information is not received, and a synthetic control is performed on the current position of the incremental encoder and the first zero position deviation to control the incremental encoder toward the relative zero position; determining whether the second zero position deviation is obtained, and if so, compensating the second zero position deviation to the control angle; Carry out secondary synthesis control and control towards absolute zero position; Receive position control instructions from the control system and perform synthetic output.
2. The encoder zero position adjustment method according to claim 1, characterized in that: Before the zero deviation configuration is performed, the swing servo mechanism receives a command to turn on the zero deviation configuration switch from the control system through the CAN bus communication protocol, sets the zero deviation interval, and performs the zero deviation configuration step specifically including: Receive the control system zero deviation configuration switch command and set it; Execute zero deviation configuration switch command response; Receive the control system zero deviation configuration command and set it; Execute zero offset configuration command response.
3. The encoder zero position adjustment method according to claim 1, characterized in that: The step of adjusting the zero deviation according to the zero deviation interval to obtain the first zero deviation further includes: Receive the zero-position deviation, determine whether the zero-position deviation falls within the zero-position deviation interval, otherwise discard the zero-position deviation and return abnormal information.
4. The encoder zero position adjustment method according to any one of claims 1 to 3, characterized in that: The zero position deviation range refers to [-10% zero position deviation unit, +10% zero position deviation unit].
5. An encoder zero position adjustment device, characterized in that: include: A setting module is used for, before performing zero deviation configuration, the swing servo mechanism receives a command for turning on a zero deviation configuration switch from the control system through a CAN bus communication protocol, sets a zero deviation interval, and performs zero deviation configuration; The actuator is equipped with an absolute encoder and an incremental encoder, and the actuator drives the rocking engine nozzle to deflect as required; An adjustment module is used to receive a zero-position deviation, determine whether the zero-position deviation falls within the zero-position deviation interval, and if so, perform a CRC check on the zero-position deviation to obtain a first CRC check code; Writing the zero bit deviation and the first CRC check code to a specified flash sector; Power off and restart; After initialization, the zero bit deviation and the first CRC check code of the specified flash sector are read in, and a CRC check is performed on the read zero bit deviation to obtain a second CRC check code; Compare the second CRC check code with the first CRC check code, and if they are consistent, add the zero position deviation to the initial zero position to obtain a first zero position deviation; A calculation module, used for waiting for the absolute encoder data to be stable; Collecting multiple zero position deviations of the absolute encoder within a preset collection period; Taking an average value of the multiple zero-position deviations to obtain a second zero-position deviation; A synthesis module is used to obtain the feedback angle information of the incremental encoder; When the control angle sent by the swing servo setting control system through the CAN bus is zero, the control angle information is not received, and a synthetic control is performed on the current position of the incremental encoder and the first zero position deviation to control the incremental encoder toward the relative zero position; determining whether the second zero position deviation is obtained, and if so, compensating the second zero position deviation to the control angle; Carry out secondary synthesis control and control towards absolute zero position; Receive position control instructions from the control system and perform synthetic output.
6. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the encoder zero position adjustment method according to any one of claims 1 to 4 when executing the computer-readable instructions.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the encoder zero position adjustment method according to any one of claims 1 to 4 are implemented.
