Use Arduino as controller (HIL) for a simulink modelled physical system
Hello Everyone,
I’ve been searching for an answer to this question and haven’t found anything quite applicable in past items from this forum. Would appreciate any guidance you all can give. I have modelled a system (inverted pendulum) in Simulink and tuned a PID controller for support. My next step is to convert my current continuous controller into a discreet form and write that in the Arduino programming environment then upload to the board. That part is not an issue. What I need help with is to replace the controller sub system I have in simulink with controls sent to/from the actual Arduino itself.
What I need to do is simulate the system in Simulink and send the various state information via USB to the Arduino for processing then read that information back in to update the simulated system. Is this possible and does anyone have ideas for where to start? I have already downloaded the Arduino support module but that seems more for laying out a full system to upload onto the Arduino board and run separate from the computer. (While a useful function, it’s not applicable to the project I want. I do want to program the controller separately using the standard c-based language for the arduino.)
Thank you in advance for any help!
EDIT: I forgot to mention that I’m using the Arduino Uno (Makezine version)Hello Everyone,
I’ve been searching for an answer to this question and haven’t found anything quite applicable in past items from this forum. Would appreciate any guidance you all can give. I have modelled a system (inverted pendulum) in Simulink and tuned a PID controller for support. My next step is to convert my current continuous controller into a discreet form and write that in the Arduino programming environment then upload to the board. That part is not an issue. What I need help with is to replace the controller sub system I have in simulink with controls sent to/from the actual Arduino itself.
What I need to do is simulate the system in Simulink and send the various state information via USB to the Arduino for processing then read that information back in to update the simulated system. Is this possible and does anyone have ideas for where to start? I have already downloaded the Arduino support module but that seems more for laying out a full system to upload onto the Arduino board and run separate from the computer. (While a useful function, it’s not applicable to the project I want. I do want to program the controller separately using the standard c-based language for the arduino.)
Thank you in advance for any help!
EDIT: I forgot to mention that I’m using the Arduino Uno (Makezine version) Hello Everyone,
I’ve been searching for an answer to this question and haven’t found anything quite applicable in past items from this forum. Would appreciate any guidance you all can give. I have modelled a system (inverted pendulum) in Simulink and tuned a PID controller for support. My next step is to convert my current continuous controller into a discreet form and write that in the Arduino programming environment then upload to the board. That part is not an issue. What I need help with is to replace the controller sub system I have in simulink with controls sent to/from the actual Arduino itself.
What I need to do is simulate the system in Simulink and send the various state information via USB to the Arduino for processing then read that information back in to update the simulated system. Is this possible and does anyone have ideas for where to start? I have already downloaded the Arduino support module but that seems more for laying out a full system to upload onto the Arduino board and run separate from the computer. (While a useful function, it’s not applicable to the project I want. I do want to program the controller separately using the standard c-based language for the arduino.)
Thank you in advance for any help!
EDIT: I forgot to mention that I’m using the Arduino Uno (Makezine version) arduino, hil, inverted pendulum MATLAB Answers — New Questions