AnsweredAssumed Answered

[嵌入式linux] 两个相同产品间的并机设计

Question asked by julian cheng on Mar 25, 2019
Latest reply on Mar 27, 2019 by TomE

MCU parallel strategy design
Three methods are used:
1. Automatically access the new slave at any time, the power is also automatically added, the master can allow the slave to open the strong after the slave is integrated into the system.
2. After the first power-on of the master, it starts a timer count value. At this time, it allows automatic access to the new slave. After N seconds, the new slave is no longer allowed. At this time, the slave is allowed to open the command to enable the slave. Wait for M seconds, report the current power (or total capacity) to the PCS, and then re-access the new slave automatically.
3. Automatically access the new slave at any time, the power is also automatically added. The master can allow the slave to open the power after the slave is merged into the system. After waiting for M seconds, the current power (or total capacity) is reported to the PCS.
Currently only consider the case where the parallel is not enabled:
Currently only consider the case of parallel enablement:
The first scheme is designed in detail:
1, parallel negotiation
1.1, master negotiation:
1. After the package is powered on, read the parallel enable bit and the current PACK_ID value to confirm whether the machine is used as the master or the slave (assuming the machine is master and power on)
2. The active periodic (period 1S) sends a "discovery message" (broadcast message). The purpose is to find out whether there is a message that has not been incorporated into the system. The slave that has been incorporated into the system does not respond to the message. );
3. Receive the "discovery response message" of the slave (unicast message carrying the pack_id and Sn of the slave), and the master compares the pack_id and Sn with the pack_id and Sn of the local record:
a. If the received pack_id is 000b (the ID value is the master ID), there is another master outside the machine.
  At this time, the message "Disable the system to open strong power" (broadcast message, send 3 times, do not receive the response) is sent.
And actively send an alarm message to the PCS to inform the user to handle
     b. If there is already a pack_id or Sn in the local, send a message "Prohibit the slave to be incorporated into the system" (unicast message), which has been incorporated into the slave of the system, does not respond to the command, and reports the alarm message to the PCS ( There is a slave with the same pack id or Sn, try to merge into the system)
     c. If the pack_id and Sn have not been recorded locally, proceed to step 4
4. Send a message "Allow slave to be merged into the system" (unicast message, send 3 times), wait for the slave to receive
Response message into the system
5. Within N seconds, if the parallel response message of the slave is received, the normal workflow is entered. If it is not received, the message “Stop the slave to be incorporated into the system” is sent (unicast message, sent 3 times)
6, enter the next task state
1.2, slave negotiation:
1. Waiting to receive the discovery message of the master, and after receiving the message, send a "discovery response message" (unicast message, sent 3 times) carrying the packet_id and Sn to the PCS.
2. Waiting for the receiver to access the system. If the packet is not received within N seconds, the device will re-enter the initial state (unnegotiated state). If the packet is received:
      a, does not allow the slave to be incorporated into the system, then the slave re-enters the initial state (unnegotiated state) after M seconds of silence.
      b. Allow the slave to be merged into the system, then send a parallel response message (unicast message, sent 3 times) to the PCS.
         Slave enters the next task state
2. Charge and discharge management (this part is handled according to Shen Zhengbin's plan)
2.1, master
1. Periodically send a message that reads the slave voltage.
2. Within N seconds (the specified number of times), the slave does not receive the voltage response message of the slave, reports the PCS power down (or down capacity) message, and then sends a message (single message) that kicks the slave outbound system. Send 3 times), delete the local record slave message
3. The other status messages of the slave are also sent periodically, according to the response mode of the master-slave communication.
2.2, slave
1. After receiving the message that the matser allows the strong power output, it performs the charge and discharge self-test. After the self-test is OK and the power is turned on, it sends back a message with a strong power to the master (unicast message, sent 3 times). If the self-test is not OK, a message that fails the strong power transmission is sent to the master (unicast message, sent 3 times)
2, other commands are treated in the same way
3. If the unit needs to turn off the high-power output due to a fault or other reasons, send a fault alarm and a strong power message to the master (unicast message, send 3 times).
3, system shutdown processing
3.1, master
1. The master first turns off the strong electric output, and sends a message that closes all the slave's strong electric output (broadcast message, send
3 times)
2. Turn off the single slave power output operation: send a message that closes the slave's strong power output (unicast message, send
3 times),
3.2, slave
1. Receive a message that turns off all slave strong power outputs, then immediately turn off the strong power output.
2. After receiving the message that the master turns off the slave's strong power output, it immediately turns off the strong power output and sends a response message that closes the strong power output (unicast message, sent 3 times)
3. If no master packet (heartbeat packet or read data packet) is received within M seconds, the slave will automatically report a message that the slave withdraws from the system (unicast packet, sent 3 times), after a delay of K seconds. Turn off the strong output
4, heartbeat message processing
The purpose of the message is to let the host know that the slave still exists in the system, and can perform some operations on the slave (this part may not exist, but the master obtains the slave information to process)
4.1, master
1. Periodically send a heartbeat message
2. If the heartbeat response packet of the slave is not received in the N period, the PCS is reported to reduce power (or derate), and a packet is sent out of the parallel system (unicast packet, sent 3 times), and deleted. Slave information recorded by this machine
4.2, slave
1. If the heartbeat message of the master is not received in the M period, the strong power output is turned off and reported to the master.
Packet (unicast message, sent 3 times), and enters the initial state
2. Upon receiving the master heartbeat message, it immediately returns a heartbeat response message.
The second scheme is designed in detail:
1, parallel negotiation
1.1, master negotiation:
1. After the package is powered on, read the parallel enable bit and the current PACK_ID value to confirm whether the machine is used as the master or the slave;
2. After confirming that the machine is master, record the current count value Last_Ticks (no power is allowed)
3. An active periodic (period 1S) sends a "discovery message" (broadcast message). Purpose: for discovery
Whether there is a message that is not incorporated into the system, the slave that has been incorporated into the system does not respond to the message);
4. Receive the "discovery response message" of the slave (unicast message, carrying the pack_id and Sn of the slave), master
Compare pack_id and Sn with the locally recorded pack_id and Sn:
b. If the received pack_id is 000b (the ID value is master ID), there is another master outside the machine.
  At this time, the message "Disable the system to open strong power" (broadcast message, send 3 times, do not receive the response) is sent.
And actively send an alarm message to the PCS to inform the user to handle
     b. If there is already a pack_id or Sn in the local, send a message "Prohibit the slave to be incorporated into the system" (unicast message), which has been incorporated into the slave of the system, does not respond to the command, and reports the alarm message to the PCS ( There is a slave with the same pack id or Sn, try to merge into the system)
     c. If the pack_id and Sn have not been recorded locally, proceed to step 4
5. Send a message "Allow slave to be incorporated into the system" (unicast message, send 3 times), wait for the slave to receive
Response message into the system
6. Within N seconds, after receiving the parallel response message of the slave, it enters the normal workflow. If it is not received, it sends the message “Stop the slave to the system” (unicast message, send 3 times)
7. Read the current count value Cur_Ticks. If Cur_Ticks -Last_Ticks > M seconds, exit the task and enter
Next task, otherwise continue to search if there is a new slave to access
1.2, slave negotiation:
1. Waiting to receive the discovery message of the master, and after receiving the message, send a "discovery response message" (unicast message, sent 3 times) carrying the packet_id and Sn to the PCS.
2. Waiting for the receiver to access the system. If the packet is not received within N seconds, the device will re-enter the initial state (unnegotiated state). If the packet is received:
      a, does not allow the slave to be incorporated into the system, then the slave re-enters the initial state (unnegotiated state) after M seconds of silence.
      B. Allow the slave to be merged into the system, and then send a parallel response message (unicast message, sent 3 times) to the PCS.
         Slave enters the next task state
2, get the slave voltage
2.1, master
1. When entering the task, record the local count value Last_Ticks and periodically send the message reading the slave voltage.
2. In the N seconds (the specified number of times), the slave does not receive the voltage response message of the slave, and sends a message (the unicast message, sent 3 times) that kicks the slave out of the parallel system, and deletes the slave message of the local record.
3. After receiving the voltage message of the slave, record it.
4. Read the current Cur_Ticks value, if Cur_Ticks -Last_Ticks > M seconds or read all the merged systems
The slave's voltage message enters the next task, otherwise it continues to read the slave voltage report that has not yet been obtained.
Text information
2.2, slave
1. Waiting for the message of the master to read the voltage information, if the message is not obtained within 2*N seconds, send a message
The machine exits the packet of the parallel system to the master (unicast message, sent 3 times), and returns to the initial state.
2. Receive the message of the master's read voltage information, and report the voltage information of the local device to the master (unicast message, send 3 times)
3, open strong electricity processing
3.1, master
1. The master sends a strong message to the slave that meets the strong power (unicast message, sent 3 times)
2. The response message of the slave's strong power-on success is not received within N seconds, indicating that the strong power failure fails, then the kick-off slave is sent.
Message (unicast message, sent 3 times)
3. After M seconds, report the maximum power (or maximum capacity) that PCS can currently output.
3.2, slave
1. If the master does not receive the strong power command within 2*N seconds, report the message that the master exits the parallel system and enter.
To the initial state
2. After receiving the master's power-on command, it is self-checking whether the machine is allowed to open strong power. If it is allowed to open strong power, it will open a strong power and send a strong response message to the master. Otherwise, the transmission of strong power is unsuccessful. Response message (unicast
The message is sent 3 times. The fault message is not sent by the local office. The fault information is actively read by the master.
3. If the unit needs to turn off the high-power output due to a fault or other reasons, urgently send a fault alarm and a strong power message to the master (unicast message, send 3 times)
4. Charge and discharge management (this part is handled according to Shen Zhengbin's plan)
4.1, master
1. Periodically send a message that reads the slave voltage.
2. Within N seconds (the specified number of times), the slave does not receive the voltage response message of the slave, reports the PCS power down (or down capacity) message, and then sends a message (single message) that kicks the slave outbound system. Send 3 times), delete the local record slave message
3. The other status messages of the slave are also sent periodically, according to the response mode of the master-slave communication.
4.2, slave
1. After receiving the message that the matser allows the strong power output, it performs the charge and discharge self-test. After the self-test is OK and the power is turned on, it sends back a message with a strong power to the master (unicast message, sent 3 times). If the self-test is not OK, a message that fails the strong power transmission is sent to the master (unicast message, sent 3 times)
2, other commands are treated in the same way
3. If the unit needs to turn off the high-power output due to a fault or other reasons, send a fault alarm and a strong power message to the master (unicast message, send 3 times).
5, system shutdown processing
5.1, master
1. The master first turns off the strong electric output, and sends a message that closes all the slave's strong electric output (broadcast message, send
3 times)
2. Turn off the single slave power output operation: send a message that closes the slave's strong power output (unicast message, send
3 times),
5.2, slave
1. Receive a message that turns off all slave strong power outputs, then immediately turn off the strong power output.
2. After receiving the message that the master turns off the slave's strong power output, it immediately turns off the strong power output and sends a response message that closes the strong power output (unicast message, sent 3 times)
3. If no master packet (heartbeat packet or read data packet) is received within M seconds, the slave will automatically report a message that the slave withdraws from the system (unicast packet, sent 3 times), after a delay of K seconds. Turn off the strong output
6, heartbeat message processing
The purpose of the message is to let the host know that the slave still exists in the system, and can perform some operations on the slave (this part may not exist, but the master obtains the slave information to process)
6.1, master
1, periodic hair

【PCB Prototype】,China PCB Prototype, PCB Prototyping, Fabrication Manufacturer - PCBIndex.com 

Outcomes