From Model to Embedded Implementation: Experimental Validation of PI and Takagi-Sugeno BLDC Speed Controllers for Electric Micromobility
Mohamed Krichi, Mhamed Fannakh, Abdullah Noman, Tarik Raffak, Sulaiman Almutairi, Abdullah AlharbiSpeed controllers for electric micromobility (EMM) drives are increasingly developed with Model-Based Design and deployed as automatically generated code, yet the cost that a given control law actually imposes on the target, and the mechanism by which competing laws differ once deployed, are seldom reported. This paper addresses both questions on an EMM-class test bench built around a 36 V, 250 W in-wheel BLDC motor. A proportional-integral (PI) regulator and a first-order Takagi-Sugeno (TS) fuzzy regulator are specified in Simulink, auto-coded to ANSI-C by Embedded Coder, and deployed unchanged on an STM32F446RE target driving a custom three-phase inverter through six-step Hall commutation. Over a six-step, 180 s duty cycle reaching 21.1 km/h, the two regulators are shown to occupy opposite ends of the speed-versus-damping trade-off. On the 30 to 100 RPM ascending step under load, the PI reaches the set-point in 0.4±0.1 s with 21.6% overshoot and the TS in 2.7±0.1 s with 1.5% overshoot, both quoted at the resolution of the 10 Hz acquisition, and over the complete duty cycle, a window that also contains segments on which neither regulator has control authority, the TS lowers the tracking RMSE by 9.4%. A structural analysis of the deployed firmware excludes the realisation form as the cause. The positional and incremental forms are algebraically equivalent while the command is unsaturated, which is the regime of the step above. Under saturation, the incremental accumulator of the TS is not clamped and winds up exactly as the positional PI integrator does. The two loops are also shown to share the same unfiltered speed feedback and the same command saturation limits. The difference is traced instead to the effective gains realised by the seven consequents. Far from the set-point, the TS applies an integral gain three to twelve times weaker than the PI for a comparable proportional gain. A fixed-gain PI in that range is predicted to reproduce the response for one eighth of the Flash. The embedded cost of both regulators is then quantified on the target from the linker map, the fuzzy controller occupying 2325 Bytes of Flash against 266 Bytes for the PI, a factor of 8.7, and 200 Bytes of stack against 32 Bytes, a factor of 6.3, rising to 248 Bytes against 32 Bytes when the complete call tree is counted, for 0.45% of the available Flash. The complete platform, comprising the inverter, the Hall front end, the auto-generated firmware, and a Python supervisory interface, is described together with its deployed timing, PWM, and saturation parameters.