Background and Motivation
Initially, we depended on the pre-installed Electronic Speed Controllers (ESCs) that accompanied our platooning demonstrator, which uses small hobby RC cars, in our continuous efforts to develop and improve its performance. By using a PWM signal, these ESCs interfaced with the motors of the automobiles, therefore enabling fundamental control. They did, however, have major drawbacks, including unstable speed control and little ESC feedback. These shortcomings drove us to create a custom motor controller fit for our particular needs.
Issues with Current ESCs
The main problems with the pre-installed ESCs consisted in:
The lack of input on motor speed or error states by the ESCs complicated the diagnosis of problems like overcurrent protection, which only signaled faults by a flashing LED.
The speed control was erratic, changing as the battery voltage changed. For our scenario, where keeping a consistent speed was very vital, this inconsistency was unacceptable.
Post-crash resets necessary human power cycling of the ESCs, therefore compromising the efficiency and automation of our system.
Custom BLDC Motorcontroller Design
We started building our own ESC with the following main characteristics in order to solve these difficulties:
Closed-loop speed control: capability of autonomous motor speed regulation.
Facilitates real-time feedback and control across a serial interface in bi-directional communication.
Errors are automatically detected, reported, and resolved under Error Reporting and Handling.
Optionally regulates the automobiles’ steering servo in line with their compatibility with Steering Control.
Technical Methodical Approach
Software
We made use of the SimpleFOC library, well-known for strong BLDC motor control capacity. SimpleFOC uses field-oriented control (FOC) techniques to enable speed, angle, and torque, among other control modes. To keep exact control over the motor, this library interacts with sensors such rotary encoders and hall sensors.
Hardware
The worldwide semiconductor shortage limited our hardware choices, hence we decided on the Trinamic TMC6140 IC, which offers necessary functions including current monitoring and short circuit detection even with availability issues. For its processing capability and availability, we matched this with an STM32 microcontroller programmable via the Arduino framework.
Development Process
We prototyped the controller on breadboards using development boards for the TMC6140 and STM32, therefore iteratively improving the setup.
From breadboards to a bespoke PCB, we used KiCAD for design using thorough grounding and power distribution techniques to help to reduce voltage spikes.
Following hardware validation, we created a ROS2 node to include the motor controller into our current software environment, therefore allowing flawless control and feedback within the platooning demonstrator.
conclusions and results
By means of iterative design and thorough testing, we effectively created a bespoke BLDC motor controller fulfilling our particular requirements. This new controller greatly improved the dependability and performance of our platooning demonstration by offering consistent speed control, extensive feedback systems, and strong error handling.
We intend to support the efforts of the larger community in creating sophisticated motor control systems by publicly publishing our hardware designs and software. This project emphasizes the need of open-source cooperation as well as tailored solutions in handling certain technical difficulties.