Skip to content

Muathew/PID-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Neural PID Interface

Neural PID Interface is a high-performance, real-time PID control and visualization suite. It combines a low-level AVR C firmware (running on the ATmega644P "Il Matto" board) with a high-fidelity, Cyberpunk 2077-inspired Python GUI. This system allows for precision voltage control, real-time telemetry, and arbitrary waveform injection.

System Overview

The system creates a closed-loop control environment where the ATmega644P manages a 100Hz PID loop to regulate output voltage via PWM based on ADC feedback. The Python interface acts as the "Neural Link," allowing the user to tune gains, visualize system response, and draw custom setpoint sequences manually.

Core Features:

  • Real-Time Telemetry: Dual-trace graphing of Setpoint (SP) and Process Variable (PV) at 60FPS using pyqtgraph.

  • Dynamic PID Tuning: Live adjustment of PID (Kp, Ki, Kd) parameters via the UI without rebooting the MCU.

  • Signal Injection: Integrated function generator for Sine, Square, Triangle, and Noise waveforms.

  • Arbitrary Waveform Buffer: A custom "buffer-painting" widget allowing users to hand-draw setpoint curves.

  • Smart Datalink: High-speed UART communication with the ability to switch baud rates (up to 230,400) on the fly.

  • Data Persistence: Export/Import system states and telemetry logs to CSV for post-processing.

📸 Visual Documentation

🖥️ High-Contrast Interface

The PyQt6 GUI featuring the "Cyberpunk 2077" color palette, waveform editor, and live PID tuning matrix.

image

🔬 Hardware Performance

Oscilloscope capture showing the PWM output (Blue) responding to a step change in the Setpoint (Cyan).

image image

🛠️ Technical Specifications

Firmware (AVR C)

  • MCU: ATmega644P @ 12.000 MHz.

  • Control Loop: 100Hz (Timer1 CTC mode).

  • Feedback: 10-bit ADC (Channel 1).

  • Output: Fast PWM (Timer0, ~47kHz carrier frequency) for smooth DC filtering.

  • Communication: Non-blocking UART with a custom CSV-based command parser.

Software (Python 3.10+)

-Framework: PyQt6.

-Threading: QThread managed serial worker to prevent UI freezing.

-Graphics: Hardware-accelerated pyqtgraph for low-latency plotting.

🚀 Future Work

  • Auto-Tuning Engine: Implement the Ziegler-Nichols method directly into the GUI to automatically find optimal PID gains.

  • Bode Plot Generator: Sweep frequencies to analyze system stability and phase margin.

  • Multi-Channel Support: Expand firmware to handle multiple independent PID loops for MIMO control.

  • Wireless Bridge: Integrate ESP32-based transparent serial bridge for remote "Neural Link" control via Wi-Fi.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors