🛠 Distributed Multi-Motor Control via CAN FD on BeagleConnect QuadESC

BeagleConnect QuadESC: 4-Channel BLDC Controller · avance · Configurez un réseau CAN FD pour piloter quatre moteurs BLDC en temps réel avec le SDK TI AM13E2X.

Objectives

This advanced tutorial aims to implement a distributed control architecture where the BeagleConnect QuadESC acts as an intelligent power node. We will configure the CAN FD bus to receive torque commands for four motors simultaneously while sending telemetry (current, temperature) to a central controller. The focus is on handling hardware interrupts and configuring TI AM13E23019 registers to ensure minimal latency.

Required Hardware

Steps

  1. Environment Setup: Ensure the TI AM13E2X SDK is correctly configured. Compile the base can_fd_loopback project to validate the build chain.
  1. DRV8323S Driver Configuration: Modify the peripheral configuration file to enable the appropriate switching mode. The CSD88599Q5DC half-bridges require precise dead-time. Use the following command to generate hardware configuration files:
ti-sdk-am13e2x/tools/sysconfig/bin/sysconfig_cli --project ./quadesc_hw_config.syscfg
  1. CAN FD Initialization: In the application code, configure the CAN controller for FD (Flexible Data-rate) mode. Set a bitrate of 5 Mbit/s for the arbitration phase and 2 Mbit/s for the data phase. Allocate reception buffers for specific motor IDs (e.g., ID 0x101 to 0x104).
  1. Real-Time Control Loop: Implement an ISR (Interrupt Service Routine) triggered by the PWM timer. This ISR reads received CAN frames, applies the control law (e.g., PI) on currents measured via the 12 ADC channels, and updates PWM registers for the 4 three-phase outputs. Use specific Cortex-M33 instructions to optimize mathematical calculations.
  1. Battery Protection: Add a periodic check of the input voltage (9-25.2V). If the voltage drops below a critical threshold, force the drivers to shut down via the nEN_GATE pins.

Verification

Connect the CAN FD interface. Send torque command frames. Monitor motor output signals with an oscilloscope to verify Pulse Width Modulation (PWM). Ensure telemetry frames are sent at 1 kHz without packet loss.

Further Reading

Explore using the TinyEngine accelerator to implement Model Predictive Control (MPC) algorithms directly on the board, reducing dependency on the central controller.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials