How to control the position and displacement rate of a feedback linear actuator

1 次查看(过去 30 天)
Hello,
I have a feedback linear actuator, Arduino Uno, Cytron 10A Bi-Directional DC Motor Driver Shield for Arduino, and a 12V power supply. I am trying to move the actuator to a specific position at a specific displacement rate (that will be determined by the user). I was able to do it through Arduino IDE with a code I downloaded online. I was wondering if it is possible to do it through Matlab (without using Simulink if possible). Does anyone has ever done it before and can give me advice on how to start writing the code?
Thank you very much!

回答(1 个)

Kothuri
Kothuri 2024-8-23
Hi May Allall,
I understand that you would like to control a feedback linear actuator using MATLAB without Simulink. This can be done by using the “MATLAB Support Package for Arduino”. This allows you to write MATLAB scripts to interact with your Arduino and control the actuator.
Please follow the steps outlined below
  • Installing MATLAB Support Package for Arduino by > MATLAB > Add-Ons menu > Search for “MATLAB Support Package for Arduino Hardware” > install.
Below link provides information on installation of MATLAB support package for Arduino
  • Initialize Arduino in MATLAB.
  • Connect the motor driver to the Arduino and the actuator and initialize it.
  • Use the “writePWMVoltage” function to control the motor speed.
  • Connect the feedback signal from the actuator to an analog input pin on the Arduino.
  • Use the “readVoltage” function to read the feedback signal.
  • Implement a control loop to adjust the motor speed based on the feedback to reach the desired position.
In this way you can model a Linear electric Actuator in MATLAB.
Below link is an Example of Linear Electric actuator in MATLAB.
Below link provides more info about the “arduino” object used in the code snippet

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by