Matlab Library

Matlab is a high-level programming and numerical computing environment developed for engineers and scientists. It is widely used for tasks such as data analysis, signal and image processing, control system design, wireless communications, and robotics. The platform combines a powerful programming language with interactive applications, specialized toolboxes, and built-in capabilities for automatically generating embedded code.

Watch the video below or read the text, and download the User Manual to learn more about the usage process.

The MATLAB/Simulink approach allows for graphical modeling and simulation of your control system.

Prerequisites

Before you begin, ensure you have the following software installed:

  1. MATLAB and Simulink

  2. Instrument Control Toolbox (Required for serial communication)

  3. Simulink Desktop Real-Time (Required for real-time execution)

Initial Setup Steps

  1. File Preparation: Copy the "SimulinkModelSMD" folder to a local drive on your computer (e.g., under C:\).

  2. Connections:

    • Connect the USB Gateway Module to your PC's USB port.

    • Connect the SMD RED board to the gateway module using an RJ-11 cable.

    • Connect the 12V adapter to supply power to the SMD.

  3. Identify COM Port: Check your computer's Device Manager -> Ports to determine the serial port name assigned to the USB Gateway Module (e.g., 'COM4').

While your request uses the format for the Python library, the information below details the corresponding initial setup and parameters required to begin working with the SMD MATLAB/Simulink interface, based on the file content.


First of all, PC and SMD connections should be made. Connect your USB gateway module to your PC's USB port and connect your SMD to the gateway module with an RJ-11 cable. Lastly, connect a 12V adapter to supply power to the SMD.

To start controlling the SMD with MATLAB, the user needs to know several key parameters:

  • Serial Port: The user needs to know the serial port (e.g., COM... or /dev/tty...) of the connected USB gateway module. For example, 'COM4' is a typical value for Windows systems.

  • SMD ID: Since SMD cards can be connected to each other, each of them can have a different ID by user's choice. However, an SMD Red has an ID of 0 by default. This value can be intentionally changed between 0 - 255.

  • Operation Mode: The user must specify the desired operation mode (e.g., 'velocity', 'position', or 'main') to the StartSMD function, which launches the correct Simulink interface.

With all this information, the crucial part of launching the control interface can begin using the StartSMD function in the MATLAB Command Window.

Last updated