Adaptive recognition and communication method and system of modular magnetic attraction interface
Patent Information
- Application Number
- CN202611050512.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-16
AI Technical Summary
[0008]本发明的目的是提供一种模块化磁吸接口的自适应识别与通信方法及系统,以解决现有技术中磁吸模块接入后无法自动识别、通信协议不统一、引脚功能无法动态分配、物理防呆体验差、Pogo Pin接触不可靠、供电模式单一、热插拔缺乏保护、多代模块不兼容的技术问题
(1)磁极自动对准实现便捷用户体验:通过磁极异形排列,用户无需目测对准,模块靠近末端即自动旋转至唯一正确角度吸附,同时保留了Pogo Pin的高速数据传输能力。磁极签名可编码多种不同模式,为模块生态提供了可授权的防伪机制。
Smart Images

Figure CN122914231A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of modular interfaces for intelligent robots, and in particular to an adaptive recognition and communication method and system for a modular magnetic interface. Background Technology
[0002] With the adoption of modular design principles in the consumer robot field, more and more desktop robots are adopting magnetic quick-change interfaces, allowing users to replace end effector modules without tools. However, existing technologies have the following shortcomings: 1) Lack of interface identification mechanism, preventing true "plug and play": Existing magnetic interface designs only address physical connection issues (such as Pogo Pin contact and magnetic adsorption), but lack an defined automatic identification process after module access. When a user attaches a new module to the end effector of the robotic arm, the main controller cannot automatically determine the module's type, model, capability parameters, and driver version, requiring the user to manually select the module type in the app or wait for a firmware upgrade. In particular, existing identification schemes typically require the module's main control chip to power on before responding to identification requests, failing to complete pre-identification before power-on, resulting in timing defects in the identification process.
[0003] 2) Physical error-proofing structures have user experience defects and struggle to support high-speed data transmission: Existing magnetic interfaces use physical structures such as positioning pins or irregularly shaped interfaces for error-proofing alignment, requiring users to visually determine the alignment direction before attachment, making the operation less intuitive. While wireless magnetic solutions in consumer electronics can achieve automatic alignment, they are essentially wireless charging standards and do not support high-speed data transmission (such as USB 2.0 480Mbps and above). Furthermore, their larger size makes them difficult to fit into the installation space of small robot end effector joints.
[0004] 3) Pogo Pin Contact Reliability Lacks Long-Term Guarantee: Pogo Pins rely on the physical contact between the spring-loaded pins and the pads. Over time, contact oxidation and dust accumulation can increase contact resistance or even cause open circuits. Current technology lacks real-time detection of pin contact quality and a self-cleaning mechanism during operation, which may lead to module identification failures or data transmission errors.
[0005] 4) The power supply mode is singular and cannot simultaneously meet the power supply needs of modules and the charging needs of devices: Existing magnetic interfaces typically provide only a fixed power supply voltage (such as 5V), and cannot dynamically adjust the power supply mode according to the module type. When connecting modules that require fast charging, such as mobile phone clamps, a fixed 5V power supply cannot meet their charging needs; while continuously powering ordinary sensor modules with a fast-charging voltage may damage the devices. Current technology lacks a mechanism for identifying, negotiating, and dynamically switching between different power supply modes.
[0006] Furthermore, due to the diversity of module functions (such as visual sensing, grasping control, mobile phone interaction, etc.), different modules have vastly different requirements for communication bandwidth and pin functions. The number of physical pins of the magnetic interface is limited, and existing technologies also lack a unified mechanism for dynamic allocation of pin functions and negotiation of communication parameters.
[0007] Therefore, there is an urgent need for a modular magnetic interface communication protocol and adaptive identification method to solve the above problems. Summary of the Invention
[0008] The purpose of this invention is to provide an adaptive identification and communication method and system for modular magnetic interfaces, in order to solve the technical problems in the prior art such as the inability to automatically identify magnetic modules after they are connected, inconsistent communication protocols, inability to dynamically allocate pin functions, poor physical foolproof experience, unreliable Pogo Pin contact, single power supply mode, lack of protection for hot-swapping, and incompatibility between multiple generations of modules.
[0009] To achieve the above objectives, this invention provides an adaptive identification and communication method for a modular magnetic interface, applicable to a device including a main controller and at least one replaceable functional module. The main controller and the functional module are detachably electrically connected via a magnetic interface, which includes multiple pins. The method includes the following steps: 1) Physical access detection steps: Detect whether the functional module has been attached to the main controller side; 2) Identification steps: When the main control chip of the functional module is not powered, the identity information of the functional module is read through the preset identification channel in the magnetic interface; 3) Negotiation and remapping steps: Based on the identity information, negotiate the pin function mapping scheme, communication parameters and power supply mode, select one mode from a variety of preset pin function combination modes, and send the selection result to the function module for confirmation. After confirmation, configure at least one remapping pin in the magnetic interface to the communication function corresponding to the mode, and configure the power supply pin output to the negotiated power supply mode. 4) Driver loading steps: Load the corresponding driver based on the identity information; 5) Running communication steps: Through the pins configured after the negotiation and remapping steps, data exchange is carried out between the main controller and the functional modules according to the negotiated communication parameters.
[0010] Preferably, an automatic magnetic pole alignment step is included before the physical access detection step, specifically: Multiple magnets are set on the main controller side and the functional module side respectively. The multiple magnets are arranged according to a preset N / S pole orientation sequence. The magnetic pole orientation sequence on the functional module side is a mirror image of the magnetic pole orientation sequence on the main controller side. When the functional module is close to the main controller, all magnet pairs are N-S opposite attraction at only one rotation angle, and at other rotation angles there is at least one N-N or SS like repulsion magnet pair, which generates a repulsive torque to drive the functional module to automatically rotate to the only correct angle. The N / S pole orientation sequence constitutes a magnetic pole signature, and different functional modules are configured with different magnetic pole signatures. The magnetic pole signature is used to perform preliminary identity verification of the functional modules at the physical layer. The identity information read in the identification step contains the magnetic pole signature code field of the functional module. The main controller compares and verifies the read magnetic pole signature code with the physically detected magnetic pole arrangement.
[0011] Preferably, the magnetic interface includes: The power pin is used to supply power to the functional module and supports dual-mode output of standard power supply mode and fast charging power supply mode; The identification pin is specifically used for reading identity information during the identification process. Multiple remappable pins are configured for different communication functions during the negotiation and remapping steps; The identification pin is physically separated from the remapped pin, and the identification pin starts working before the remapped pin is configured.
[0012] Preferably, the identification steps specifically include: The functional module is equipped with a 1-Wire protocol storage device, which stores identity information. When the main control chip of the functional module is not powered, the 1-Wire protocol storage device provides parasitic power through the signal on the identification pin. The parasitic power supply operating current of the 1-Wire protocol storage device does not exceed the maximum current that the data line can provide. When the power consumption demand of the module exceeds the parasitic power supply capacity, the main controller first outputs pre-charge auxiliary power through the power pin after detecting a valid connection, which is used for temporary power supply of the identification circuit of the module. After the identification is completed and the final power supply mode is negotiated and determined, it switches to the target power supply mode. The main controller initiates 1-Wire communication by identifying pins and reads the identity information stored in the 1-Wire protocol storage device when the main control chip of the functional module is not powered. The identity information includes at least: module type code, module model code, hardware version number, firmware version number, protocol version field, pin function mapping bitmask, bandwidth requirement level, power requirement field, charging management field, and checksum field. After the reading is completed, the main controller calculates the checksum and compares it with the checksum field. If the checksum passes, the main controller outputs full power to the functional module through the power supply pin, so that the main control chip of the functional module can be powered on and started.
[0013] Preferably, the physical access detection step and the identification step further include a contact quality detection and self-cleaning step, specifically: The main controller applies a test current to the power supply pin of the magnetic interface, detects the voltage drop of the power supply pin, and calculates the contact resistance; If the contact resistance exceeds the preset threshold, the main controller outputs a positive current pulse and a reverse current pulse to at least one pin in the magnetic interface in sequence. After each current pulse, a cooling time is waited to remove the oxide layer and dust from the contact surface by utilizing the thermal effect and electromagnetic force effect of the current. After the self-cleaning is completed, the contact resistance is re-tested. If the contact resistance still exceeds the preset threshold after one round of positive and negative pulses, the process is repeated up to one more round. If the contact resistance still exceeds the preset threshold after two rounds of self-cleaning, a poor contact is determined and a prompt is output.
[0014] Preferably, the negotiation and remapping steps specifically include: The main controller negotiates the protocol version to be used for this communication with the functional modules based on the protocol version field in the identity information; The main controller selects a mode that meets the bandwidth requirement level and is supported by the functional module from a variety of preset pin function combination modes based on the pin function mapping bitmask and bandwidth requirement level in the identity information; the variety of preset pin function combination modes include at least two of the following: full GPIO mode, UART+GPIO mode, I2C+GPIO mode, UART+SPI mode, USB mode, I2C+SPI mode, and UART+PWM mode. The main controller negotiates communication parameters with the functional modules according to the selected pin function combination mode. The communication parameters include at least one of the following: baud rate, clock frequency, data bits, parity bit, stop bit, clock polarity / phase, data bit sequence, and USB device type. The main controller sends the selection result to the functional module in the form of a negotiation command frame. After receiving the negotiation confirmation frame returned by the functional module, it switches the remapped pin to the function corresponding to the selected mode and performs data interaction according to the negotiated communication parameters.
[0015] The preferred, negotiated power supply mode is as follows: The main controller identifies the power supply mode required by the functional module based on the power supply requirement field in the identity information. The power supply modes include standard power supply mode and fast charging power supply mode. If a functional module requires a fast charging power supply mode, the main controller will conduct a charging protocol handshake with the functional module through the data channel to negotiate and determine the fast charging protocol type and charging parameters. The fast charging protocol type is described using a higher-level concept, including any charging protocol that supports dynamic voltage adjustment. After negotiation, the main controller switches the power pin output from the default standard power supply mode to the negotiated fast charging power supply mode, and supplies power to the functional module according to the negotiated voltage and current; if the functional module only requires the standard power supply mode, the main controller maintains the power pin output in the standard power supply mode.
[0016] Preferably, the runtime communication steps include: The main controller and functional modules exchange heartbeat frames according to a preset cycle; If no heartbeat frame is received from the other party for a preset number of consecutive times, the communication is deemed to have timed out. After determining that the communication has timed out, the main controller attempts to re-execute the negotiation and remapping steps. If the renegotiation fails, the functional module is determined to be abnormally offline. The functional module periodically reports the sampled contact resistance values of each pin to the main controller through the data channel during operation; if the contact resistance of any pin exceeds the preset threshold, the main controller triggers a self-cleaning operation. When the functional module is in fast charging power supply mode, the functional module periodically reports charging status information to the main controller. The charging status information includes at least one of the following: current battery level, charging current, and interface temperature. If the interface temperature exceeds the preset temperature threshold or the charging current fluctuates abnormally beyond the preset range, the main controller will switch the power pin output from fast charging power supply mode back to standard power supply mode or cut off the power supply output. The reporting frequency of charging status information is higher than the heartbeat frequency of normal operating status data.
[0017] Preferably, it also includes a hot pull-out detection and protection step: The main controller detects the separation of functional modules by at least one of the following methods: identifying pin level changes, supply current changes, and heartbeat timeouts; Upon detection of separation, the main controller performs at least one of the following protective actions within a preset time: stops sending commands to the functional modules, switches the robotic arm to the safe deceleration and stop mode, restores the remapped pins to their default state, and uninstalls the driver program; wherein, the safe deceleration and stop mode is an S-curve deceleration to a standstill; When the functional module is in fast charging power supply mode, the main controller will first switch the power pin output from fast charging power supply mode back to standard power supply mode after detecting separation, and then execute subsequent protection actions.
[0018] Preferably, the driver loading step includes: Based on the module type code and module model code in the identity information, the main controller performs the following matching in the local driver database in sequence: exact matching, model matching, and general type matching; If a match is found, the corresponding driver is loaded. If a match cannot be found, load the generic driver or the original GPIO driver; After the driver is loaded, the main controller compares the firmware version number in the identity information with the latest firmware version of that model in the driver database; if the firmware version of the functional module is lower than the latest version, the main controller transmits the firmware upgrade data to the functional module in packets through the data channel, with each packet carrying a check code; After the upgrade is complete, the functional module will automatically restart, and the main controller will re-execute the identification steps; if the upgrade fails, the functional module will revert to the original firmware version.
[0019] The present invention also provides a modular magnetic interface system, comprising: The main controller side interface is located on the main body of the device and includes a first set of power pins, a first set of identification pins and a first set of remappable pins, as well as a first set of magnets arranged in a first preset N / S pole orientation sequence. At least one functional module side interface is provided on the replaceable functional module, including a second set of power pins, a second set of identification pins and a second set of remapped pins corresponding to the first set of power pins, the first set of identification pins and the first set of remapped pins respectively, and a second set of magnets arranged in a second preset N / S pole orientation sequence that is mirror complementary to the first preset N / S pole orientation sequence. The functional module side interface is also equipped with a storage device. When the main control chip of the functional module is not powered, the storage device is parasiticly powered by the signal on the second set of identification pins. The storage device stores the identity information of the functional module. The main controller side interface also includes a control unit, which is configured to execute the adaptive identification and communication method of the above-mentioned modular magnetic interface.
[0020] Therefore, the adaptive identification and communication method and system of the modular magnetic interface of the present invention has the following beneficial effects: (1) Automatic magnetic pole alignment enables a convenient user experience: Through the irregular arrangement of magnetic poles, users do not need to visually align the module. The module automatically rotates to the only correct angle and attaches when it is close to the end, while retaining the high-speed data transmission capability of the Pogo Pin. The magnetic pole signature can encode multiple different modes, providing an authoritative anti-counterfeiting mechanism for the module ecosystem.
[0021] (2) Truly achieve “ready to use”: Through a dedicated identification channel, structured identity information and zero-power standby design at the module end, the module can complete identity recognition even when the main control chip of the module is not powered on after it is connected, and the user does not need to perform any manual operation.
[0022] (3) Self-guaranteed contact reliability: The self-cleaning pulse mechanism solves the problem of poor contact caused by oxidation and dust after long-term use of Pogo Pin. Combined with continuous monitoring during operation, the contact reliability is improved from "available at the factory" to "available throughout the entire life cycle", eliminating the need for users to manually clean the interface.
[0023] (4) Unified protocol stack eliminates module barriers: Layered communication protocol enables modules of different types and from different manufacturers to interconnect on the same magnetic interface, breaking the island situation where each module has its own custom communication method.
[0024] (5) Dynamic pin remapping maximizes the use of limited resources: Remapping pins support multiple preset pin function combination modes and automatically select the optimal mapping according to module requirements, so that the same physical interface can adapt to all scenarios from low bandwidth sensors to high bandwidth cameras.
[0025] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0026] Figure 1 This is a schematic diagram of the pin definition and functional partitioning of the magnetic interface in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the magnetic pole irregular arrangement for foolproof positioning in Embodiment 1 of the present invention, wherein (a) is the magnetic pole arrangement of the main control end, (b) is the stimulation arrangement of the module end, and (c) is the only correct angle: NS full pairing; Figure 3 This is an overall flowchart of adaptive identification and communication negotiation after module access in Embodiment 2 of the present invention; Figure 4 This is a timing diagram for 1-Wire identification in Embodiment 3 of the present invention; Figure 5 This is a schematic diagram of the negotiation command frame and confirmation frame format in Embodiment 4 of the present invention; Figure 6 This is a flowchart of the drive matching process in Embodiment 5 of the present invention; Figure 7 This is a timing diagram of the self-cleaning pulse in Embodiment 2 of the present invention; Figure 8 This is a timing diagram of hot pull-out detection and safety protection in Embodiment 7 of the present invention; Figure 9 This is a flowchart of the firmware online upgrade process in Embodiment 5 of the present invention; Figure 10 This is a flowchart of the adaptive power supply and charging protocol handshake process in Embodiment 8 of the present invention. Detailed Implementation
[0027] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0029] Example 1: Magnetic Interface Pin Definition and Magnetic Pole Layout Figure 1 As shown, the magnetic interface in this embodiment defines a total of 6 Pogo Pins, divided into three functional areas: Power supply area: Pin P1 is the VCC power supply pin, which supports dual-mode output of standard power supply mode (+5V) and fast charging power supply mode (+9V or +12V). The rated current carrying capacity of a single pin is not less than 3A; Pin P2 is the GND ground pin, which also serves as the 1-Wire communication return path.
[0030] Identification area: Pin P3 is the IDENT identification pin, dedicated to 1-Wire communication and cannot be remapped.
[0031] Data Area: Pins P4 to P6 are remapped data pins, with the default function being GPIO. They can be remapped to different communication functions after negotiation. Specifically, P4 can be configured as UART_TX or I2C_SDA, P5 can be configured as UART_RX or I2C_SCL, and P6 can be configured as PWM_OUT or ADC_IN.
[0032] It should be noted that the definition of the above 6 pins is only one specific embodiment of the present invention. The magnetic interface described in the present invention is not limited to the specific number of 6 pins; the number of power pins, identification pins and remappable pins can be adjusted according to actual engineering needs, and all of them fall within the protection scope of the present invention.
[0033] The P3 (IDENT) pin is connected to VCC via a pull-up resistor and remains high when no module is connected. When a module is connected, the 1-Wire slave device inside the module pulls P3 low, generating a falling edge that triggers an interrupt in the master controller. When P2 (GND) is used as the 1-Wire communication return path, it should be connected to the ground of the 1-Wire read circuit on the master controller side at a single point. In the PCB layout, the 1-Wire signal lines and power lines should be kept sufficiently spaced to reduce power supply noise interference to the identification communication.
[0034] like Figure 2As shown, six neodymium magnets (N52 level) are arranged around the Pogo Pin array. The magnetic pole arrangement (top view, with the 12 o'clock position as the reference) at the master control end (the end of the robotic arm) is: N pole at position 1, S pole at position 3, S pole at position 5, N pole at position 7, N pole at position 9, and S pole at position 11. The magnetic pole arrangement at the module end is a mirror image of the master control end: S pole at position 1, N pole at position 3, N pole at position 5, S pole at position 7, S pole at position 9, and N pole at position 11. The N / S pole sequence of the six magnets constitutes a magnetic pole signature. The six magnets have a total of 2... 6 =64 possible permutations. After removing all N, all S, and simple symmetric patterns, there are 42 valid signatures. One of them is the standard signature (as mentioned above), and the rest are authorized signatures. Third parties need to obtain authorization for the corresponding magnetic pole signature to develop compatible modules.
[0035] The automatic alignment principle is as follows: When the user brings the module close to the end of the robotic arm, due to the irregular arrangement of the magnetic poles, all six magnets are N-S opposite poles attracting each other at only one rotation angle, generating the maximum resultant force. At other rotation angles, at least one pair of magnets are N-N or SS like poles repelling each other, generating a repulsive torque that drives the module to automatically rotate to the correct angle. (6 N52 neodymium magnets) When paired with NS (6mm×2mm) beads, the adsorption force of a single bead is about 120g, and the total adsorption force of 6 beads is about 720g, which is sufficient to stably fix the module.
[0036] Example 2: Physical Access Detection and Contact Quality Self-Cleaning like Figure 3 As shown, the physical access detection and contact quality self-cleaning process in this embodiment is as follows: (a) Automatic alignment of magnetic poles: When the user brings the module close to the end of the robotic arm, the repulsive torque of the irregularly arranged magnetic poles drives the module to start rotating automatically when it is 3-5mm away from the end face. The deviation between the rotation angle and the correct angle converges to 0° within 200ms, the module is in place, and all Pogo Pins simultaneously make contact and conduct.
[0037] (ii) Electrical connection testing: The robotic arm's main controller continuously monitors the level of the IDENT pin (P3). When no module is connected, P3 is kept high through a pull-up resistor; when a module is connected, the 1-Wire slave device inside the module pulls P3 low, generating a falling edge. The main controller's GPIO interrupt captures this falling edge and triggers the connection detection process.
[0038] Meanwhile, the main controller detects changes in the supply current through a current sensor on the VCC pin as an auxiliary judgment condition to prevent false triggering due to pin oxidation or foreign objects. The access detection judgment condition is: P3 falling edge interrupt trigger, and VCC supply current greater than a preset threshold (e.g., 10mA). If both conditions are met simultaneously within a 100ms time window, it is judged as a valid access.
[0039] (III) Contact resistance testing: The main controller applies a known test current (e.g., 10mA) to the VCC pin, reads the voltage drop across the VCC pin using the ADC, and calculates the contact resistance. .like If the contact quality exceeds a preset threshold (e.g., 100mΩ), the contact quality is deemed unqualified, and the self-cleaning process begins.
[0040] (iv) Self-cleaning pulse: like Figure 7 As shown, after determining that the contact quality is unqualified, the main controller executes a self-cleaning pulse sequence on all Pogo Pins: A positive current pulse (100mA, lasting 10ms) is output sequentially to each remappable pin (P4~P6) to remove the oxide layer and dust from the contact surface using the thermal and electromagnetic effects of the current. After the pulse ends, wait 50ms for cooling before retesting the contact resistance. If it still fails, execute another reverse current pulse (-100mA, lasting 10ms) to further clean using reverse current; The self-cleaning process will run for a maximum of 2 rounds (4 pulses). If it still fails, the App will be notified of the error message "Module contact failure, please re-adhere".
[0041] The contact quality of the P3 (IDENT) pin is indirectly judged by the signal integrity of 1-Wire communication: if no acknowledgment pulse is received after the 1-Wire reset pulse, or if the width of the acknowledgment pulse is not within the specified range (60-240μs), the P3 contact is judged to be abnormal, and an error is directly reported without performing self-cleaning (large current pulses should not be applied to the 1-Wire pin to avoid damaging the slave device).
[0042] Example 3: Low-power handshake recognition Once the contact quality test is passed, the main controller initiates 1-Wire communication via the P3 (IDENT) pin to read the identity information stored inside the module.
[0043] like Figure 4 As shown, the low-power handshake identification process in this embodiment is as follows: When not connected to the robotic arm, the module is in a zero-power standby state, with no power supplied to the MCU. Only the 1-Wire EEPROM is passively powered via the P3 pin (parasitic power supply mode of the 1-Wire protocol, drawing energy from the data line). When the module is attached to the robotic arm, the 1-Wire signal on P3 provides sufficient parasitic power to the EEPROM, allowing identity reading to be completed without requiring the module's MCU to be started. The parasitic power supply operating current of the 1-Wire protocol storage device does not exceed the maximum current that the data line can provide (typically about 5μA to 1mA). For module-side identification circuits that require higher current, the main controller first outputs pre-charge auxiliary power (e.g., 5V / 50mA) through the VCC pin after detecting a valid connection, for temporary power supply to the module-side identification circuit. After identification is completed and the final power supply mode is negotiated, it switches to the target power supply mode. After identity reading and pin remapping negotiation are completed, the main controller supplies full power to the module through the VCC pin, and the module's MCU officially starts.
[0044] Module identification information is stored in the module's built-in DS28E07 or similar 1-Wire EEPROM, and includes the following fields: ROM_ID (8 bytes, unique serial number for the 1-Wire device), MODULE_TYPE (2 bytes, module type code), MODULE_MODEL (2 bytes, module model code), HW_VERSION (2 bytes, hardware version number), FW_VERSION (2 bytes, firmware version number), PROTOCOL_VERSION (1 byte, highest supported protocol version number), PIN_MAP_MASK (2 bytes, pin function mapping bitmask), and BANDWIDTH_REQ (1 byte, bandwidth requirement). The module's power requirements are as follows: Level, POWER_MAX (2 bytes, maximum power consumption), POWER_MODE_REQ (1 byte, power requirement field, indicating the required power mode: 0x00 = standard 5V, 0x01 = fast charging 9V, 0x02 = fast charging 12V, etc.), CHARGE_CTRL (1 byte, charging management field, indicating whether the module supports charging management and the supported management functions), MAG_POLE_SIG (1 byte, magnetic pole signature code), CAPABILITY_DESC (16 bytes, capability description bitmap), and CHECKSUM (2 bytes, CRC-16 checksum). See Table 1 for details.
[0045] Table 1: Module Identity Information Table
[0046] The total number of bytes for all the above fields is: 8+2+2+2+2+1+2+1+2+1+1+1+16+2=43 bytes.
[0047] The recognition process is as follows: Step 1): The main controller sends a 1-Wire reset pulse (Reset Pulse, low level for 480μs) and waits for the module's response pulse (Presence Pulse, low level for 60-240μs); if no response pulse is received, the identification is considered to have failed.
[0048] Step 2): The main controller sends the Skip ROM command (0xCC) to skip ROM matching and directly access the EEPROM device; Step 3): The main controller sends a read memory command (0xF0) to read all identity information fields (43 bytes in total) starting from address 0x00 in the module's EEPROM. Step 4): The main controller calculates the CRC-16 checksum of the read data and compares it with the CHECKSUM field stored in the EEPROM; if the checksum fails, it will be retried once, and if it still fails, it will be determined as an abnormal module.
[0049] Step 5): The main controller parses all identity fields to form a module capability description object.
[0050] The advantage of low-power handshake recognition is that it only uses two pins (P3 and P2, where P2 also serves as the return path), and can complete the identity recognition instantly before the module MCU is started. The recognition time is less than 50ms, which does not affect the user's perception.
[0051] Example 4: Capability Negotiation and Pin Remapping like Figure 5 As shown, the capability negotiation and pin remapping process in this embodiment is as follows: (a) Agreement version negotiation: The main controller compares its highest supported protocol version with the module's PROTOCOL_VERSION and selects the lower version as the protocol version for this communication. If the module's protocol version is lower than the lowest compatible version supported by the main controller, the main controller may attempt to enter compatibility mode or prompt the user to upgrade the module firmware.
[0052] (ii) Pin function mapping negotiation: The main controller determines the pin function mapping scheme based on the module's PIN_MAP_MASK. PIN_MAP_MASK is a 2-byte, 16-bit bitmap, with each bit corresponding to a pin function combination mode as shown in Table 2 below.
[0053] Table 2: Combination Patterns
[0054] It should be noted that USB communication requires VBUS and GND in addition to the data pins. In this invention, VBUS is provided by the VCC pin (P1) in power-on mode, and GND is provided by the P2 pin. Therefore, even if the remapped pins are not directly configured as USBDP / DM, the module can achieve USB communication through its internal circuitry when the module integrates a USB PHY and VCC / GND is already connected. For modules that require independent routing for the USB data pins, two of the remapped pins can also be dedicated to USB DP / DM, with the remaining functions adjusted accordingly.
[0055] The main controller selects the optimal mapping scheme from the pin modes supported by the module based on MODULE_TYPE and BANDWIDTH_REQ. The selection priority is: (1) meeting the module's bandwidth requirements; (2) prioritizing the use of simpler protocols (UART>I2C>SPI>USB); and (3) reserving more GPIOs for future expansion.
[0056] (III) Communication Parameter Negotiation: After determining the pin mapping, the main controller and the module negotiate specific communication parameters: UART mode: Baud rate (default 115200, negotiable up to 921600), data bits (8), parity bits (None / Even / Odd), stop bits (1). I2C mode: Clock frequency (default 100kHz, negotiable to 400kHz or 1MHz), slave device address; SPI mode (if applicable): Clock polarity / phase (Mode 0 / 1 / 2 / 3), clock frequency (default 1MHz, negotiable up to 10MHz), data bit order; USB mode: Device type (CDC / HID / Custom), endpoint configuration.
[0057] Negotiation Process: The main controller sends a negotiation command frame via the IDENT pin (still in 1-Wire mode at this time), with the frame format [SYNC:0xAA55][CMD:0x01=Negotiation Request][PROTOCOL_VER][PIN_MAP_SELECTED][COMM_PARAMS][CRC8]. The module replies with a negotiation confirmation frame, with the format [SYNC:0xAA55][CMD:0x81=Negotiation Confirmation][RESULT:0x00=Accept / 0x01=Degradation Required][ADJUSTED_PARAMS][CRC8].
[0058] If the module returns a downgrade requirement, the main controller adjusts the parameters according to ADJUSTED_PARAMS and resends the negotiation request, retrying a maximum of 3 times. Upon successful negotiation, the main controller performs pin remapping, switching the remappable pins from the default GPIO mode to the negotiated functional mode.
[0059] (iv) Confirmation of power supply parameters and full-power power-on: After negotiation, the main controller checks the module's POWER_MAX field to confirm whether the available power supply meets the module's requirements. If the module's maximum power consumption exceeds the robotic arm's current remaining power margin, the main controller can reduce the module's operating frequency, send a notification to the app, or refuse to load. Simultaneously, the main controller identifies the module's required power supply mode based on the POWER_MODE_REQ field: if it's fast charging mode, the main controller performs a charging protocol handshake with the module through the data channel to negotiate and determine the fast charging protocol type and charging parameters; after negotiation, the main controller switches the VCC pin output to the negotiated fast charging power supply mode (e.g., 9V / 2A or 12V / 1.5A). If it's normal mode, it maintains the standard 5V output. After power supply confirmation, the main controller outputs full power through the VCC pin, and the module's MCU officially starts up.
[0060] Example 5: Driver Loading and Scene Activation like Figure 6 As shown, the driver loading and scene activation process in this embodiment is as follows: (a) Driver matching: The main controller searches for a matching driver in the local driver database based on MODULE_TYPE and MODULE_MODEL. The driver database uses a hierarchical structure: MODULE_TYPE=0x0001 (Visual Sensing): MODEL=0x0001 (Standard Version) driver_cam_std_v2.bin; MODEL=0x0002 (Pro version) driver_cam_pro_v1.bin; MODEL=0xFFFF (General compatibility) driver_cam_generic.bin; MODULE_TYPE=0x0002 (Smart gripper): MODEL=0x0001 driver_grip_std_v1.bin;MODEL=0xFFFF driver_grip_generic.bin; MODULE_TYPE=0x0003 (phone clamp): MODEL=0x0001→driver_phone_std_v1.bin (including charging management driver); MODEL=0xFFFF→driver_phone_generic.bin; MODULE_TYPE=0x00FF (Custom extension): MODEL=0xFFFF driver_raw_gpio.bin.
[0061] The matching rules are as follows: (1) Prioritize exact matching (TYPE+MODEL+HW_VERSION); (2) If there is no exact match, degenerate to model matching (TYPE+MODEL); (3) If there is still no match, use the general type driver (TYPE+0xFFFF); (4) If the type is unknown (TYPE=0x00FF), use the original GPIO driver.
[0062] (II) Firmware Version Verification and Upgrade: like Figure 9 As shown, after successful driver matching, the main controller compares the module's FW_VERSION with the latest firmware version for that model recorded in the driver database. If the module's firmware version is lower than the latest version, the main controller sends a firmware upgrade request to the module through the negotiated data channel. The firmware upgrade is transmitted in packets via the data channel, each packet being 512 bytes and equipped with CRC-32 checksum. During the upgrade process, the 1-Wire IDENT channel remains independent and is used to transmit upgrade control commands and upgrade status. After the upgrade is complete, the module automatically restarts, and the main controller re-executes the identification process. If the upgrade fails (checksum error / transmission interruption), the module reverts to the original firmware version to ensure it does not become unusable.
[0063] (III) Scene Activation: After the driver is loaded, the main controller automatically activates the corresponding application scenario based on the module type: MODULE_TYPE=0x0001 (Visual Sensing): Activates the "Infant Monitoring / Learning Tutoring" scenario, and starts AI visual reasoning, thermal imaging periodic acquisition, and sound source localization; MODULE_TYPE=0x0002 (Smart Gripper): Activates the "Building Blocks / Medicine Retrieval Assistance" scenario, and initiates force control closed loop, visual guided grasping, and force threshold calibration; MODULE_TYPE=0x0003 (Mobile Phone Clamp): Activates the "Photography Director / Video Call" scene, starts face tracking, camera movement preset loading, charging management, and enters the adaptive power supply and charging management process; MODULE_TYPE=0x0004 (Environmental Sensing): Activates the "Environmental Monitoring" scenario, and starts temperature and humidity acquisition and air quality reporting; MODULE_TYPE=0x00FF (Custom): Activates "Free Mode", exposes the GPIO control interface, and waits for instructions from the upper layer application.
[0064] When a scene is activated, the main controller sends a scene change notification to the mobile app via BLE, and the app automatically switches to the corresponding interactive interface.
[0065] Example 6: Running Data Communication Once in runtime, the main controller and the modules exchange data in real time through a negotiated data channel. The runtime data communication protocol in this embodiment is as follows: Layer 1: Transport Frame All data channels (UART / I2C / SPI / USB) uniformly use the following frame format: [Frame Header 0x5A][Frame Type 1B][Serial Number 1B][Payload Length 2B][Payload 0~1024B][CRC-16 2B]. Frame type definition: 0x01: Command frame (Master → Module); 0x02: Response frame (module → master control); 0x03: Data reporting frame (module → main controller); 0x04: Event notification frame (module → master controller, asynchronous event); 0x05: Heartbeat frame (bidirectional, once every 500ms); 0x06: Contact quality reporting frame (module → main controller, carrying sampled contact resistance values of each pin); 0x07: Charging status reporting frame (module → main controller, carrying information such as current battery level, charging current, interface temperature, etc.); 0x81: Firmware upgrade data frame; 0xFF: Debug frame.
[0066] Second layer: Command / Data layer The command frame payload format is: [command code 2B][subcommand code 1B][parameter length 2B][parameter 0~512B].
[0067] Predefined command codes include: general commands (0x0001 GET_STATUS, 0x0002 SET_POWER_MODE, 0x0005 GET_CONTACT_QUALITY, 0x0006 TRIGGER_SELF_CLEAN, etc.), vision sensing module commands (0x0101 START_CAPTURE, 0x0102 STOP_CAPTURE, etc.), smart gripper commands (0x0201 SET_GRIP_FORCE, 0x0202 GRIP_CLOSE, etc.), and mobile phone clamp commands (0x0301 SET_CHARGE_ENABLE, 0x0302 GET_CHARGE_STATUS, 0x0303 SET_CHARGE_MODE, etc.).
[0068] Third layer: Application layer The application layer is defined by specific logic for each scenario, and the protocol reserves an extension mechanism: command codes 0x8000~0xFFFF are vendor-defined extension areas, and reserved bits in the CAPABILITY_DESC field can be used to describe extension capabilities.
[0069] Heartbeat and timeout mechanism: The main controller and the module send each other heartbeat frames every 500ms; if either party fails to receive heartbeat frames 3 times in a row, the communication is judged to have timed out; after the timeout, the module enters a safe state and the main controller attempts to renegotiate; if the renegotiation fails 3 times in a row, the main controller judges that the module is abnormally offline and reports an error to the App.
[0070] Continuous monitoring of contact quality: The module reports the sampled value of the contact resistance of each pin every 10 seconds in the running state through frame type 0x06; if the contact resistance of any pin exceeds the threshold, the main controller actively triggers a self-cleaning pulse (command 0x0006); pins that still fail to pass after self-cleaning are marked as degraded pins by the main controller and their functions are remapped on available alternative channels.
[0071] Example 7: Hot Pull-Out Detection and Safety Protection like Figure 8 As shown, the hot pull-out detection and safety protection process in this embodiment is as follows: (a) Physical separation and detection: The main controller detects module separation through the following three mechanisms: IDENT pin level change: After the module is separated, P3 returns to high level, and the rising edge is captured by the main controller GPIO interrupt; The supply current suddenly drops: the VCC current drops to 0mA; Heartbeat timeout: Three consecutive heartbeats failed to respond.
[0072] Triggering any one of the three mechanisms initiates the unplugging process, with double / triple triggering serving as confirmation.
[0073] (II) Emergency Movement Protection: Upon detecting module separation, the main controller performs the following actions within 5ms: Immediately stop all motion commands being sent to this module; If the robotic arm is executing a motion trajectory, switch to the safe stop mode—decelerate to a standstill using an S-curve, rather than a sudden stop, to avoid screen shake and mechanical impact; Maintain the self-locking state of each joint worm gear and worm, and keep the current posture; If the current power supply mode is fast charging, the main controller will first switch the output of the VCC pin from fast charging voltage back to standard 5V voltage, and then perform subsequent protection actions to prevent arcing caused by high voltage hot plugging and unplugging. Send a "Module has been separated" notification to the mobile app.
[0074] (iii) Pin status reset: After the module is separated, the main controller restores all remapped pins to the default GPIO mode and configures them as input pull-down pins to prevent abnormal current from being caused by floating pins.
[0075] (iv) Driver uninstallation: The main controller unloads the loaded module driver, freeing up the occupied memory and computing resources. The driver database retains a cache of the driver so that it can be quickly loaded when the same module is connected again.
[0076] (v) Scene downgrade: If module separation causes the current scenario to become unusable, the main controller will automatically downgrade to a safe scenario: if there is a description of the capabilities of an alternative module, the user will be prompted to install the alternative module; if there is no alternative, the active interaction function of the current scenario will be paused, and only basic voice prompts will be retained; a scenario downgrade notification will be pushed to the App.
[0077] Example 8: Adaptive Power Supply and Charging Protocol Handshake like Figure 10 As shown, the adaptive power supply and charging protocol handshake process in this embodiment is as follows: (a) Identification of power supply demand: After completing the low-power handshake identification (Example 3) and parsing the identity information, the main controller reads the POWER_MODE_REQ field to determine the power supply mode required by the functional module: if POWER_MODE_REQ=0x00, it is determined that only the standard power supply mode (5V) is required; if POWER_MODE_REQ=0x01 or 0x02, it is determined that the fast charging power supply mode (9V or 12V) is required.
[0078] (II) Fast Charging Agreement Negotiation: If a functional module requires fast charging power supply mode, the main controller sends a charging protocol handshake request to the functional module through the data channel (UART / I2C / GPIO). The frame format is [SYNC: 0xAA55][CMD: 0x10=Charging Negotiation Request][SUPPORTED_PROTOCOLS][CRC8]. The functional module replies with the types of fast charging protocols it supports (including but not limited to higher-level concepts such as QC, PD, PE, etc.). The main controller selects one based on the intersection of the protocols supported by both parties and negotiates to determine the charging voltage and current parameters.
[0079] (III) Power supply mode switching: After negotiation, the main controller sends a power supply mode switching command to the functional module. Once the functional module confirms readiness, the main controller switches the VCC pin output from the standard 5V to the negotiated fast charging voltage (e.g., 9V / 2A or 12V / 1.5A). After the switch is complete, the functional module begins fast charging. If negotiation fails or the functional module does not support fast charging, the main controller maintains the standard 5V output and sends a notification to the App stating "The current module does not support fast charging."
[0080] (iv) Charging safety monitoring: In fast charging mode, the functional module reports charging status information, including current battery level, charging current, and interface temperature, to the main controller via frame type 0x07 at a higher frequency than normal heartbeat frames (e.g., 10 times per second). The main controller continuously monitors these parameters: if the interface temperature exceeds a preset temperature threshold (e.g., 60℃), the main controller immediately switches the VCC pin output from fast charging voltage back to standard 5V and pushes a "charging overheat protection" prompt to the App; if the charging current fluctuates abnormally (e.g., current sudden change exceeds ±20%), the main controller cuts off the power supply output and pushes a "charging abnormal" prompt to the App. If the power supply abnormality persists for more than a preset time (e.g., 5 seconds), the hot-pull protection process is triggered.
[0081] (v) Charging complete and mode restored: When the functional module reports that the battery is fully charged or the user actively stops charging, the main controller sends a power supply mode recovery command to the functional module. After the functional module confirms, the main controller switches the VCC pin output from the fast charging voltage back to the standard 5V. If the module is still not unplugged from the interface at this time, the system continues to maintain the basic operation of the module in the standard power supply mode.
[0082] Example 9: Access to the visual sensing module The user brings the AI visual sensing device close to the end of the robotic arm.
[0083] Automatic magnetic pole alignment: The magnetic pole arrangement at the module end is mirrored and complementary to that at the main control end. The module starts to rotate automatically when it is 3mm away from the end face, locks the correct angle within 200ms, and is in place, with all Pogo Pins in contact.
[0084] Physical access detection: P3 falling edge trigger, VCC current rises to 10mA (1-Wire EEPROM parasitic power supply, supplemented by VCC pre-charge auxiliary power supply), and valid access is determined.
[0085] Contact quality inspection and self-cleaning: The contact resistance of the VCC pin was detected to be 45mΩ (<100mΩ), which is acceptable. P3 determines that the contact is normal by checking the 1-Wire response pulse width.
[0086] Low-power handshake recognition: The main controller reads the module's EEPROM via 1-Wire (at this time, the module's MCU has not yet started) and obtains: MODULE_TYPE=0x0001 (visual sensing), MODULE_MODEL=0x0002 (Pro version, with thermal imaging), HW_VERSION=0x0100, FW_VERSION=0x0203, PROTOCOL_VERSION=0x02, PIN_MAP_MASK=0x0010 (bit4=1, supports USB mode), BANDWIDTH_REQ=0x04 (extremely high), POWER_MAX=0x02D0 (720mA), POWER_MODE_REQ=0x00 (standard 5V), CHARGE_CTRL=0x00 (no charging management function), MAG_POLE_SIG=0x00 (standard magnetic pole signature), CAPABILITY_DESC=image + force + depth + temperature + audio + supplementary light.
[0087] Capability negotiation and pin remapping: Protocol version negotiation: The main controller supports V2, the module supports V2, select V2; Pin mapping negotiation: PIN_MAP_MASK bit4=1, select mode 4 (USB), remappable pins are configured according to the internal USB PHY connection method of the module; Communication parameters: USB CDC mode, bulk transfer endpoint; Power supply confirmation: The module has a maximum power supply of 720mA and requires a standard 5V power supply. The robotic arm currently has a remaining power supply margin of 1000mA, which meets the requirements. Full power-on: The main controller outputs 5V / 3A through VCC, and the RV1126B main controller on the module side officially starts up.
[0088] Driver loading and scene activation: Driver matching: TYPE=0x0001+MODEL=0x0002→driver_cam_pro_v1.bin; Firmware verification: Module FW=V2.3, the latest driver in the database is V2.5, triggering online upgrade; Firmware upgrade: Firmware data is transmitted in packets via USB channel, which takes approximately 30 seconds to complete; After the upgrade, the driver was re-identified and loaded successfully. Scene activation: The "Baby Monitoring" scene is activated by default, and the App switches to the monitoring interface.
[0089] Operational data communication: The camera transmits H.264 encoded video streams at 1080p@15fps via USB channel; force / temperature / audio data are reported at low priority (once per second) via 1-Wire IDENT channel; contact quality is reported every 10 seconds.
[0090] Example 10: Integration of Intelligent Gripper Module (Replacing Vision Module) Users can remove the vision sensor module and replace it with a smart gripper.
[0091] Vision module hot-stripping: Triggered by the rising edge of P3, VCC current drops to 0mA, heartbeat timeout; emergency protection within 5ms—S-curve deceleration stops the current camera movement trajectory, maintaining self-locking; pin reset, driver unload, App prompts "Vision module has been detached, infant monitoring paused". Automatic clamp magnetic pole alignment: Clamp magnetic pole signature = 0x00 (standard signature), complementary to the main control terminal magnetic poles, automatically rotates and adsorbs.
[0092] Contact quality test: VCC contact resistance 35mΩ, passed. P3 response pulse width 120μs, normal.
[0093] Gripper module identification: 1-Wire read: TYPE=0x0002, MODEL=0x0001, PIN_MAP_MASK=0x000A (bit1+bit3, supports UART+GPIO and UART+PWM modes); pin mapping selects mode 3 (UART+PWM), P4 / P5 are UART TX / RX, P6 is PWM output; full power-on, gripper MCU starts; driver loads driver_grip_std_v1.bin, firmware is the latest and does not need to be upgraded; power supply mode is standard 5V; scene activation is "block building" scene.
[0094] Operating state: The main controller sends the GRIP_CLOSE command via UART with the following parameters: target force 2N, speed 5mm / s; the force sensor reports in real time via P6 (ADC), enabling closed-loop control.
[0095] Example 11: Poor Contact Scenario After six months of use in a dusty environment, the user noticed that the contact resistance of the adsorption gripper module was too high.
[0096] Physical connection: Magnetic poles automatically align and adsorb.
[0097] Contact quality inspection: VCC contact resistance 180mΩ (>100mΩ threshold), deemed unqualified.
[0098] Self-cleaning: Execute a positive pulse of 100mA / 10ms → cool for 50ms → re-detect, resistance drops to 60mΩ, pass.
[0099] The normal recognition process will then proceed.
[0100] If self-cleaning still fails: Reverse pulse -100mA / 10ms → Cool for 50ms → Retest. If the resistance drops to 45mΩ, it passes. If both rounds of self-cleaning fail, the error message will be: "Module contact failure. Please remove and wipe the interface with a dry cloth before trying again."
[0101] Example 12: Charging Abnormality Scenario The ambient temperature is high when the user is charging the phone using the phone clamp module.
[0102] Normal charging startup: VCC output 9V / 3A, phone is fast charging.
[0103] Charging temperature monitoring: After running for 15 minutes, the module reported an interface temperature of 63℃ (>60℃ threshold).
[0104] Charging safety protection: The main controller sends a SET_CHARGE_DISABLE command to stop charging; the VCC voltage drops from 9V to 5V in steps; the main controller prompts the user via the App that "charging temperature is too high, standard power supply has been switched, charging has been paused, please check ventilation conditions"; the module maintains a +5V standard power supply to maintain its own operation (face tracking and other functions are not affected).
[0105] After the temperature recovered: After the user improved the ventilation conditions, the interface temperature dropped to 45℃; the main controller re-executed the charging protocol handshake and restored 9V / 3A fast charging.
[0106] Therefore, this invention provides an adaptive identification and communication method and system for a modular magnetic interface. It achieves automatic module rotation and alignment through irregular magnetic pole arrangement, while retaining the high-speed data transmission capability of the Pogo Pin; magnetic pole signature provides an authenticable anti-counterfeiting mechanism. Through a dedicated identification channel and zero-power standby design, the module can complete identification even when the MCU is not powered on. Self-cleaning pulses combined with continuous monitoring during operation improve the long-term reliability of the contacts. A layered communication protocol enables interconnection between different types of modules, and pin remapping allows the same interface to adapt to diverse needs, from low-bandwidth sensors to high-bandwidth cameras. Adaptive power supply supports both standard and fast charging modes, and charging safety management ensures fast charging safety. Multiple detection and S-curve deceleration protect hot-plug safety, version negotiation and online upgrades ensure multi-generation compatibility, and custom extensions reserve interfaces for third-party development.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. An adaptive identification and communication method for a modular magnetic interface, applied to a device including a main controller and at least one replaceable functional module, wherein the main controller and the functional module are detachably electrically connected via a magnetic interface, the magnetic interface including multiple pins, characterized in that... Includes the following steps: 1) Physical access detection steps: Detect whether the functional module has been attached to the main controller side; 2) Identification steps: When the main control chip of the functional module is not powered, the identity information of the functional module is read through the preset identification channel in the magnetic interface; 3) Negotiation and remapping steps: Based on the identity information, negotiate the pin function mapping scheme, communication parameters and power supply mode, select one mode from a variety of preset pin function combination modes, and send the selection result to the function module for confirmation. After confirmation, configure at least one remapping pin in the magnetic interface to the communication function corresponding to the mode, and configure the power supply pin output to the negotiated power supply mode. 4) Driver loading steps: Load the corresponding driver based on the identity information; 5) Running communication steps: Through the pins configured after the negotiation and remapping steps, data exchange is carried out between the main controller and the functional modules according to the negotiated communication parameters.
2. The adaptive identification and communication method for a modular magnetic interface according to claim 1, characterized in that, The physical access detection step is preceded by an automatic magnetic pole alignment step, which is as follows: Multiple magnets are set on the main controller side and the functional module side respectively. The multiple magnets are arranged according to a preset N / S pole orientation sequence. The magnetic pole orientation sequence on the functional module side is a mirror image of the magnetic pole orientation sequence on the main controller side. When the functional module is close to the main controller, all magnet pairs are N-S opposite attraction at only one rotation angle, and at other rotation angles there is at least one N-N or SS like repulsion magnet pair, which generates a repulsive torque to drive the functional module to automatically rotate to the only correct angle. The N / S pole orientation sequence constitutes a magnetic pole signature, and different functional modules are configured with different magnetic pole signatures. The magnetic pole signature is used to perform preliminary identity verification of the functional modules at the physical layer. The identity information read in the identification step contains the magnetic pole signature code field of the functional module. The main controller compares and verifies the read magnetic pole signature code with the physically detected magnetic pole arrangement.
3. The adaptive identification and communication method for a modular magnetic interface according to claim 1, characterized in that, The magnetic interface includes: The power pin is used to supply power to the functional module and supports dual-mode output of standard power supply mode and fast charging power supply mode; The identification pin is specifically used for reading identity information during the identification process. Multiple remappable pins are configured for different communication functions during the negotiation and remapping steps; The identification pin is physically separated from the remapped pin, and the identification pin starts working before the remapped pin is configured.
4. The adaptive identification and communication method for a modular magnetic interface according to claim 3, characterized in that, The identification steps specifically include: The functional module is equipped with a 1-Wire protocol storage device, which stores identity information. When the main control chip of the functional module is not powered, the 1-Wire protocol storage device is parasiticly powered by the signal on the identification pin. The main controller initiates 1-Wire communication by identifying pins and reads the identity information stored in the 1-Wire protocol storage device when the main control chip of the functional module is not powered. The identity information includes at least: module type code, module model code, hardware version number, firmware version number, protocol version field, pin function mapping bitmask, bandwidth requirement level, power requirement field, charging management field, and checksum field. After the reading is completed, the main controller calculates the checksum and compares it with the checksum field. If the checksum passes, the main controller outputs full power to the functional module through the power supply pin, so that the main control chip of the functional module can be powered on and started.
5. The adaptive identification and communication method for a modular magnetic interface according to claim 4, characterized in that, The physical access detection step and the identification step also include a contact quality detection and self-cleaning step, specifically: The main controller applies a test current to the power supply pin of the magnetic interface, detects the voltage drop of the power supply pin, and calculates the contact resistance; If the contact resistance exceeds the preset threshold, the main controller outputs a positive current pulse and a reverse current pulse to at least one pin in the magnetic interface in sequence. After each current pulse, a cooling time is waited to remove the oxide layer and dust from the contact surface by utilizing the thermal effect and electromagnetic force effect of the current. After the self-cleaning is completed, the contact resistance is re-tested. If the contact resistance still exceeds the preset threshold after one round of positive and negative pulses, the process is repeated up to one more round. If the contact resistance still exceeds the preset threshold after two rounds of self-cleaning, a poor contact is determined and a prompt is output.
6. The adaptive identification and communication method for a modular magnetic interface according to claim 5, characterized in that, The negotiation and remapping steps specifically include: The main controller negotiates the protocol version to be used for this communication with the functional modules based on the protocol version field in the identity information; The main controller selects a mode that meets the bandwidth requirement level and is supported by the functional module from a variety of preset pin function combination modes based on the pin function mapping bitmask and bandwidth requirement level in the identity information; the variety of preset pin function combination modes include at least two of the following: full GPIO mode, UART+GPIO mode, I2C+GPIO mode, UART+SPI mode, USB mode, I2C+SPI mode, and UART+PWM mode. The main controller negotiates communication parameters with the functional modules according to the selected pin function combination mode. The communication parameters include at least one of the following: baud rate, clock frequency, data bits, parity bit, stop bit, clock polarity / phase, data bit sequence, and USB device type. The main controller sends the selection result to the functional module in the form of a negotiation command frame. After receiving the negotiation confirmation frame returned by the functional module, it switches the remapped pin to the function corresponding to the selected mode and performs data interaction according to the negotiated communication parameters.
7. The adaptive identification and communication method for a modular magnetic interface according to claim 1, characterized in that, The power supply mode agreed upon through negotiation is as follows: The main controller identifies the power supply mode required by the functional module based on the power supply requirement field in the identity information. The power supply modes include standard power supply mode and fast charging power supply mode. If a functional module requires a fast charging power supply mode, the main controller will conduct a charging protocol handshake with the functional module through the data channel to negotiate and determine the fast charging protocol type and charging parameters. The fast charging protocol type is described using a higher-level concept, including any charging protocol that supports dynamic voltage adjustment. After negotiation, the main controller switches the power pin output from the default standard power supply mode to the negotiated fast charging power supply mode, and supplies power to the functional module according to the negotiated voltage and current; if the functional module only requires the standard power supply mode, the main controller maintains the power pin output in the standard power supply mode.
8. The adaptive identification and communication method for a modular magnetic interface according to claim 1, characterized in that, The runtime communication steps include: The main controller and functional modules exchange heartbeat frames according to a preset cycle; If no heartbeat frame is received from the other party for a preset number of consecutive times, the communication is deemed to have timed out. After determining that the communication has timed out, the main controller attempts to re-execute the negotiation and remapping steps. If the renegotiation fails, the functional module is determined to be abnormally offline. The functional module periodically reports the sampled contact resistance values of each pin to the main controller through the data channel during operation; if the contact resistance of any pin exceeds the preset threshold, the main controller triggers a self-cleaning operation. When the functional module is in fast charging power supply mode, the functional module periodically reports charging status information to the main controller. The charging status information includes at least one of the following: current battery level, charging current, and interface temperature. If the interface temperature exceeds the preset temperature threshold or the charging current fluctuates abnormally beyond the preset range, the main controller will switch the power pin output from fast charging power supply mode back to standard power supply mode or cut off the power supply output. The reporting frequency of charging status information is higher than the heartbeat frequency of normal operating status data.
9. The adaptive identification and communication method for a modular magnetic interface according to claim 8, characterized in that, It also includes hot pull-out detection and protection steps: The main controller detects the separation of functional modules by at least one of the following methods: identifying pin level changes, supply current changes, and heartbeat timeouts; Upon detection of separation, the main controller performs at least one of the following protective actions within a preset time: stops sending commands to the functional modules, switches the robotic arm to the safe deceleration and stop mode, restores the remapped pins to their default state, and uninstalls the driver program; wherein, the safe deceleration and stop mode is to decelerate to a standstill using an S-curve.
10. The adaptive identification and communication method for a modular magnetic interface according to claim 9, characterized in that, The driver loading steps include: Based on the module type code and module model code in the identity information, the main controller performs the following matching in the local driver database in sequence: exact matching, model matching, and general type matching; If a match is found, the corresponding driver is loaded. If a match cannot be found, load the generic driver or the original GPIO driver; After the driver is loaded, the main controller compares the firmware version number in the identity information with the latest firmware version of that model in the driver database; if the firmware version of the functional module is lower than the latest version, the main controller transmits the firmware upgrade data to the functional module in packets through the data channel, with each packet carrying a check code; After the upgrade is complete, the functional module will automatically restart, and the main controller will re-execute the identification steps; if the upgrade fails, the functional module will revert to the original firmware version.
11. A modular magnetic interface system, characterized in that, include: The main controller side interface is located on the main body of the device and includes a first set of power pins, a first set of identification pins and a first set of remappable pins, as well as a first set of magnets arranged in a first preset N / S pole orientation sequence. At least one functional module side interface is provided on the replaceable functional module, including a second set of power pins, a second set of identification pins and a second set of remapped pins corresponding to the first set of power pins, the first set of identification pins and the first set of remapped pins respectively, and a second set of magnets arranged in a second preset N / S pole orientation sequence that is mirror complementary to the first preset N / S pole orientation sequence. The functional module side interface is also equipped with a storage device. When the main control chip of the functional module is not powered, the storage device is parasiticly powered by the signal on the second set of identification pins. The storage device stores the identity information of the functional module. The main controller side interface also includes a control unit configured to perform the method as described in any one of claims 1-10.