Virtual hardware availability in simulation environment

28 ビュー (過去 30 日間)
Nikul
Nikul 2025 年 12 月 29 日
回答済み: Shivam 2026 年 2 月 10 日 3:38
I want to develop hardware in loop model using STM32 microcontroller hardware. Prior to that, I want to do simulation with virtual model of hardware. It means the mechanism, motors and hardware, all are virtual. Is such facility available in MATLAB for STM32 or for any other hardware?

回答 (2 件)

Dinesh
Dinesh 2026 年 1 月 5 日
There is no such functionality available for STM32 or any other hardwares apart from PX4 for UAVs
  1 件のコメント
Nikul
Nikul 2026 年 1 月 9 日
STM32 is a highly versatile tool. So, there must be facility for virtual simulation of STM32.

サインインしてコメントする。


Shivam
Shivam 2026 年 2 月 10 日 3:38
Hello Nikul,
As per my understanding, you want to do simulation of hardware model, which includes the mechanism, motors and hardware. This thing can be done with Simscape library blocks (https://www.mathworks.com/products/simscape.html) or Motor control blockset (https://www.mathworks.com/products/motor-control.html) , which provides the blocks to model electrical, mechanical and multi domain physical systems. You can simulate the behaviour of machine for a specific control input and you can also observe the dynamics of closed loop system that is controlled by the controller. You can also place block for implementing a perticular control. Therefore, this is not related to STM32. But, if you want to simulate how the hardware behaves when controlled by STM32 based boards, you can create a (simulation + Codegen) model of the plant. The control algorithm is common for simulation and Code generation. The simulation has a plant model which recieves the inputs from the controller, whereas actual hardware has physical control signals given to the plant from STM32 micro-controller. Therefore, both are analogous to each other.
In order to learn how the Simulation+Codegen model is created, you can refer to the shipped examples:
The above example illustrates a sensorless FOC algorithm implemented on STM32 microcontroller. It supports Simulation of hardware to be controlled. In this way, you can test your control algorithm in Simulation (refered to as "Virtual Hardware" in your question), before going directly on actual hardware. The examples uses STM32 peripheral blocks to configure the peripherals and ensure that they perform as expected.
I hope this helps!
Regards,
Shivam Gothi

製品

Community Treasure Hunt

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

Start Hunting!

Translated by