Motor Control without using Host Model

5 次查看(过去 30 天)
Hello Community,
I am using motor control blockset and its shipping examples for my FOC PMSM/BLDC motor application.
Below are my queries.
  1. Can we change speed of motor, ON/OFF control of motor without using host model?
  2. I am looking to add Potentiometer for speed control. How it can be implemented in shipping example?
  3. What configuration should be chnaged in main model and code generation? I am using TI F280049C Launchpad and TI F280049C controller of custom board.
Appriciate your valuable feedback.
Thanks.

回答(1 个)

Aabha
Aabha 2025-4-25
If you wish to control the motor speed without using the host model, you can try changing the structure of the target model. You can try modifying it such that, instead of receiving the speed reference from the host model, the speed reference values are hard coded using ‘Step Input’ blocks or ‘Repeating Sequence Stair’ blocks, in the target model itself.
Alternatively, you can generate code using ‘Embedded Coder’ and deploy it using a third-party software ‘Code Composer Studio’. Then, add the variable ‘Enable’ to the watch window, where you can toggle its values to turn the motor On/ Off.
In order to add a potentiometer for speed control, you can make some modifications in the shipping example model. Since a potentiometer gives analog values as outputs, you will need to connect it to an ‘ADC’ module on the target board. Ensure that the ADC Module is not used by any other components in the model. In the control algorithm, read the ADC value corresponding to the potentiometer's position. Then, scale this ADC value to match the rated speed range of the motor being used. This will allow the potentiometer to control the speed linearly or as per the desired mapping.
To understand the configuration settings based on the target hardware, you can refer to the workflow mentioned in the below documentation link: https://www.mathworks.com/help/releases/r2024b/ti-c2000/ug/foc-hall-sensor-example.html You can also try running the following command in the MATLAB Command Window:
openExample('c2b/FOCHallSensorUsingC2000Example','supportingFile','mcb_pmsm_foc_hall_f280049C')
This will open an example model for Field Oriented Control, which is configured for the F280049C target board. Please refer to the hardware configuration settings for the above example model.
I hope this answers your question.

标签

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by