3DOF 3R Robotic Arm Simulation

Explore a three-degree-of-freedom articulated robotic arm with independent revolute joint control, stepper actuation, limit sensing, kinematics, and end-effector trajectory visualization.

Robotics 3DOF 3R Kinematics Stepper
Overview Theory Architecture Simulation Source Code Pinout Examples Downloads

Overview

The 3-DOF 3R Robotic Arm System (3dof_3r) is a 3-Degree-of-Freedom articulated robotic arm virtual hardware featuring three revolute (3R) joints.

The three joints consist of Joint 1 (Base / Waist θ₁), Joint 2 (Shoulder θ₂), and Joint 3 (Wrist / Pitch θ₃).

Each revolute joint is controlled by an independent stepper motor driver using ENABLE, DIR, and STEP signals. Dedicated HOME and END hardware limit switches provide joint boundary detection and homing support.

The control interface is mapped across the GPIO0 and GPIO1 register blocks, providing independent control and monitoring of the three robotic joints.

Key Features

  • Three independently controlled revolute joints
  • Joint 1 base / waist rotation
  • Joint 2 shoulder pitch control
  • Joint 3 wrist / pitch control
  • Independent stepper motor drivers
  • ENABLE, DIR, and STEP control signals
  • Dedicated HOME and END limit switches
  • 3D and 2D end-effector trajectory visualization
  • Integrated simulator and waveform viewer

Joint Summary

3DOF 3R Joint Structure
Joint 1
Base / Waist
θ₁
Joint 2
Shoulder
θ₂
Joint 3
Wrist / Pitch
θ₃
End Effector

Applications & Use Cases

  • Articulated robotic arm motion prototyping
  • Forward kinematics experimentation
  • Joint angle control development
  • 2D and 3D trajectory planning
  • Workspace analysis
  • Stepper motor control experiments
  • Hardware limit and homing experiments
  • Educational robotics and embedded control
3DOF Robotic Arm Control Flow
Target Position
Kinematics
Joint Control
Stepper Drivers
3DOF Robot

Theory

The 3DOF 3R robotic arm consists of three rigid links connected through three revolute joints. Each joint contributes one degree of rotational freedom.

The three joint angles are represented by θ₁, θ₂, and θ₃.

Forward Kinematics

End-Effector Position
θ₁
+
θ₂
+
θ₃
X, Y Position

X Position

x = L1 * cos(θ1)
  + L2 * cos(θ1 + θ2)
  + L3 * cos(θ1 + θ2 + θ3);
                

Y Position

y = L1 * sin(θ1)
  + L2 * sin(θ1 + θ2)
  + L3 * sin(θ1 + θ2 + θ3);
                

Architecture

The 3DOF robotic system consists of a controller, three independent stepper motor drivers, three revolute joints, limit switches, and an end-effector.

Controller
GPIO0
Joint 1

GPIO0
Joint 2
Link 2

GPIO1
Joint 3
End Effector

Joint Control Signals

  • ENABLE — Enables the stepper motor driver
  • DIR — Controls joint rotation direction
  • STEP — Generates the active-high step pulse
  • HOME — Detects the joint home position
  • END — Detects the joint end limit

Simulation

Run the 3DOF robotic arm simulation and observe independent joint movement, end-effector position, workspace limits, and 2D/3D trajectory behavior.

The simulator can be used to evaluate joint control signals and observe the corresponding robotic arm motion.

Launch Simulation

Source Code

Example GPIO configuration for the 3DOF robotic arm controller.

// GPIO0: Outputs on bits 0,1,2,5,6,7
// Inputs on bits 3,4

WRITE_REGISTER(0x40000000, 0xE7);


// GPIO1: Outputs on bits 2,3,4
// Inputs on bits 0,1,5,6

WRITE_REGISTER(0x40000400, 0x1C);
                

Forward Kinematics

x = L1 * cos(theta1)
  + L2 * cos(theta1 + theta2)
  + L3 * cos(theta1 + theta2 + theta3);

y = L1 * sin(theta1)
  + L2 * sin(theta1 + theta2)
  + L3 * sin(theta1 + theta2 + theta3);
                

Pinout

GPIO register mapping for the three stepper controlled joints and their hardware limit switches.

GPIO0

Bit 0
J1_ENABLE
Bit 1
J1_DIR
Bit 2
J1_STEP
Bit 3
J1_HOME

Bit 4
J1_END
Bit 5
J2_ENABLE
Bit 6
J2_DIR
Bit 7
J2_STEP

GPIO1

Bit 0
J2_HOME
Bit 1
J2_END
Bit 2
J3_ENABLE
Bit 3
J3_DIR

Bit 4
J3_STEP
Bit 5
J3_HOME
Bit 6
J3_END
Bit 7
Unused

Register Addresses

GPIO0 MODE
0x40000000
GPIO0 IN
0x40000004
GPIO0 OUT
0x40000008

GPIO1 MODE
0x40000400
GPIO1 IN
0x40000404
GPIO1 OUT
0x40000408

Examples

Example exercises for the 3DOF 3R robotic arm.

  • Move Joint 1 through its 0° to 180° range
  • Control Joint 2 between -90° and +90°
  • Control Joint 3 between -135° and +135°
  • Perform joint homing using HOME switches
  • Detect END limit switch positions
  • Move the end-effector to a target position
  • Plot 2D end-effector trajectories
  • Visualize 3D robotic arm motion
  • Analyze the reachable workspace

Downloads

Download simulation files, source code, documentation, register configuration, and waveform files for the 3DOF 3R robotic arm.

Download Files