
Challenge Develop and implement field-oriented controller software for sensorless brushless DC motors for use in dental drills
Solution Use Model-Based Design with Simulink, Stateflow, and Embedded Coder to model the controller and plant, run closed-loop simulations, generate production code, and streamline unit testing
Results
| ![]() Sensorless brushless DC (BLDC) motors are well-suited for use in dental drills. They operate with less abrasion than brushed motors, and are more reliable, quieter, and easier to maintain and sterilize. Compared with BLDC motors with sensors, sensorless BLDC motors are less expensive and more compact. However, the complex algorithms needed for sensorless control require much more engineering effort to develop. ITK Engineering saved time and effort by using Model-Based Design to develop and implement a production BLDC motor controller compliant with the IEC 62304 standard for medical device software. “Model-Based Design with Simulink enabled us to design and optimize the controller even before the motor hardware was available for testing and then generate production code for the controller once we had the motor,” says Dr. Michael Schwarz, senior engineer for medical control systems at ITK. “It would have been impossible to complete this project on schedule if we had written the code by hand.” ChallengeDental drill motors operate at speeds up to 40,000 RPM. The field-oriented control algorithm for such motors needs precise information about the rotor position over a wide speed range. In a sensorless motor, rotor position must be deduced from changes in current in the stator caused by electromagnetic induction from the rotor magnet. ITK engineers needed to design and optimize a rotor position estimator, as well as a sophisticated cascade control for the dental drill motor that would comply with the IEC 62304 standard for medical device software. When the project began, a prototype motor was unavailable. To meet their client’s project deadline, ITK had to develop the controller software in parallel with the motor hardware. ITK engineers needed to create an accurate model of the motor and develop a controller that worked with this model. Once the motor was available, they needed to rapidly implement and test their control software on an embedded processor. SolutionITK engineers designed, optimized, implemented, and tested the sensorless BLDC motor controller with Model-Based Design. Working from data sheets for existing motors and information provided by their client, the engineers modeled the BLDC motor, including its electrical and mechanical components, in Simulink®. They developed a controller model in Simulink, and used Stateflow® to model startup, shutdown, and error modes, as well as user-selectable operating modes. The team ran closed-loop simulations of the plant model and the initial controller model, which relied on a rotor position signal supplied by the plant model. To develop the rotor position estimator, the team used Symbolic Math Toolbox™ to solve algebraic equations, and then refined the estimator until its results matched the actual rotor position signal from the plant model. Using the automatic scaling and data type override capabilities of Fixed-Point Designer™, the engineers converted their floating-point controller design to fixed point. They reran simulations to verify the fixed-point model. The team developed MATLAB® scripts that performed batch unit testing of individual model components. They produced model coverage reports for these tests using Simulink Coverage™. The team generated more than 5000 lines of C code from their controller model with Embedded Coder®. They compiled the code for an ARM® Cortex®-M3 processor with a Keil compiler. The engineers tested the controller on a prototype board and motor, refining the model and re-generating code several times to optimize performance. ITK delivered Simulink models of the controller and the plant to its client, together with the generated production code. The controller and sensorless BLDC motor are currently in series production in dental drills. Results
|