Implement Remote UART Bus protocol (Gen 2 compatible)#587
Conversation
|
@AILIFE-4798 seems like there is an error: |
|
fixed error |
|
run build again |
|
It is imposibly hard to study the actual code changes in your merge request, as you have changed so much of the formating in the original code you forked that the compare comes up with 3,237 additions and 2,274 deletions. That being said, I absolutely love the posibility to have that bus protocol implemented in this code. My advice is probably to revise your code with the formating of the original repo, so that the compare only shows your actual code, and not 2000+ false aditions/deletions because of format changes. Another thing that would be great for the comunity is if you could add a simple arduino (esp32) sketch like the one for the regular serial control, but that uses this protocol. BTW: i see the protocol implements the odometry posibility from RoboDurdens projects. Is this implemented and working in this commit? I was currently working on a commit to implement that part from hes code in this original repo recently, but has not had time to finish that yet. Best wishes for this being merged, i totally look forward to it. Robert |
|
@AILIFE-4798 I agreee with the last comment, is for you a big effort to revert the files and only include the actual lines of code that were changed/added? |
This PR implements the Remote UART Bus protocol for the Gen 1 FOC hoverboard firmware, allowing it to seamlessly communicate on the same bus as Gen 2 devices.
Why this is the best protocol on the market: Unlike other protocols (like standard UART or PWM) which are typically limited to point-to-point communication or addressing only 2 boards (Slave/Master), the Remote UART Bus protocol supports addressing up to 256 individual boards on a single bus. This scalability makes it the superior choice for complex robotics projects, multi-axis machines, and fleet management where many motors need to be coordinated simultaneously without a web of point-to-point wires.
Key Changes:
Protocol Standardization:
Aligns fully with the Gen 2 reference implementation.
Uses Little-Endian byte order for all multi-byte fields (native ARM format).
Standardizes telemetry units to 0.01V and 0.01A (Centi-units) for higher precision and compatibility.
Robust Communication:
Implements a Request-Response telemetry mechanism (Master Polls -> Slave Responds) to prevent bus collisions.
Uses CRC-16 CCITT (0x1021) for reliable error checking.
Configurable & Dual-Slave Support:
Each board can be assigned a unique SLAVE_ID.
Single-board dual-motor control is supported via SLAVE_ID (Left) and SLAVE_ID + 1 (Right).
Enabled via VARIANT_REMOTE_UART_BUS in config.h.
Documentation: Full protocol specification can be found here: PROTOCOL.md.
Verification:
Verified against the Gen 2 GD32 Reference Implementation.
Compiled successfully for Gen 1 FOC hardware (make VARIANT=VARIANT_REMOTE_UART_BUS).
Validated with the updated Online Testing Tool.
Result is AI-Generated, please review carefully.