Simulink lookup table not working with persistent variables in real-time environment

1 次查看(过去 30 天)
Hello,
Background:
  • I am trying to control an electric motor with simulink and a dSpace MicroLabBox
  • One function in the block diagram sends a ramp signal to the motor to ramp from min. to max. speed and back down again
  • A second function takes the input speed and via a lookup table, applies torsional vibrations to the speed signal
Problem:
  • The torisonal vibration function only works when a single speed is entered (simulink "constant" block), but does not work with the ramp function
  • When I run the simulink file (not real-time), it works and the torsional vibrations are correctly applied, but when I run it in real time, they are not applied
My feeling is that the persistent variables used the ramp function don't mesh well with the lookup table after the model is built and the C-code is generated. When I read in the motor voltage signal, I can see the torsional vibrations are not applied when the ramp is selected.
Any help would be greatly appreciated.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by