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

조회 수: 1 (최근 30일)
May Allall
May Allall 2021년 4월 21일
답변: Kothuri 2024년 8월 23일
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