Skip to content

alisonands/LED_PID

Repository files navigation

Two-Axis LED Position Control

Introduction

This project implements a closed-loop control system to center an LED light source over a series of photoreistors through light intensity feedback. The system consists of two servo motors, that adjusts it position in two dimensions (X, Y). We aim to have the LED stay centered between three photoresistors.

Methods

The system is controlled using a PID controller. The system camples analog values from the photoresistors, and calculates the positional error based on differences in the measured light intensity, providing feedback to the motors for adjustments.

Setup

The hardware consists of three photoresistors arranged in a triangle, and the LED placed in front of the arrangement. Photoresistors(PR)

  • PR1: Bottom.
  • PR2: Top left.
  • PR3: Top right.

Two degrees of freedom: setup

PID control demo: setup

Calculations

The control logic derives error signals from the intensity differences between sensors:

  • Error X (Horizontal): Determines left/right balance. $$E_x = PR3 - PR2$$
  • Error Y (Vertical): Determines top/bottom balance. $$E_y = \frac{PR3 + PR2}{2} - PR1$$

Results and Discussion

Steady State Behavior

  1. PID Convergence: As the system changes, the derivative and integral components reduce overshoot and drive the steady-state error to zero respectively.

error plot

Steady-state error

  1. Geometric error: "Zero Error" ($PR1=PR2=PR3$) corresponds to the true geometric center only if all sensors are perfectly matched. If PR1 is 5% more sensitive than the others, the LED will settle further away from PR1 to equalize the readings.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors