Ather Energy used Model-Based Design with MATLAB and Simulink to model and simulate the 450 and to generate production code for the control software.
They began by building a plant model of the scooter and its main components. Vehicle dynamics and mechanical components were modeled directly in Simulink using first principles. The power converter and electrical circuitry were modeled using Simscape™ and Simscape Electrical™.
In the absence of detailed component data, the team took an empirical approach to modeling the battery cells. They tested the battery at various temperatures and state-of-charge levels, and used the measured input-output data with System Identification Toolbox™ to create a black-box model of the cell’s electrical and thermal characteristics.
The team conducted extensive simulations of the plant model to evaluate design tradeoffs. They refined the design until they had identified a motor and battery configuration that met the target acceleration and range requirements while satisfying cost, size, and temperature constraints.
Next, they developed algorithms for battery charging, power control, and temperature control in Simulink. They modeled the control logic in Stateflow® and used Control System Toolbox™ to tune controller gains. They ran closed-loop simulations with the plant model to validate their control design. They generated code from the controller model with Embedded Coder® and deployed it either to an ARM® Cortex® processor on the scooter or to a TI C2000™ microcontroller in the charging stations.
Using an agile and iterative development process, they rapidly debugged and refined the algorithms, sometimes generating and testing new code up to five times a day.
Because this was their first experience with code generation, Shivaram first attended a two-day public training session on code generation with Embedded Coder conducted by MathWorks engineers, and then engaged MathWorks Consulting Services for further training on production code generation, model review, and process review.
The Ather 450 is now in production, with an initial release in Bengaluru as well as 31 charging stations and 7 stations in Chennai. Ather’s founders, who learned MATLAB at IIT Madras, where they launched the company, will soon be opening pre-orders in their next market.