Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Basic Motor Position Control Application

In this application, you will learn how to control a DC motor’s exact position in degrees using the Position Mode of the SMD Red module. You will enter a target angle between 0 and 360, and the motor will rotate precisely to that point using encoder feedback.

About Tools and Materials:

SMD Red (Purchase Here)

SMD USB Gateway (Purchase Here)

Arduino Gateway Module (Purchase Here)

BDC Motor (Purchase Here)

Step 1: Hardware & Software Overview

Project Key Components

  1. SMD Red: Controls the brushed DC motor and reads encoder feedback for accurate position control.

  2. BDC Motor: Converts electrical energy to mechanical rotation and provides position feedback via encoder signals.

Project Key Features

  1. Precise angle-based control: Move the motor shaft to an exact angle between 0° and 360°.

  2. Real-time encoder feedback: Monitor actual shaft position with high-resolution encoder data.

  3. Tunable PID position control: Customize responsiveness and stability using: set_control_parameters_position

  4. Encoder-integrated control loop: Closed-loop control ensures accurate positioning over time.

Step 2: Assemble

Getting Started

Hardware Setup

Project Wiring Diagram

Step 3: Run & Test

Run the Script

After launching the script, you will be prompted to enter a desired angle between 0 and 360 degrees. The motor will rotate to the target position using encoder feedback and stop.

Codes

Last updated