DEMCON engineers used Model-Based Design for signal processing, algorithm development, and implementation.
Working in Simulink, the team developed a floating-point model of a proportional integral (PI) controller for a phased-lock loop. This model includes a sine-wave generator to generate the excitation signal for the piezo drive as well as IQ demodulators for the measured voltage and current. The model derives the phase difference between the outputs of the two demodulators and maintains this phase difference at a specific set point.
Recognizing that the dynamics of the actuator would be difficult to model accurately, the team opted to model the plant as a linear system.
They created the plant model in MATLAB® and Simulink, and ran closed-loop simulations of the controller and plant to verify proper locking behavior of the PLL in the presence of noise and to check that it maintained lock for various set points.
At the outset of the project they planned to target a small FPGA. To reduce the amount of programmable logic resource capacity that would be consumed, they converted the Simulink controller model to fixed point.
Once the team had verified the functionality of their initial controller design via simulation, they used HDL Coder to generate synthesizable HDL code from the fixed-point Simulink model.
They deployed the generated code to an FPGA development board to interactively test their control algorithm as it ran on real-time hardware. Using this setup, the team could control design parameters within the FPGA’s programmable logic by changing register values, and get instantaneous feedback on how different parameter values affected controller performance.
As work on the design progressed, the team determined that the FPGA they had chosen had an insufficient number of pins to meet their requirements. They selected a larger FPGA with more pins. Because the larger FPGA also had more logic cells and DSP slices, they had more programmable logic available for their controller.
The DEMCON team decided to take advantage of the additional logic by producing a single-precision floating-point implementation of the controller using the native floating-point capability of HDL Coder. A floating-point implementation gave them more flexibility to tune the controller during testing.
The team experimented with different cutting and drilling instruments on a variety of tissues to verify the prototype’s operation under a range of real-world damping and load conditions. They further improved cutting performance by refining PI controller parameters based on feedback provided by surgeons in subsequent hands-on tests.
Throughout development, DEMCON engineers followed a process that complied with the IEC 62304 standard for medical device software, even though compliance is not formally required for FPGA implementations. As part of this effort, the team used their Simulink model and simulations as a basis for developing unit tests and documentation that mapped to software development process requirements highlighted in IEC 62304.
DEMCON engineers are integrating the controller with the electronics and other hardware as they prepare for tests of the final hardware design.