{"id":19130035,"url":"https://github.com/mathworks/pmsm-drive-optimization","last_synced_at":"2026-03-03T04:09:37.950Z","repository":{"id":92436479,"uuid":"446396517","full_name":"mathworks/pmsm-drive-optimization","owner":"mathworks","description":"Motor Efficiency Improvements With Optimized Control Parameters","archived":false,"fork":false,"pushed_at":"2023-12-22T17:51:13.000Z","size":2415,"stargazers_count":22,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-11-13T04:02:59.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-10T11:31:20.000Z","updated_at":"2025-10-29T08:59:57.000Z","dependencies_parsed_at":"2024-01-13T11:55:34.520Z","dependency_job_id":"6cf629c2-cc62-41e7-b5ab-91e6a29bdc6d","html_url":"https://github.com/mathworks/pmsm-drive-optimization","commit_stats":{"total_commits":7,"total_committers":4,"mean_commits":1.75,"dds":0.4285714285714286,"last_synced_commit":"ac3af93bc75de2699a3bc5a278faaf28e8824722"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mathworks/pmsm-drive-optimization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fpmsm-drive-optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fpmsm-drive-optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fpmsm-drive-optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fpmsm-drive-optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathworks","download_url":"https://codeload.github.com/mathworks/pmsm-drive-optimization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fpmsm-drive-optimization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30031981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T03:27:35.548Z","status":"ssl_error","status_checked_at":"2026-03-03T03:27:09.213Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T06:09:21.256Z","updated_at":"2026-03-03T04:09:37.926Z","avatar_url":"https://github.com/mathworks.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Motor Efficiency Improvements With Optimized Control Parameters**\n\n[![View Motor Efficiency Improvements With Tuned Control Parameters on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/104840-motor-efficiency-improvements-with-tuned-control-parameters) [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=mathworks/pmsm-drive-optimization)\n\n## Overview\nPMSM drive using imported FEM data and optimized Field-Oriented Control (FOC), with supporting design scripts that:\n1.\tDetermine open-loop frequency response and check stability margins. This requires Simulink® Control Design™, using the Frequency Response Estimator block.\n2.\tDetermine the optimal d-axis and q-axis currents that minimize overall motor losses when delivering a commanded torque and speed.\n\nThe Electric Drive is implemented using:\n1.\tA detailed Simscape™ Electrical™ nonlinear motor model in the form of tabulated flux linkages and Steinmetz coefficients. For more information, see [this example](https://www.mathworks.com/help/sps/ug/import-ipmsm-flux-linkage-data-from-motor-cad.html). \n2.\tA Field-Oriented Controller (FOC) that has been optimized to minimize motor losses.\n\n### **Drive System**\nThe drive is parameterized for a 70 kW (maximum power), 150 Nm (maximum torque) motor, suitable for an electric vehicle powertrain. The supply is a 500 V DC source.\n\n![](overview/html/pmsm_foc_drive_optimization_01.png)\n\n### **Field-Oriented Controller Architecture**\nThe PMSM Field-Oriented Controller subsystem has an outer loop of speed control, and an inner loop of current control. The outer loop determines the current references for the inner loop.\n\n![](overview/html/pmsm_foc_drive_optimization_03.png)\n\n### **Motor Loss Map**\nThe motor losses depend on d-axis and q-axis currents, and rotor speed. Motor losses are a combination of copper losses and iron losses.\n\n![](overview/html/pmsm_foc_drive_optimization_08.png)\n\n### **Optimal Field Currents**\nThe *ControllerOptimization.mlx* Live Script computes the optimal d-axis and q-axis current references that minimize motor losses, in function of rotor speed and reference torque.\n\n![](overview/html/pmsm_foc_drive_optimization_10.png)\n\n### **Optimization Validation**\n\n![](overview/html/pmsm_foc_drive_optimization_11.png)\n\n### **Power Losses for Step Load**\nThe test scenario is a reference speed of 3000 rpm and a torque load stepped from 0 Nm to 50 Nm at t=0.1s.\n\n![](overview/html/pmsm_foc_drive_optimization_15.png)\n\nYou can notice the lower motor losses when using optimized control parameters.\n\n## Setup \nOpen the project file *PmsmDriveOptimization.prj* to get started.\n- Run *workflows/ControllerOptimization.mlx* to compute the optimal control parameters.\n- Run *workflows/FreqResponseAnalysis.mlx* to check the control system stability margins. This is computationally intensive.\n\n### MathWorks Products (https://www.mathworks.com)\nRequires MATLAB® release R2021b or newer.\n- [Simscape](https://www.mathworks.com/products/simscape.html)\n- [Simscape Electrical](https://www.mathworks.com/products/simscape-electrical.html)\n- [Simulink](https://www.mathworks.com/products/simulink.html)\n- [Simulink Control Design](https://www.mathworks.com/products/simcontrol.html)\n- [Control System Toolbox](https://www.mathworks.com/products/control.html)\n- [Optimization Toolbox](https://www.mathworks.com/products/optimization.html)\n\n### Getting Started \nTo learn more about modeling and simulation with Simscape™, please visit:\n* [Simscape Getting Started Resources](https://www.mathworks.com/solutions/physical-modeling/resources.html)\n\n## License\nThe license is available in the License file within this repository.\n\n## Community Support\n[MATLAB Central](https://www.mathworks.com/matlabcentral)\n\nCopyright 2022 The MathWorks, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks%2Fpmsm-drive-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathworks%2Fpmsm-drive-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks%2Fpmsm-drive-optimization/lists"}