BISS-C protocol decoding method, device and motor controller

By determining the number and decoding order of CLK signals in the BISS-C protocol, the problem of incomplete motor position information under different encoder models is solved, and complete acquisition of motor position information is achieved.

CN115168277BActive Publication Date: 2025-09-12GUANGDONG MIDEA WHITE HOME APPLIANCE TECH INNOVATION CENT CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210751333.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2025-09-12
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

The single-turn and multi-turn data lengths of encoders from different manufacturers and models may differ, which may result in the inability to obtain complete motor position data in the BISS-C protocol.

Method used

By obtaining the data length of the encoder parameter information, the number of clock CLK signals to be sent is determined, and the target encoder parameter information in the SLO signal is decoded according to its order and data length to obtain the complete motor position information.

Benefits of technology

The complete acquisition and decoding of the motor position information is achieved, avoiding the problem of information loss caused by data length mismatch in related technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168277B_ABST
    Figure CN115168277B_ABST
Patent Text Reader

Abstract

The present application discloses a decoding method, device, motor controller and storage medium of the BISS-C protocol, which belongs to the field of BISS-C technology. The method includes: obtaining the data length of encoder parameter information, wherein the encoder parameter information includes wait bit information, ACK, start bit information, CDS, motor position information, error bit information, alarm bit information and CRC information; determining the first number of CLK signals to be sent according to the data length of the encoder parameter information; using the first number of CLK signals as MA signals and sending the first number of CLK signals to the encoder; receiving the encoder output SLO signal sent by the encoder; decoding the target encoder parameter information according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information. By adopting the present application, the problem of incomplete motor position information carried in the SLO signal can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of BISS-C technology, and in particular to a decoding method, device and motor controller for the BISS-C protocol. Background Art

[0002] The Bidirectional Synchronous Serial-C (BISS-C) protocol offers real-time, continuous, and secure data transmission capabilities and is widely used in robotic control. BISS-C communication consists of two signals: the master (MA) signal and the slave output (SLO) signal. The MA signal is sent from the motor controller to the motor's encoder, while the SLO signal is sent from the encoder to the motor controller based on the MA signal.

[0003] Currently, the motor controller sends a fixed-length MA signal to the encoder via the Serial Peripheral Interface (SPI). After receiving the MA signal, the encoder collects data (including motor position information, such as single-turn and multi-turn values) and generates an SLO signal, which is sent to the motor controller.

[0004] The data lengths of single-turn and multi-turn values ​​vary between encoders from different manufacturers and models. The encoder generates the SLO signal based on the MA signal, collecting single-turn and multi-turn data. This can cause the encoder's single-turn and multi-turn data to be longer, while the MA signal is shorter. This can result in the final SLO signal not containing the complete single-turn and multi-turn data. Summary of the Invention

[0005] The present invention provides a BISS-C protocol decoding method, device, and motor controller. This method can solve the problem in related technologies that complete motor position information may not be obtained. The technical solution is as follows:

[0006] In a first aspect, a method for decoding a BISS-C protocol is provided, the method comprising:

[0007] Obtaining the data length of encoder parameter information, wherein the encoder parameter information includes wait bit information, ACK, start bit information, column CDS, motor position information, error bit information, alarm bit information and CRC information;

[0008] Determining a first number of clock CLK signals to be sent according to the data length;

[0009] Using the first number of CLK signals as MA signals, and sending the first number of CLK signals to the encoder;

[0010] Receiving an encoder output SLO signal sent by the encoder, wherein the SLO signal includes target encoder parameter information;

[0011] The target encoder parameter information is decoded according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

[0012] In a possible implementation, determining the first number of clock CLK signals to be sent according to the data length of the target encoder parameter information includes:

[0013] The first number of clock CLK signals to be sent is determined according to the data length of the target encoder parameter information and the second minimum number of CLK signals to be sent at a single time.

[0014] In a possible implementation, determining the first number of CLK signals to be sent according to the data length and the second minimum number of CLK signals to be sent at a single time includes:

[0015] determining a calculation result of dividing the data length by the second number;

[0016] The calculation result is rounded up and multiplied by the second number to obtain the first number of CLK signals to be sent.

[0017] In one possible implementation, decoding the target encoder parameter information according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information includes:

[0018] Determine whether the first two data bits in the SLO signal are preset values, wherein the first two data bits in the SLO signal are data start information;

[0019] If the first two data bits in the SLO signal are the first preset value, the target encoder parameter information in the SLO signal is decoded according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

[0020] In one possible implementation, the continuing to decode the target encoder parameter information in the SLO signal according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information includes:

[0021] According to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information, obtain the target start bit information, target CDS, target motor position information, target error bit information, target alarm bit information and target CRC information in the target encoder parameter information;

[0022] Calculating CRC information to be verified for the target start bit information, the target CDS, the target motor position information, the target error bit information, and the target alarm bit information;

[0023] If the sum of the CRC information to be verified and the target CRC information is a second preset value, and the target error bit information is a third preset value, the target motor position information is saved to complete decoding.

[0024] In a second aspect, a BISS-C protocol decoding device is provided, the device comprising:

[0025] An acquisition module is used to obtain the data length of encoder parameter information, wherein the encoder parameter information includes wait bit information, ACK, start bit information, CDS, motor position information, error bit information, alarm bit information and CRC information;

[0026] a determining module, configured to determine a first number of clock CLK signals to be sent according to the data length;

[0027] a sending module, configured to use the first number of CLK signals as MA signals and send the first number of CLK signals to the encoder;

[0028] A receiving module, configured to receive an SLO signal sent by the encoder, wherein the SLO signal includes target encoder parameter information;

[0029] The decoding module is used to decode the target encoder parameter information according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

[0030] In a possible implementation, the determining module is configured to:

[0031] The first number of clock CLK signals to be sent is determined according to the data length and the second minimum number of CLK signals to be sent at a single time.

[0032] In a possible implementation, the determining module is configured to:

[0033] determining a calculation result of dividing the data length by the second number;

[0034] The calculation result is rounded up and multiplied by the second number to obtain the first number of CLK signals to be sent.

[0035] In a possible implementation, the decoding module is configured to:

[0036] Determine whether the first two data bits in the SLO signal are preset values, wherein the first two data bits in the SLO signal are data start information;

[0037] If the first two data bits in the SLO signal are the first preset value, the target encoder parameter information in the SLO signal is decoded according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

[0038] In a possible implementation, the decoding module is configured to:

[0039] According to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information, obtain the target start bit information, target CDS, target motor position information, target error bit information, target alarm bit information and target CRC information in the target encoder parameter information;

[0040] Calculating CRC information to be verified for the target start bit information, the target CDS, the target single-turn value, the target motor position information, the target error bit information, and the target alarm bit information;

[0041] If the sum of the CRC information to be verified and the target CRC information is a second preset value, and the target error bit information is a third preset value, the target motor position information is saved to complete decoding.

[0042] In a third aspect, a motor controller is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the BISS-C protocol decoding method as described in the first aspect above.

[0043] In a fourth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the BISS-C protocol decoding method as described in the first aspect above.

[0044] In a fifth aspect, a computer program product is provided, wherein the computer program product includes at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the BISS-C protocol decoding method as described in the first aspect above.

[0045] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0046] In the method provided in the embodiment of the present application, before sending the CLK signal to the encoder of the motor, the motor controller first determines the number of CLK signals that need to be sent based on the data length of the pre-stored encoder parameter information, and then sends the CLK signal to the encoder. In this way, the encoder can complete the collection of the motor position information using the CLK signal (i.e., MA signal) received by the encoder, and carry the collected complete motor position information in the SLO signal. In this way, the motor controller can obtain the complete motor position information after decoding the encoder parameter information carried in the SLO signal based on the data length of the encoder parameter information carried in the SLO signal and the order of the encoder parameter information, thereby avoiding the problems in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0048] Figure 1 This is a timing diagram of a BISS-C protocol provided in an embodiment of the present application;

[0049] Figure 2 This is a schematic diagram of an implementation scenario provided by an embodiment of the present application;

[0050] Figure 3 This is a flowchart of a BISS-C protocol decoding method provided in an embodiment of the present application;

[0051] Figure 4 This is a flowchart of a BISS-C protocol decoding method provided in an embodiment of the present application;

[0052] Figure 5 This is a schematic structural diagram of a BISS-C protocol decoding device provided in an embodiment of the present application;

[0053] Figure 6 This is a structural diagram of a motor controller provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0055] First, in order to facilitate the understanding of this application, the nouns involved in the embodiments of this application are explained below.

[0056] BISS-C protocol:

[0057] See also Figure 1 , shows a BISS-C timing diagram. Figure 1 In the timing diagram shown, the signal at the top is the MA signal, which is the code sent by the motor controller to the motor. The MA signal may also be called a clock signal, a drive signal, etc. In the embodiment of the present application, the MA signal is the clock (CLK) signal of the Serial Peripheral Interface (SPI) module in the motor controller.

[0058] The signal below is the SLO signal, which is sent by the motor encoder to the motor controller. Specifically, the motor encoder obtains encoder parameter information based on the MA signal (CLK signal) sent by the motor controller, generates an SLO signal, and sends it to the motor controller. In this embodiment of the application, the Master Input Slave Output (MISO) interface of the SPI module is used to receive the SLO signal.

[0059] like Figure 1 As shown in FIG, the SLO signal sent by the motor encoder to the motor controller may include wait bit information, acknowledgement character (ACK), start bit information, control data sequence (CDS), position information, error bit information, alarm bit information, and cyclic redundancy check (CRC) information. The position information is the motor position information, including single-turn value and / or multi-turn value. Depending on the motor encoder model, the data length and content of the position information may vary.

[0060] The following combination Figure 2 , introduces the implementation scenario of the embodiment of this application. Figure 2 As shown, the implementation scenario of the embodiment of the present application may include an encoder and a motor controller of a motor, wherein the encoder may be a magnetic encoder or other types of encoders. The motor controller may determine the number of CLK signals to be sent based on the data length of the pre-stored encoder parameter information. Then, the motor encoder may send a CLK signal to the motor encoder through the SPI module, and the CLK signal is the MA signal ( Figure 2The SPI module is not shown in the figure). Accordingly, after the motor encoder receives the MA signal sent by the motor controller, it obtains the encoder parameter information according to the MA signal, and generates an SLO signal to send to the motor controller. The motor controller receives the SLO signal sent by the motor encoder through the MISO interface of the SPI module. Then, the motor controller can decode the encoder parameter information carried in the SLO signal according to the data length of the encoder parameter information carried in the SLO signal and the order of the encoder parameter information.

[0061] In the method provided in the embodiment of the present application, before sending the CLK signal to the encoder of the motor, the motor controller first determines the number of CLK signals that need to be sent based on the data length of the pre-stored encoder parameter information, and then sends the CLK signal to the encoder. In this way, the encoder can complete the collection of the motor position information using the CLK signal (i.e., MA signal) received by the encoder, and carry the collected complete motor position information in the SLO signal. In this way, the motor controller can obtain the complete motor position information after decoding the encoder parameter information carried in the SLO signal based on the data length of the encoder parameter information carried in the SLO signal and the order of the encoder parameter information, thereby avoiding the problems in the related art.

[0062] The following describes the decoding method of the BISS-C protocol provided in the embodiment of the present application in conjunction with specific implementation methods.

[0063] like Figure 3 As shown, the processing flow of the method may include the following steps:

[0064] In step 301, the data length of the encoder parameter information is obtained.

[0065] The encoder parameter information includes ACK, wait bit information, start bit information, motor position information, CDS, error bit information, CRC information, and alarm bit information. The data length of the encoder parameter information includes the data length of ACK, the data length of wait bit information, the data length of start bit information, the data length of motor position information, the data length of CDS, the data length of error bit information, the data length of CRC information, and the data length of alarm bit information.

[0066] In implementation, according to the encoder model of the motor connected to the motor controller, the technician can pre-write the data length of the encoder parameter information into the motor controller.

[0067] Before the motor controller sends the MA signal, the motor controller may first obtain the data length of the pre-stored encoder parameter information. In a possible implementation, the motor controller may obtain the data length of the pre-stored encoder parameter information each time it is powered on.

[0068] In step 302, the target number of clock CLK signals to be sent is determined according to the data length of the encoder parameter information.

[0069] The motor controller sends CLK signals through a transmit buffer. Each CLK signal is 1 bit, and a transmit buffer has 16 bits. Therefore, the minimum number of CLKs that the motor controller must send at one time is 16. The size of the transmit buffer is only an example for ease of description. In the embodiments of the present application, the size of a transmit buffer is not limited. For example, a transmit buffer can also be 32 bits, 8 bits, etc.

[0070] During implementation, the motor controller adds the data length of the ACK, the data length of the wait bit information, the data length of the start bit information, the data length of the motor position information, the data length of the CDS, the data length of the error bit information, the data length of the CRC information and the data length of the alarm bit information to obtain the total data length.

[0071] The motor controller then divides the total data length by the minimum number of CLK signals to be sent at one time. If the result of the division is a decimal, the result is rounded up. The rounded-up result is then multiplied by the minimum number of CLK signals to be sent at one time to obtain the target number of CLK signals to be sent.

[0072] Here are a few examples to illustrate this:

[0073] For example, the ACK data length is 13 bits, the wait bit information is 2 bits, the start bit information is 1 bit, the motor position information is 34 bits (including 18 bits for single-turn values ​​and 16 bits for multi-turn values), the CDS information is 1 bit, the error bit information is 1 bit, the CRC information is 6 bits, and the alarm bit information is 1 bit. Adding the data lengths of these parameters yields a total data length of: 13 + 2 + 1 + 34 + 1 + 1 + 6 + 1 = 59 bits. Then, divide 59 by 16 to get 3.6875. Because this result is a decimal, round it up to 4. Then, multiply the rounded-up result of 4 by the minimum number of CLK signals to be sent at a time, 16, to obtain the target number of CLK signals to be sent, 64.

[0074] For example, the ACK data length is 13 bits, the wait bit information is 2 bits, the start bit information is 1 bit, the motor position information is 20 bits (including 20 bits for single-turn values ​​and 0 bits for multi-turn values), the CDS data length is 1 bit, the error bit information is 1 bit, the CRC information is 6 bits, and the alarm bit information is 1 bit. Adding the data lengths of these parameters yields a total data length of: 13 + 2 + 1 + 20 + 1 + 1 + 6 + 1 = 45 bits. Then, divide 45 by 16 to obtain 2.8125. Because this result is a decimal, round it up to 3. Then, multiply the rounded-up result of 3 by the minimum number of CLK signals to be sent at a time, 16, to obtain the target number of CLK signals to be sent, 48.

[0075] In step 303, the target number of CLK signals is used as the MA signal and sent to the encoder.

[0076] In implementation, after determining the target number of CLK signals to be sent, the SPI module may be enabled to send the target number of CLK signals to the encoder of the motor through the sending buffer.

[0077] After sending the target number of CLK signals to the encoder, the motor controller can start the SPI module's receive interrupt routine, that is, make the SPI module start executing the processing of receiving the SLO signal.

[0078] In addition, the motor controller may also initialize the SPI module before executing step 303. Specifically, initializing the SPI module includes configuring the SPI module to read data at the falling edge of the CLK signal and to be idle at a high level.

[0079] In step 304, an SLO signal sent by an encoder is received.

[0080] Among them, the SLO signal includes target encoder parameter information.

[0081] In practice, after receiving the CLK signal, the encoder collects the target motor position information according to the CLK signal and generates an SLO signal, which is then sent to the motor controller.

[0082] The motor controller receives the SLO signal sent by the encoder through the MISO interface of the SPI module and saves the received SLO signal into the receive buffer.

[0083] In step 305, the target encoder parameter information is decoded according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

[0084] In implementation, after the SLO signal is saved in the receiving buffer, a decoding function is called to decode the SLO signal.

[0085] First, the decoding function determines whether the first two digits of the SLO signal are both 1, that is, whether the wait bit information is 11. If the first two digits of the SLO signal are both 1, the pre-set single-turn value data length, multi-turn value data length, and ACK data length are obtained. If the first two digits of the SLO signal are not both 1, decoding is stopped and the process proceeds to step 303.

[0086] It should be noted that the single-turn data length, multi-turn data length, and ACK data length may differ for different encoder models. Therefore, different decoding entries are required to decode the SLO signals of different encoder models. Specifically, decoding entries corresponding to different single-turn data lengths, multi-turn data lengths, and ACK data lengths are pre-configured. Accordingly, after obtaining the pre-set single-turn data length, multi-turn data length, and ACK data length, the corresponding target decoding entry is selected based on the single-turn data length, multi-turn data length, and ACK data length.

[0087] Then, by calling the target decoding entry, the SLO signal is further decoded according to the order of the parameters in the target encoder parameter information and the data length. Specifically, the target start bit information, target CDS, target motor position information, target error bit information, target alarm bit information and target CRC information are first obtained, and the target start bit information, target CDS, target motor position information, target error bit information and target alarm bit information to be verified CRC information are calculated. Then, the sum of the target CRC information and the CRC information to be verified is calculated. If the sum of the target CRC information and the CRC information to be verified is the second preset value, the CRC flag is set to 1, indicating that the SLO information is complete. If the sum of the target CRC information and the CRC information to be verified is not the second preset value, the decoding is stopped and the process returns directly to execution step 303. Among them, the second preset value can be 0x3F (hexadecimal value).

[0088] After the CRC flag is set to 1, it is determined whether the target error bit information is a third preset value. If the target error bit information is the third preset value, it indicates that the target motor position information is valid, and the target motor position information can be saved. If the target error bit information is not the third preset value, it indicates that the target motor position information is invalid, and the target motor position information can be deleted, and the process proceeds to step 303. The third preset value can be 1.

[0089] In addition, it is also possible to determine whether the target alarm bit information is a fourth preset value. If the target alarm bit is the fourth preset value, it indicates that the encoder is currently in good working condition. If the target alarm bit is not the fourth preset value, it indicates that the encoder is currently in poor working condition.

[0090] To better understand the above decoding process, the following example illustrates the above decoding process:

[0091] For example, according to Figure 1 In the timing diagram shown, the order of the target encoder parameter information is as follows: target wait bit information (2 bits), target ACK (13 bits), target start bit information (1 bit), target CDS (1 bit), target motor position information (single-turn value 18 bits + multi-turn value 16 bits = 34 bits), target error bit information (1 bit), target alarm bit information (1 bit) and target CRC information (6 bits).

[0092] First, the decoding function is called to determine whether the first two bits of the SLO signal in the receive buffer are 11. If not, decoding is stopped. If they are 11, the corresponding decoding entry is selected based on the pre-stored ACK data length, single-turn data length, and multi-turn data length.

[0093] Then, through the selected decoding entry, the data from the 16th to the 53rd bit of the SLO signal in the receive buffer is obtained, and the CRC information to be verified of these 37 bits of data is calculated. And the 6-bit data from the 54th to the 59th bit (target CRC information) is obtained. Calculate whether the sum of the CRC information to be verified and the target CRC information is 0x3F. If the sum of the CRC information to be verified and the target CRC information is 0x3F, set the CRC flag to 1 and obtain the data of the 52nd bit (target error bit information). If the sum of the CRC information to be verified and the target CRC information is not 0x3F, stop decoding.

[0094] If the data of bit 52 is 1, the data of bits 18 to 51 (target motor position information) are saved and decoding is completed. If the data of bit 52 is not 1, decoding is stopped and the data of bits 18 to 51 are cleared.

[0095] In addition, the data of the 53rd bit (target alarm bit information) can also be obtained. If the target alarm bit is 1, it means that the encoder is currently working in a good state. If the target alarm bit is not 1, it means that the encoder is currently working in a poor state.

[0096] In the method provided in the embodiment of the present application, before sending the CLK signal to the encoder of the motor, the motor controller first determines the number of CLK signals that need to be sent based on the data length of the pre-stored encoder parameter information, and then sends the CLK signal to the encoder. In this way, the encoder can complete the collection of the motor position information using the CLK signal (i.e., MA signal) received by the encoder, and carry the collected complete motor position information in the SLO signal. In this way, the motor controller can obtain the complete motor position information after decoding the encoder parameter information carried in the SLO signal based on the data length of the encoder parameter information carried in the SLO signal and the order of the encoder parameter information, thereby avoiding the problems in the related art.

[0097] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.

[0098] The present application also provides a method for decoding the BISS-C protocol. Figure 4 , the method may include the following processing steps:

[0099] Step 401: Obtain the data length of encoder parameter information.

[0100] Step 402: Calculate the target number of CLK signals to be sent according to the data length of the encoder parameter information.

[0101] Step 403: Send the target number of CLK signals to the encoder through the SPI module and start receiving interrupts.

[0102] Step 404: Receive the SLO signal sent by the encoder through the MISO interface of the SPI module.

[0103] Step 405: Determine whether the first two bits of the SLO signal are 11 (two binary bits).

[0104] Step 406: If the first two digits of the SLO signal are not 11, stop decoding and go to step 403.

[0105] Step 407: If the first two digits of the SLO signal are 11, a decoding entry is selected according to the preset single-turn value data length, multi-turn value data length, and ACK data length.

[0106] Step 408: Obtain the target start bit information, target CDS, target motor position information, target error bit information, target alarm bit information, and target CRC information from the SLO signal through the selected decoding entry, and calculate the CRC information to be verified for the target start bit information, target CDS, target motor position information, target error bit information, and target alarm bit information. The sum of the target CRC information and the CRC information to be verified is calculated.

[0107] Step 409: Determine whether the sum of the target CRC information and the CRC information to be verified is 0x3F.

[0108] Step 410 : If the sum of the target CRC information and the CRC information to be verified is not 0x3F, then the decoding is stopped and the process goes to step 403 .

[0109] Step 411: If the sum of the target CRC information and the CRC information to be verified is 0x3F, determine whether the target error bit information in the SLO signal is 1.

[0110] Step 412: If the target error bit information is not 1, stop decoding and go to step 403.

[0111] Step 413: If the target error bit information is 1, the acquired target motor position information is saved to complete decoding.

[0112] It should be noted that the specific processing of the above-mentioned step 401 is the same as the specific processing of step 301, the specific processing of step 402 is the same as the specific processing of step 302, the specific processing of step 403 is the same as the specific processing of step 303, the specific processing of step 404 is the same as the specific processing of step 304, and the specific processing of steps 405-413 is the same as the specific processing of step 305, which will not be repeated here.

[0113] In the method provided in the embodiment of the present application, before sending the CLK signal to the encoder of the motor, the motor controller first determines the number of CLK signals that need to be sent based on the data length of the pre-stored encoder parameter information, and then sends the CLK signal to the encoder. In this way, the encoder can complete the collection of the motor position information using the CLK signal (i.e., MA signal) received by the encoder, and carry the collected complete motor position information in the SLO signal. In this way, the motor controller can obtain the complete motor position information after decoding the encoder parameter information carried in the SLO signal based on the data length of the encoder parameter information carried in the SLO signal and the order of the encoder parameter information, thereby avoiding the problems in the related art.

[0114] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.

[0115] Based on the same technical concept, the embodiment of the present application also provides a BISS-C protocol decoding device, such as Figure 5 As shown, the apparatus 500 includes an acquisition module 510 , a determination module 520 , a sending module 530 , a receiving module 540 and a decoding module 550 .

[0116] The acquisition module 510 is used to obtain the data length of the encoder parameter information, wherein the encoder parameter information includes wait bit information, ACK, start bit information, CDS, motor position information, error bit information, alarm bit information and CRC information; specifically, the acquisition module 510 can implement Figure 3 The processing of step 301 and its implicit steps, and Figure 4 Specific processing of step 401 and its implicit steps.

[0117] The determination module 520 is configured to determine the first number of clock CLK signals to be sent according to the data length of the encoder parameter information; specifically, the determination module 520 may implement Figure 3 The processing of step 302 and its implicit steps, and Figure 4 Specific processing of step 402 and its implicit steps.

[0118] The sending module 530 is configured to use the first number of CLK signals as MA signals and send the first number of CLK signals to the encoder; specifically, the sending module 530 may implement Figure 3 The processing of step 303 and its implicit steps, and Figure 4 Specific processing of step 403 and its implicit steps.

[0119] The receiving module 540 is configured to receive the encoder output SLO signal sent by the encoder, wherein the SLO signal includes target encoder parameter information; specifically, the receiving module 540 can implement Figure 3 The processing of step 304 and its implicit steps, and Figure 4 Specific processing of step 404 and its implicit steps.

[0120] The decoding module 550 is used to decode the target encoder parameter information according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information. Specifically, the decoding module 550 can implement Figure 3 The processing of step 305 and its implicit steps, and Figure 4 Specific processing of steps 405, 406, 407, 408, 409, 410, 411, 412 and their implicit steps.

[0121] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0122] In an embodiment of the present application, before sending a CLK signal to the encoder of the motor, the motor controller first determines the number of CLK signals that need to be sent based on the data length of the pre-stored encoder parameter information, and then sends the CLK signal to the encoder. In this way, the CLK signal (i.e., MA signal) received by the encoder can complete the collection of the motor position information and carry the collected complete motor position information in the SLO signal. In this way, the motor controller can obtain the complete motor position information after decoding the encoder parameter information carried in the SLO signal based on the data length of the encoder parameter information carried in the SLO signal and the order of the encoder parameter information, thereby avoiding the problems in the related art.

[0123] It should be noted that the above-described embodiment provides a BISS-C protocol decoding device, and only illustrates the division of the aforementioned functional modules when performing BISS-C protocol decoding. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. In addition, the BISS-C protocol decoding device and the BISS-C protocol decoding method embodiment provided in the above embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0124] In an exemplary embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement the BISS-C protocol decoding method described in the above embodiment. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0125] In an exemplary embodiment, a computer program product is also provided. The computer program product includes at least one instruction, which is loaded and executed by a processor to implement the BISS-C protocol decoding method in the above embodiment. For example, the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0126] Figure 6This is a structural diagram of a motor controller provided in an embodiment of the present application. The motor controller 600 may have relatively large differences due to different configurations or performances, and may include one or more processors 601 and one or more memories 602, wherein the memory 602 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 601 to implement the above-mentioned BISS-C protocol decoding method.

[0127] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals (including but not limited to signals transmitted between user terminals and other devices, etc.) involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0128] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0129] In the embodiments of this application, the terms "first," "second," and "third" are used for descriptive purposes only and should not be understood to indicate or imply relative importance. The term "at least one" refers to one or more, and the term "plurality" refers to two or more, unless otherwise expressly limited.

[0130] In the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0131] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for decoding a bidirectional synchronous serial interface BISS-C protocol, characterized in that: The method comprises: Obtaining the data length of encoder parameter information, wherein the encoder parameter information includes wait bit information, confirmation character ACK, start bit information, control data sequence CDS, motor position information, error bit information, alarm bit information and cyclic redundancy check CRC information; Determining a first number of clock CLK signals to be sent according to the data length; Using the first number of CLK signals as master station MA signals, and sending the first number of CLK signals to the encoder; Receiving an encoder output SLO signal sent by the encoder, wherein the SLO signal includes target encoder parameter information; Determine whether the first two data bits in the SLO signal are preset values, wherein the first two data bits in the SLO signal are data start information; If the first two data bits in the SLO signal are the first preset value, the target encoder parameter information in the SLO signal is decoded according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

2. The method according to claim 1, characterized in that The determining, according to the data length, a first number of CLK signals to be sent, includes: The first number of CLK signals to be sent is determined according to the data length and the second minimum number of CLK signals to be sent at a single time.

3. The method according to claim 2, characterized in that The determining, based on the data length and the second minimum number of CLK signals to be sent at a single time, the first number of CLK signals to be sent includes: determining a calculation result of dividing the data length by the second number; The calculation result is rounded up and multiplied by the second number to obtain the first number of CLK signals to be sent.

4. The method according to any one of claims 1 to 3, characterized in that The continuing to decode the target encoder parameter information in the SLO signal according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information includes: According to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information, obtain the target start bit information, target CDS, target motor position information, target error bit information, target alarm bit information and target CRC information in the target encoder parameter information; Calculating CRC information to be verified for the target start bit information, the target CDS, the target motor position information, the target error bit information, and the target alarm bit information; If the sum of the CRC information to be verified and the target CRC information is a second preset value, and the target error bit information is a third preset value, the target motor position information is saved to complete decoding.

5. A decoding device for the BISS-C protocol, characterized in that: The device comprises: An acquisition module is used to obtain the data length of encoder parameter information, wherein the encoder parameter information includes wait bit information, ACK, start bit information, CDS, motor position information, error bit information, alarm bit information and CRC information; a determining module, configured to determine a first number of CLK signals to be sent according to a data length of the encoder parameter information; a sending module, configured to use the first number of CLK signals as MA signals and send the first number of CLK signals to the encoder; A receiving module, configured to receive an SLO signal sent by the encoder, wherein the SLO signal includes target encoder parameter information; A decoding module is used to determine whether the first two data bits in the SLO signal are preset values, wherein the first two data bits in the SLO signal are data start information; if the first two data bits in the SLO signal are the first preset value, then continue to decode the target encoder parameter information in the SLO signal according to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information.

6. The device according to claim 5, characterized in that The determining module is configured to: The first number of clock CLK signals to be sent is determined according to the data length and the second minimum number of CLK signals to be sent at a single time.

7. The device according to claim 6, characterized in that The determining module is configured to: determining a calculation result of dividing the data length by the second number; The calculation result is rounded up and multiplied by the second number to obtain the first number of CLK signals to be sent.

8. The device according to any one of claims 5 to 7, characterized in that The decoding module is used to: According to the order of the target encoder parameter information in the SLO signal and the data length of the target encoder parameter information, obtain the target start bit information, target CDS, target motor position information, target error bit information, target alarm bit information and target CRC information in the target encoder parameter information; Calculating CRC information to be verified for the target start bit information, the target CDS, the target motor position information, the target error bit information, and the target alarm bit information; If the sum of the CRC information to be verified and the target CRC information is a second preset value, and the target error bit information is a third preset value, the target motor position information is saved to complete decoding.

9. A motor controller, characterized in that: The motor controller includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • BISS-C protocol sensor data analysis and extraction method based on DSP

    CN112947163A

  • Decoding method and device based on BISS-C protocol and terminal equipment

    CN114020660A