CN109531569B - Robot based on interface supporting interconnection of different electronic parts - Google Patents

Robot based on interface supporting interconnection of different electronic parts Download PDF

Info

Publication number
CN109531569B
CN109531569B CN201811480004.9A CN201811480004A CN109531569B CN 109531569 B CN109531569 B CN 109531569B CN 201811480004 A CN201811480004 A CN 201811480004A CN 109531569 B CN109531569 B CN 109531569B
Authority
CN
China
Prior art keywords
pin
line
data
motor
master control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811480004.9A
Other languages
Chinese (zh)
Other versions
CN109531569A (en
Inventor
张洋
张虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING AIQI TECHNOLOGY CO., LTD.
Original Assignee
Beijing Aiqi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Aiqi Technology Co ltd filed Critical Beijing Aiqi Technology Co ltd
Priority to CN201811480004.9A priority Critical patent/CN109531569B/en
Publication of CN109531569A publication Critical patent/CN109531569A/en
Application granted granted Critical
Publication of CN109531569B publication Critical patent/CN109531569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/161Hardware, e.g. neural networks, fuzzy logic, interfaces, processor
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J19/00Accessories fitted to manipulators, e.g. for monitoring, for viewing; Safety devices combined with or specially adapted for use in connection with manipulators

Landscapes

  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Toys (AREA)
  • Manipulator (AREA)

Abstract

The application discloses a robot based on an interface supporting interconnection of different electronic parts. After a motor of the robot is connected to a master control through an interface, controlling A3 to output a square wave signal, and reading the square wave signal by the master control to identify the type of the motor; controlling the PWM signal output by the A5, controlling the rotating speed and the rotating angle of the motor, controlling the A8 to output high level or low level, and controlling the rotating direction of the motor; the motor outputs A, B phase signals through A10 and A11; the main control calculates the current rotating speed and angle of the motor through A, B phase signals; the power adapter configures A7 to be a low level, when the master control detects the falling edge of A7, the power adapter controls A6 to output a square wave signal, and after the power adapter reads the square wave signal, the power adapter controls A2 to output a charging voltage to charge the master control lithium battery; the master control and the sensor realize data transmission through the high level or the low level of A3, A10 and A11 respectively. Different electronic components communicate or charge through different pins of the interface, the interface is unified, the connection mode is more flexible, and the splicing is more random.

Description

Robot based on interface supporting interconnection of different electronic parts
Technical Field
The present application relates to the field of electronics, in particular to the field of robots, and more particularly to robots based on interfaces supporting interconnection of different electronic components.
Background
Electronic toys such as robots and unmanned planes are assembled by different electronic parts, and partial toys support user disassembly and free combination. Because the electronic parts with different functions have different communication modes, the electronic parts with different functions in the existing electronic toy have respective interfaces, and when the electronic parts are interconnected, the electronic parts can be connected only through specific interfaces, so that the interfaces are not uniform and the connection is not flexible.
Disclosure of Invention
The present application aims to provide an interface supporting interconnection of different electronic components and a robot based on the interface, so as to solve the technical problems mentioned in the above background.
In a first aspect, the present application provides an interface for supporting interconnection of different electronic components, where the interface includes 12 pins, specifically: an A1 pin configured to be used as a ground; an A2 pin configured to act as a power cord for a power adapter; the device comprises an A3 pin, a multifunctional pin, a state line configured to be used as a sensor and/or a master control, and an identification line of a motor; an A4 pin configured to act as a power supply line; a pin A5, configured to transmit PWM signal for controlling the rotation speed and rotation angle of the motor; an a6 pin configured to serve as a signal line of a power adapter; an A7 pin configured to serve as an identification line for a power adapter; a pin A8 configured to control the direction of rotation of the motor; an A9 pin configured to act as a power supply line; the device comprises an A10 pin, a multifunctional pin, a clock line configured to be used as a sensor and/or a master control, and a motor quadrature encoder A phase signal line; the device comprises an A11 pin, a multifunctional pin, a data line configured to be used as a sensor and/or a master control, and a B-phase signal line of a motor quadrature encoder; pin a12 configured to be used as ground.
In some embodiments, the interface is arranged into two rows of pins, wherein the pins in the front row and the pins in the back row are connected together.
In a second aspect, the application provides a robot based on the interface, the robot comprising electronics: master control, sensor, motor, power adapter, wherein, every electron all configures the interface, it is specific: after the motor is accessed to the master control through the interface, controlling the pin A3 of the identification line to output a square wave signal with a preset frequency, reading the square wave signal with the preset frequency by the master control, and identifying the type of the motor corresponding to the square wave signal; the main control controls the rotating speed and the rotating angle of the motor by controlling the frequency and the duty ratio of a PWM signal output by an A5 pin, and controls the rotating direction of the motor by controlling a high level or a low level output by an A8 pin; in addition, the motor respectively outputs an A-phase signal and a B-phase signal through a pin A10 of a quadrature encoder A-phase signal line and a pin A11 of a quadrature encoder B-phase signal line; the master control calculates the current rotating speed and angle of the motor through the A-phase signal and the B-phase signal; after the power adapter is connected to a master control through the interface, a pin A7 of the identification line is configured to be a low level, when the master control detects the falling edge of the level of the pin A7 of the identification line, the pin A6 of the signal line is controlled to output a square wave signal with a specific frequency, and after the power adapter reads the square wave signal with the specific frequency on the pin A6, the power adapter controls a power line A2 to output a charging voltage to charge the lithium battery of the master control; the master control and the sensor are connected through the interface, and the master control and the sensor respectively realize data transmission without distinguishing master-slave, half-duplex and synchronization through high level or low level of a reading and/or writing state line A3 pin, a clock line A10 pin and a data line A11 pin at different times.
In some embodiments, if no battery is configured within the sensor, the sensor communicates with the master through the power lines a4, a9 in addition to the status line A3 pin, the clock line a10 pin, and the data line a11 pin.
In some embodiments, if no battery is disposed within the motor, the motor communicates with the master control via identification line A3 pin, A5 pin, A8 pin, quadrature encoder A-phase signal line A10 pin, quadrature encoder B-phase signal line A11 pin, and the master control also powers the motor via power lines A4, A9.
In some embodiments, in addition to controlling the power line a2 to output a charging voltage to charge the lithium battery of the master, the power adapter also supplies power to the master through the power lines a4, a 9.
In some embodiments, the robot further includes a second master controller, specifically: the master control and the second master control are connected through the interface, and the master control and the second master control respectively realize data transmission without distinguishing master-slave, half-duplex and synchronization through reading and/or writing high level or low level of a state line A3 pin, a clock line A10 pin and a data line A11 pin at different times.
In some embodiments, the robot further includes a second master controller, specifically: the master control with the robot still includes the concentrator, and is specific: the hub is configured to expand one interface into a plurality of interfaces, and the master is in communication with a plurality of sensors and/or masters through the hub, wherein an electronic part for transmitting data is called a transmitting end, and an electronic part for receiving data is called a receiving end.
In some embodiments, the master communicates with a plurality of sensors and/or masters through the hub, including: the status line A3 pin of each electronic is connected to the status line of the hub, the clock line A10 pin of each electronic is connected to the clock line of the hub, and the data line A11 pin of each electronic is connected to the data line of the hub.
In some embodiments, the master is in communication with a plurality of sensors and/or masters through the hub, the electronics that transmit data is referred to as a sender, and the electronics that receive data is referred to as a receiver, further comprising: the sending end closes a bus interrupt mechanism, judges whether the state of the bus is idle according to the read levels on a state line A3 pin and a clock line A10 pin, sends byte data byte by byte according to a preset time interval when the state of the bus is idle, releases a serial bus after sending all the byte data, and opens the bus interrupt mechanism, wherein the flow of sending each byte data is as follows: controlling the pin A3 of the status line to output low level, namely, the level on the status line is set from high level to low level, when the level on the data line is determined to be high level, that is, all receiving terminals have output high level at the pin A11 of the data line to respond, bit data in byte data is transmitted bit by bit through the pin A11 of the data line at the falling edge of the level on the clock line, when next bit data is transmitted, a high level response signal returned by the receiving terminals at the clock line is ensured to be received, and when byte data which is not transmitted is judged to exist after each byte data is transmitted, the pin A11 of the data line is controlled to output high level, the pin A10 of the clock line outputs low level, and the pin A3 of the status line outputs high level; the receiving end is used for repeatedly executing the following steps: monitoring the level on the state line in real time, triggering bus interrupt when detecting that the level on the state line is changed from high level to low level, suspending processing other tasks, confirming that the level on the state line is low level, outputting high level at a pin A11 of the data line as a response, reading bit data on the data line one by one when the level on the clock line is low level, controlling a pin A10 of the clock line to output high level as a response after reading each bit data, releasing the serial bus after reading one byte of data, starting a bus interrupt mechanism, and processing other tasks.
The utility model provides a support the interface of different electron spare interconnections and based on robot of this interface, the electron spare of different functions is through unified interface connection, through different pin communication or charge, and the concatenation is more nimble.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a timing diagram of one embodiment of an interface-based robot according to the present application;
FIG. 3 is a flow diagram of electronics communication in one embodiment of an interface-based robot according to the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, fig. 1 illustrates an exemplary architecture 100 to which embodiments of the interface supporting interconnection of different electronic components and a robot based thereon of the present application may be applied.
The framework in fig. 1 can be applied to electronic toys such as robots and unmanned planes. The system architecture includes electronics: motor 101, motor 102, master control 103, power adapter 104, hub 105, color sensor 106, attitude sensor 107, distance sensor 108. These electronics are connected through the interface of the present application. Taking the robot as an example, the master controller 103 is used as the brain of the robot, and communicates with electronic components such as motors and sensors to transmit data or instructions. The motors 101 and 102 control the rotating speed and angle of the motors according to the received data and instructions sent by the main control 103, so as to realize the movement of the joints of the robot or drive the wheels of the robot to rotate. The power adapter 104 serves as the master 103 for charging. The hub 105 may extend one interface to multiple interfaces. The color sensor 106 is used to identify the color of the object. The attitude sensor 107 is used to measure the three-dimensional motion attitude of the robot. The distance sensor 108 is used to measure the distance to the object. The main control 103 communicates with each sensor, processes and analyzes data output by the sensor, and is used for realizing functions such as obstacle avoidance. It should be understood that the number of electronics in fig. 1 is merely illustrative. There may be any number of electronics, as desired for implementation.
In this embodiment, an interface supporting interconnection of different electronic components is disclosed, where the interface includes 12 pins, specifically: an A1 pin configured to be used as a ground; an A2 pin configured to act as a power cord for a power adapter; the device comprises an A3 pin, a multifunctional pin, a state line configured to be used as a sensor and/or a master control, and an identification line of a motor; an A4 pin configured to act as a power supply line; a pin a5 configured to transmit a PWM (Pulse Width Modulation) signal for controlling the rotation speed and rotation angle of the motor; an a6 pin configured to serve as a signal line of a power adapter; an A7 pin configured to serve as an identification line for a power adapter; a pin A8 configured to control the direction of rotation of the motor; an A9 pin configured to act as a power supply line; the device comprises an A10 pin, a multifunctional pin, a clock line configured to be used as a sensor and/or a master control, and a motor quadrature encoder A phase signal line; the device comprises an A11 pin, a multifunctional pin, a data line configured to be used as a sensor and/or a master control, and a B-phase signal line of a motor quadrature encoder; pin a12 configured to be used as ground. When the master control is connected with the sensor and/or the motor through the interface, the master control supplies power to the sensor and/or the motor through the power line A4 pin and the A9 pin. The adoption of two power lines A4 and A9 can increase the current transmission capability. When the power adapter is connected with the master control through the interface, the power adapter charges the lithium battery in the master control through the A2 pin, and supplies power to the master control through the power line A4 pin and the A9 pin. The problem of low charging efficiency caused by power supply during lithium battery charging is avoided.
In this embodiment, the master control for the interface is a built-in rechargeable lithium battery. If the robot master has a non-rechargeable disposable battery built in it, the interface can still be used, and the pins a2, a6 and a7 associated with the power adapter are reserved and set as idle pins, and the software and hardware modules associated with the power adapter in the master are removed.
In this embodiment, the male connector and the female connector both have the above 12 pins, and the male connector can be inserted into the female connector to realize electrical connection, that is, the corresponding pins realize electrical connection. Different electronics may have several male and/or female interfaces. The two electronic parts for realizing the connection identify the type of the electronic parts through the driving program.
In some optional implementation manners of this embodiment, the structure of the interface is set to be the same as that of the USB Type-C, that is, the interface is set to be two rows of pins, and the pins corresponding to the front side and the back side are connected together. And forward and reverse insertion of the user is supported. As an example, the master control is configured with a plurality of Type-C female head interfaces, and other electronic components such as motors, sensors, power adapters, etc. are each configured with 1 Type-C male head interface. And for a certain Type-C female head interface on the master control, the plug-in of any other electronic part is supported, and the master control identifies the Type of the plugged-in electronic part through a driver.
In this embodiment, the interface has 12 pins, and the interface supports the connection between the main controller and any electronic component among the motor, the sensor, and the power adapter, so as to unify the interfaces, and of course, the type of the electronic component needs to be identified by the driver. After the interfaces are unified, the connection between the electronic parts is more flexible.
Fig. 2 shows a timing diagram 200 of an embodiment of the robot based on the above interface. It should be noted that the master control has an interrupt mechanism and a time-sharing multiplexing mechanism, and a timing chart of each time the master control communicates with the motor, the power adapter and the sensor is not unique, but the communication steps between the master control and each electronic component are the same. Specifically, as shown in the figure, the timing diagram includes the following steps:
in step 201, the pin of the motor control identification line a3 outputs a square wave signal with a preset frequency.
In this embodiment, after the motor is connected to the main control through the interface, the pin a3 of the identification line is actively controlled to output a square wave signal with a predetermined frequency. One robot may be equipped with a plurality of different types of motors. Including but not limited to large servo motors, medium servo motors, small servo motors. Each different type of motor corresponds to a square wave signal with a preset frequency.
Step 202, the master control reads the square wave signal with the preset frequency, and identifies the motor type corresponding to the square wave signal.
In this embodiment, the master controller reads the square wave signal on the pin a3, and compares the frequency of the square wave signal with a list of pre-stored square wave signal frequencies-motor types to determine the motor type corresponding to the square wave signal. Steps 201 and 202 are steps of identifying the motor, which may also be referred to as a driver. The operation is performed only once after the motor is inserted into the master control each time. And the following steps 203 to 205 of controlling the motor to rotate by the master controller are executed as many times as necessary.
And step 203, the main controller controls the rotating speed and the rotating angle of the motor by controlling the frequency and the duty ratio of the PWM signal output by the pin A5, and controls the rotating direction of the motor by controlling the pin A8 to output high level or low level.
In the embodiment, the main control generates a PWM signal with a certain frequency and duty ratio according to the type of the motor according to the received instruction, and sends the PWM signal to the motor through the a5 pin. And a driving circuit of a motor in the motor controls the rotating speed and the rotating angle of the motor according to the received PWM signal. Wherein, the instruction that comes from the remote controller can be received to the master control, and intelligent terminal's instruction, for example the instruction that APP sent on the cell-phone presses the instruction that robot self predetermines the button and trigger, for example, after pressing the dance button, triggers the robot and turns 3 circles on the left and turn 3 circles on the right.
In this embodiment, the main control outputs high level or low level through the control A8 pin, and controls the rotation direction of the motor. For example, a high level indicates forward rotation, and a low level indicates reverse rotation.
In step 204, the motor outputs an a-phase signal and a B-phase signal through a pin A10 of the quadrature encoder A-phase signal line and a pin A11 of the quadrature encoder B-phase signal line, respectively.
In the present embodiment, the motor is configured with a quadrature encoder, which is also called a photoelectric encoder, and is a sensor that converts mechanical geometric displacement on the output shaft of the motor into A, B-phase signals through photoelectric conversion. The motor respectively outputs A-phase signals and B-phase signals of the quadrature encoder through an A10 pin and an A11 pin.
And step 205, the main controller calculates the current rotating speed and angle of the motor through the A-phase signal and the B-phase signal.
In this embodiment, the a-phase signal and the B-phase signal of the quadrature encoder are signals fed back to the main controller by the motor, and the main controller calculates the current rotation speed and angle of the motor through the a-phase signal and the B-phase signal.
In this embodiment, in an actual application scenario, the main control readjusts the frequency and the duty ratio of the PWM signal according to the current rotation speed and angle of the motor, and then skips to perform step 203 and 205. This execution-feedback-adjustment step is repeated until the control motor is rotated to the target angle.
Steps 206 through 208 are the interaction flow of the master with the power adapter. Specifically, the method comprises the following steps:
at step 206, the power adapter configures identification line A7 pin low.
In this embodiment, when the interface is idle, the pin a7 is at a high level, and when the power adapter accesses the master control through the interface, the pin a7 of the active control identification line outputs a low level.
In step 207, when the master detects the falling edge of the pin a7, the control signal line a6 pin outputs a square wave signal with a specific frequency.
In this embodiment, there is a falling edge when the level of pin a7 changes from high to low on the master. When the master detects the falling edge, the pin of the control signal line a6 outputs a square wave signal with a specific frequency as a response.
And step 208, after the power adapter reads the square wave signal with the specific frequency on the pin A6, controlling a power line A2 to output charging voltage to charge the main-controlled lithium battery.
In this embodiment, after the power adapter reads the square wave signal with the specific frequency on the pin a6, the power adapter controls the power line a2 to output a charging voltage to charge the main-controlled lithium battery.
Step 209 is a step of communication between the master controller and the sensor, specifically:
in step 209, the master control and the sensor respectively realize the data transmission without distinguishing master-slave, half-duplex and synchronization by reading and/or writing the high level or the low level of the pin A3, the pin a10, and the pin a11 at different times.
In this embodiment, the master control is connected to the sensor through the interface. The master control and the sensor communication are not distinguished master and slave, and can be used as a sending end and a receiving end, the pin A3 of the state line, the pin A10 of the clock line and the pin A11 of the data line are all connected with pull-up resistors, and when an interface is idle, the level on the pins is high level.
The specific communication process is as follows: the initiator reads the level on pin A3, and when it is detected that the level is high, the initiator controls pin A3 to output a low level indicating that data is to be transmitted. The receiving end interrupts other operations after detecting that the pin A3 goes low, and controls the pin A10 to output low level as a response. After the level read by the transmitting terminal to the pin a10 is low, a clock signal is output on the pin a10, and bit data is output on the falling edge of the clock signal through the pin a 11. After the data transmission is completed, the pins A3, A10 and A11 are released, and the levels on the pins A3, A10 and A11 are restored to high level.
In the embodiment, if the electronic part is internally provided with a battery, the electronic part can supply power to the electronic part when the electronic part works, and if the electronic part is not provided with the internally provided battery, the electronic part can work by external power supply. In this embodiment, the main controller is provided with a rechargeable lithium battery, and the sensor and the motor are provided with a disposable battery.
In some alternative implementations of this embodiment, the sensor and the motor may have no built-in battery, and when they are connected to the master control through the above interface, the master control supplies a certain magnitude of voltage to them through the power lines a4 pin and a9 pin. The adoption of two pins for power supply can increase the transmission capability of current. As an example, 5 volts is supplied, and if 3.8 volts is required by the sensors and/or components inside the motor, the 5 volts needs to be converted to 3.8 volts.
In some optional implementations of this embodiment, in addition to controlling the power line a2 to output the charging voltage to charge the lithium battery of the master control, the power adapter also supplies power to the master control through the power lines a4 and a 9. The problems that the lithium battery supplies power to the outside and the charging efficiency is low while charging are avoided.
In some optional implementation manners of this embodiment, the robot further includes a second main control, which is similar to a dual-core computer, and the computing capability of the robot is improved. Of course, the robot may be configured with a plurality of masters, for example, 3 masters, 4 masters, etc., according to actual needs. In some application scenarios, the master of one robot may communicate with the master of another robot through the above-described interface.
In some optional implementations of this embodiment, the robot further comprises a hub, wherein the hub is configured to expand one interface into a plurality of interfaces. The concentrator can be connected with the concentrator, and the interface is continuously expanded, so that the problem that the interface on the electronic part is limited is solved. Each electronic part has a unique address, and the electronic parts communicate with each other through the unique address.
The master control is connected with a plurality of sensors and/or master control through the concentrator, specifically: the status line A3 pin of each electronic is connected to the status line of the hub, the clock line A10 pin of each electronic is connected to the clock line of the hub, and the data line A11 pin of each electronic is connected to the data line of the hub. The electronic parts communicate in a serial bus mode, the electronic part for sending data is called a sending end, other electronic parts are called receiving ends, the receiving ends receive the data sent by the sending end, then target addresses are analyzed, if the target addresses are consistent with the addresses of the receiving ends, the data are continuously processed, and if the target addresses are not consistent with the addresses of the receiving ends, the data are discarded. The sending end can finish sending all byte data at one time, and can also send data byte by byte at a certain time interval, so that the receiving end can process other tasks in a gap for receiving two bytes. Since the interaction flows of the sender and all receivers are the same, only the interaction sequence diagram of the sender and one receiver is shown here, as shown in fig. 3.
In step 301, the transmitting end turns off the bus interrupt mechanism, and decides whether the serial bus is idle according to the read levels on the pin A3 of the status line and the pin a10 of the clock line.
Whether the electronic device is used as a transmitting terminal or a receiving terminal, the electronic device is internally provided with a processor for processing different tasks such as instruction processing, data processing, operation execution and the like. By way of example, tasks that require master processing include, but are not limited to: receiving instructions sent by a mobile phone or a remote controller, controlling the rotation of each motor, and carrying out positioning and obstacle avoidance analysis and the like according to data collected by the sensors. When the receiving end processes other tasks and the transmitting end needs to transmit data to the receiving end, the receiving end can suspend processing other tasks by triggering the bus interrupt of the receiving end, and then receives the data on the serial bus. In order to prevent the task of triggering the bus interrupt of the sender to interrupt sending data when the sender sends data, the sender prepares to receive data, so the sender needs to close the bus interrupt mechanism of the sender before sending data through the serial bus.
At one moment, the serial bus can only support one sending end to send data. The states of the serial bus are divided into idle and occupied, and only in the idle state, the transmitting end can occupy the serial bus for transmitting data. In the idle state, the levels on the state line and the clock line are both high, and the level on the data line is low. The sending terminal continuously reads the levels on the pin A3 of the status line and the pin A10 of the clock line within a preset time until the levels on the status line and the clock line are both high levels, namely, the status of the arbitration serial bus is idle, and if the preset time is exceeded and the levels on the status line and the clock line are not both high levels, the status of the arbitration serial bus is occupied.
In some optional implementations, in order to reduce the probability that a plurality of terminals simultaneously determine that the state of the serial bus is idle and all occupy the serial bus to cause a transmission error, after the sending end determines that the state of the serial bus is idle for the first time, the pin A3 is controlled to output a low level first, after a random delay time, the pin A3 is controlled to output a high level, the state of the serial bus is determined again, and if the state of the serial bus is still idle, the state of the serial bus is determined to be idle.
Step 302, when the serial bus is idle, the sending end sends byte data byte by byte according to a preset time interval.
The sending end firstly generates all byte data to be transmitted, calculates the number of bytes, reduces the number by one after sending one byte data, and continues to send the next data after delaying a preset time interval. Wherein, the arrangement form of all byte data is as follows: the synchronization code (1 byte) + destination device address (1 byte) + source device address (1 byte) + length (1 byte) + xor check (1 byte) + data.
Step 303, the receiving end receives byte data sent by the sending end byte by byte. During the time interval between receiving two bytes of data, other tasks may be processed.
The specific process of respectively sending and receiving byte data by the sending end and the receiving end is as follows:
in step 3021, the transmitting end controls the pin A3 to output a low level, that is, the state line is set from a high level to a low level, and controls the pin a11 to output a high level. Wherein setting the level on the status line to a low level indicates that the serial bus is occupied.
Step 3031, the receiving end monitors the level on the state line in real time, and when the level on the state line is detected to be changed from high level to low level, the bus is triggered to be interrupted, and other tasks are suspended.
In step 3032, the receiving end reads the level on the status line, and after confirming that the level is low, controls the pin a11 of the data line to output high level as a response. Since the signal line of the serial bus has a higher priority of low, the data line will only appear high when all electronics on the serial bus control the pin a11 to output high.
In step 3022, the initiator reads the level on the data line and determines whether the level is high, i.e., all the initiators have output a high level on pin a11 as an acknowledgement. The transmitting end can continuously read the level on the data line within a preset time until the read level is a high level. If the preset time is exceeded and the level on the data line is still low, the bus needs to be released, i.e. the pin of the control state line A3 outputs high level, the pin of the control clock line A10 outputs high level, and the pin of the control data line A11 outputs low level. If the level on the data line is high, all the receiving terminals have already output a high on pin a11 as a response.
In step 3023, the transmitting end transmits bit data in the byte bit by bit through the pin a11 at the falling edge of the level on the clock line, and when transmitting the next bit data, it is ensured that a response signal that the receiving end returns to a high level on the clock line has been received.
Step 3033, the receiving end reads the bit data on the data line one by one when the level on the clock line is low, and controls the pin A10 to output high level as a response after reading each bit data.
In step 3024, when the sender determines that there is still unsent byte data, the sender controls pin a11 to output high, pin a10 to output low, and pin A3 to output high. The pin A10 of the control clock line outputs low level to continuously occupy the serial bus, the pin A3 of the control state line outputs high level to prepare for triggering bus interruption when the byte data is sent next time, in addition, the pin A11 of the control data line outputs high level to send the next byte data after delaying and waiting for a preset time interval, and the receiving end can process other tasks in the time interval. Step 3034, after the receiving end finishes reading one byte of data, the serial bus is released, and the bus interrupt mechanism is started, and the original suspended task or the new task with higher priority is processed continuously.
The specific process of respectively sending and receiving bit data by the sending end and the receiving end is as follows:
the pin A11 of the sending terminal is controlled to output bit data of 10 by high-low level, and the pin A10 of the clock line is controlled to output low level of 25 microseconds, namely, the level on the clock line is set to low level from high level, which indicates the falling edge of the level on the clock line, and the data is sent through the data line. The high and low levels on the clock line can also be understood as clock cycle signals, and the clock cycle signals are composed of high and low levels of 25 microseconds alternately, and of course, the clock cycle can be changed into other values. As an example, the above-mentioned 25 microseconds is replaced with 20 microseconds, 30 microseconds, 50 microseconds, or the like.
And the receiving terminal continuously detects whether the level on the clock line is low level within preset time, if so, the pin A10 of the clock line is controlled to output low level of 25 microseconds, bit data on the data line is read at the same time, and after 25 microseconds, the pin A10 of the clock line is controlled to output high level as response. If the level on the clock line is still high level when the preset time is exceeded, the error of the transmission bit data is indicated, and the serial bus needs to be released.
The transmitting terminal controls the pin of the clock line a10 to output a high level, and if the transmitted bit data is not the last bit of the byte data, the pin of the clock line a10 is kept outputting a high level for 25 microseconds. And continuously reading the level on the clock line within preset time, judging whether the level is high level, namely judging whether all receiving ends answer, if so, further judging whether the 8-bit data are completely sent, and if unsent bit data exist, repeatedly executing the steps for sending the next bit data. If the level on the clock line is still low level after the preset time, it indicates that part of the receiving ends do not respond, and the transmission bit data is in error, and the serial bus needs to be released.
And the receiving terminal continuously reads the level on the clock line within the preset time and judges whether the level is high level, namely judges whether other terminals on the serial bus respond, if the level is high level, further judges whether the receiving of 8-bit data is finished, and if bit data which is not received exists, the steps are repeatedly executed. If the level on the clock line is still low level after the preset time, the error of the transmission bit data is indicated, and the serial bus needs to be released.
And step 304, after the sending end judges that all byte data are sent, releasing the serial bus and starting a bus interrupt mechanism.
Whether the sending terminal or the receiving terminal is used, the releasing serial bus controls the pin A3 of the state line and the pin A10 of the clock line to output high level, and controls the pin A11 of the data line to output low level. In this embodiment, different electronic components communicate or charge through different pins of the interface, but the interface is unified, the connection mode is more flexible, and the concatenation is more random.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (8)

1. A robot based on an interface supporting interconnection of different electronic components, characterized in that said interface comprises 12 pins, of which a1 pin, is configured to be used as a ground; an A2 pin configured to act as a power cord for a power adapter; the device comprises an A3 pin, a multifunctional pin, a state line configured to be used as a sensor and/or a master control, and an identification line of a motor; an A4 pin configured to act as a power supply line; a pin A5, configured to transmit PWM signal for controlling the rotation speed and rotation angle of the motor; an a6 pin configured to serve as a signal line of a power adapter; an A7 pin configured to serve as an identification line for a power adapter; a pin A8 configured to control the direction of rotation of the motor; an A9 pin configured to act as a power supply line; the device comprises an A10 pin, a multifunctional pin, a clock line configured to be used as a sensor and/or a master control, and a motor quadrature encoder A phase signal line; the device comprises an A11 pin, a multifunctional pin, a data line configured to be used as a sensor and/or a master control, and a B-phase signal line of a motor quadrature encoder; an A12 pin configured to be used as a ground;
the robot includes electronics: master control, sensor, motor, power adapter, wherein, every electron all configures the interface, it is specific:
after the motor is accessed to the master control through the interface, controlling the pin A3 of the identification line to output a square wave signal with a preset frequency, reading the square wave signal with the preset frequency by the master control, and identifying the type of the motor corresponding to the square wave signal; the main control controls the rotating speed and the rotating angle of the motor by controlling the frequency and the duty ratio of a PWM signal output by an A5 pin, and controls the rotating direction of the motor by controlling a high level or a low level output by an A8 pin; in addition, the motor respectively outputs an A-phase signal and a B-phase signal through a pin A10 of a quadrature encoder A-phase signal line and a pin A11 of a quadrature encoder B-phase signal line; the master control calculates the current rotating speed and angle of the motor through the A-phase signal and the B-phase signal;
after the power adapter is connected to a master control through the interface, a pin A7 of the identification line is configured to be a low level, when the master control detects the falling edge of the level of the pin A7 of the identification line, the pin A6 of the signal line is controlled to output a square wave signal with a specific frequency, and after the power adapter reads the square wave signal with the specific frequency on the pin A6, the power adapter controls a power line A2 to output a charging voltage to charge the lithium battery of the master control;
the master control and the sensor are connected through the interface, and the master control and the sensor respectively realize data transmission without distinguishing master-slave, half-duplex and synchronization through high level or low level of a reading and/or writing state line A3 pin, a clock line A10 pin and a data line A11 pin at different times.
2. A robot based interface supporting interconnection of different electronic parts according to claim 1,
if no battery is arranged in the sensor, the sensor communicates with the master through a state line A3 pin, a clock line A10 pin and a data line A11 pin, and the master also supplies power to the sensor through a power line A4 pin and a9 pin.
3. A robot based interface supporting interconnection of different electronic parts according to claim 1,
if no battery is arranged in the motor, the motor is communicated with the main control through an identification line A3 pin, an A5 pin, an A8 pin, a quadrature encoder A phase signal line A10 pin and a quadrature encoder B phase signal line A11 pin, and the main control also supplies power to the motor through power lines A4 and A9 pins.
4. A robot based interface supporting interconnection of different electronic parts according to claim 1,
the power adapter is characterized in that the power adapter controls a power line A2 to output charging voltage to charge the lithium battery of the master control, and the power adapter also supplies power to the master control through power lines A4 and A9.
5. A robot based on an interface supporting interconnection of different electronic components according to claim 1, characterized in that the robot further comprises a second master, in particular:
the master control and the second master control are connected through the interface, and the master control and the second master control respectively realize data transmission without distinguishing master-slave, half-duplex and synchronization through reading and/or writing high level or low level of a state line A3 pin, a clock line A10 pin and a data line A11 pin at different times.
6. A robot based interface supporting interconnection of different electronic components according to any of claims 1-5, characterized in that it further comprises a hub, in particular:
the hub is configured to expand one interface into a plurality of interfaces, and the master is in communication with a plurality of sensors and/or masters through the hub, wherein an electronic part for transmitting data is called a transmitting end, and an electronic part for receiving data is called a receiving end.
7. A robot based interface supporting interconnection of different electronic components according to claim 6, wherein the master communicates with a plurality of sensors and/or masters through the hub, comprising:
the status line A3 pin of each electronic is connected to the status line of the hub, the clock line A10 pin of each electronic is connected to the clock line of the hub, and the data line A11 pin of each electronic is connected to the data line of the hub.
8. The robot based on the interface supporting interconnection of different electronic components according to claim 7, wherein the master is in communication with a plurality of sensors and/or masters through the hub, the electronic component transmitting data is called a transmitting end, and the electronic component receiving data is called a receiving end, further comprising:
the sending end closes a bus interrupt mechanism, judges whether the state of the bus is idle according to the read levels on a state line A3 pin and a clock line A10 pin, sends byte data byte by byte according to a preset time interval when the state of the bus is idle, releases a serial bus after sending all the byte data, and opens the bus interrupt mechanism, wherein the flow of sending each byte data is as follows: controlling the pin A3 of the status line to output low level, namely, the level on the status line is set from high level to low level, when the level on the data line is determined to be high level, that is, all receiving terminals have output high level at the pin A11 of the data line to respond, bit data in byte data is sent bit by bit at the flat falling edge of the clock line through the pin A11 of the data line, when next bit data is sent, the high level response signal returned by the receiving terminals at the clock line is ensured to be received, and when the unsent byte data is judged after sending each byte data, the pin A11 of the data line is controlled to output high level, the pin A10 of the clock line outputs low level, and the pin A3 of the status line outputs high level;
the receiving end is used for repeatedly executing the following steps: monitoring the level on the state line in real time, triggering bus interrupt when detecting that the level on the state line is changed from high level to low level, suspending processing other tasks, confirming that the level on the state line is low level, outputting high level at a pin A11 of the data line as a response, reading bit data on the data line one by one when the level on the clock line is low level, controlling a pin A10 of the clock line to output high level as a response after reading each bit data, releasing the serial bus after reading one byte of data, starting a bus interrupt mechanism, and processing other tasks.
CN201811480004.9A 2018-12-05 2018-12-05 Robot based on interface supporting interconnection of different electronic parts Active CN109531569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811480004.9A CN109531569B (en) 2018-12-05 2018-12-05 Robot based on interface supporting interconnection of different electronic parts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811480004.9A CN109531569B (en) 2018-12-05 2018-12-05 Robot based on interface supporting interconnection of different electronic parts

Publications (2)

Publication Number Publication Date
CN109531569A CN109531569A (en) 2019-03-29
CN109531569B true CN109531569B (en) 2021-08-31

Family

ID=65853722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811480004.9A Active CN109531569B (en) 2018-12-05 2018-12-05 Robot based on interface supporting interconnection of different electronic parts

Country Status (1)

Country Link
CN (1) CN109531569B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111775182B (en) * 2020-05-26 2022-04-29 安克创新科技股份有限公司 Method of detecting idle running, walking robot, and computer storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1305156A (en) * 2000-12-21 2001-07-25 孙吉平 Device for recognizing intelligent IC card with universal serial bus interface and its implementing method
US6857095B2 (en) * 1999-12-31 2005-02-15 Nokia Mobile Phones, Ltd. Method for making data transmission more effective and a data transmission protocol
CN1661505A (en) * 2004-12-28 2005-08-31 株洲时代集团公司 General multifunctional bus interface for vehicles
CN201210710Y (en) * 2008-06-23 2009-03-18 青岛海信宽带多媒体技术股份有限公司 Front-end plate interface of set-top box
KR20100057324A (en) * 2008-11-21 2010-05-31 김성태 Sata interface apparatus for connection external device with host computer
CN102236363A (en) * 2010-04-28 2011-11-09 上海华虹集成电路有限责任公司 Full-speed USB (Universal Serial Bus) equipment
CN107053172A (en) * 2016-12-27 2017-08-18 深圳市优必选科技有限公司 Steering wheel main board control circuit and robot
KR20180038388A (en) * 2016-10-06 2018-04-16 로베르트 보쉬 게엠베하 Control device, in particular control device for a motor vehicle

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6345072B1 (en) * 1999-02-22 2002-02-05 Integrated Telecom Express, Inc. Universal DSL link interface between a DSL digital controller and a DSL codec

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6857095B2 (en) * 1999-12-31 2005-02-15 Nokia Mobile Phones, Ltd. Method for making data transmission more effective and a data transmission protocol
CN1305156A (en) * 2000-12-21 2001-07-25 孙吉平 Device for recognizing intelligent IC card with universal serial bus interface and its implementing method
CN1661505A (en) * 2004-12-28 2005-08-31 株洲时代集团公司 General multifunctional bus interface for vehicles
CN201210710Y (en) * 2008-06-23 2009-03-18 青岛海信宽带多媒体技术股份有限公司 Front-end plate interface of set-top box
KR20100057324A (en) * 2008-11-21 2010-05-31 김성태 Sata interface apparatus for connection external device with host computer
CN102236363A (en) * 2010-04-28 2011-11-09 上海华虹集成电路有限责任公司 Full-speed USB (Universal Serial Bus) equipment
KR20180038388A (en) * 2016-10-06 2018-04-16 로베르트 보쉬 게엠베하 Control device, in particular control device for a motor vehicle
CN107053172A (en) * 2016-12-27 2017-08-18 深圳市优必选科技有限公司 Steering wheel main board control circuit and robot

Also Published As

Publication number Publication date
CN109531569A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
TWI541659B (en) Method and system for determining an arbitrary charging protocol in usb charging ports
CN107210615B (en) Fast charge method, mobile terminal and adapter
US10936524B2 (en) Bus system with slave devices
WO2017053012A1 (en) Identifying multiple identical devices on a shared bus
JP4906736B2 (en) Control and monitoring signal transmission system
US10850394B2 (en) Driving device
CN109531569B (en) Robot based on interface supporting interconnection of different electronic parts
CN109582616B (en) Communication system and method based on serial bus
WO2017160461A1 (en) Type-c factory and special operating mode support
CN105578031A (en) Image capturing accessory, image capturing apparatus and control method thereof
CN111698739B (en) Communication device and communication system
CN106877462B (en) A kind of method and charger detecting charged state
JP2004088208A (en) Data transmission system and method therefor
JPH08129199A (en) Camera body, camera accessory and camera system
CN112462661B (en) Industrial data acquisition controller and control method thereof
CN111666215A (en) Desktop cluster hardware platform for distributed algorithm testing and human-computer interaction research
US20030065848A1 (en) Transmission method and apparatus utilizing a two-line bus shared for power supply and data transmission
CN210210408U (en) Robot body control system and robot
CN109855746B (en) Temperature value transmission device and method thereof
CN109571475A (en) A kind of power Tactile control system and robot
US7333730B2 (en) Method and system for controlling steering devices using infrared signals
CN111420277A (en) Implantable neurostimulation device
KR20200100437A (en) Development board for disable person
CN214412730U (en) Motor driver with infrared communication function
JP7282018B2 (en) battery checker adapter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20191203

Address after: Room d1203, floor 11, building D, No. 9, Shangdi Third Street, Haidian District, Beijing 100036

Applicant after: BEIJING AIQI TECHNOLOGY CO., LTD.

Address before: 050000 No. 501, Unit 3, Building No. 18, Chaoxia Street, Xinhua District, Shijiazhuang City, Hebei Province

Applicant before: Zhang Yang

Applicant before: Zhang Hu

GR01 Patent grant
GR01 Patent grant