Please update your browser. For the best Liquid Instruments experience, update to the latest version of Chrome, Edge, Firefox, or Safari. Update Microsoft Edge.
Liquid Instruments Logo
Products
Hardware Platforms
Moku:Delta
Moku:Delta
New
For advanced design and validation
Moku:Pro
Moku:ProFor versatile test and measurement
Moku:Lab
Moku:LabFor experimental research labs
Moku:Go
Moku:GoFor quick testing and debugging
Compare Hardware
Compare HardwareView a side-by-side of all Moku hardware
Technologies
GenInst Studio
New
Generate personalized instruments
Integrated InstrumentsProfessional-grade instruments at your fingertips
Neural NetworkFPGA-powered neural network integration
Multi-Instrument ModeCombine instruments to create a customized test system
Moku CompileCode, compile, and deploy to your Moku's FPGA
Software
MokuOSDownload the Moku app for Windows, macOS, iPadOS & visionOS
APIsPython, MATLAB, LabVIEW
UtilitiesCommand line and graphical tools for file conversion
Instruments
Analysis
Oscilloscope
Spectrum Analyzer
Frequency Response Analyzer
Lock-in Amplifier
Phasemeter
Logic Analyzer / Pattern Generator
Time & Frequency Analyzer
Data Logger
Generation
Waveform Generator
Arbitrary Waveform Generator
Control & Conditioning
PID Controller
Digital Filter Box
FIR Filter Builder
Laser Lock Box
Custom & Utility
GenInst Studio
New
Gigabit Streamer
Custom Instrument
Neural Network
Multi-Instrument Mode
Applications
Optics and Photonics
Microscopy and Spectroscopy
Photon Counting
Quantum Optics
Aerospace and defense
A&D Instrumentation
Component Test
Automated Testing
Semiconductor Test
Control Systems and Bode Analysis
MEMS Testing
AI and Machine Learning
Generative Instrumentation
New
Neural Networks
Education
Education and Research
Resources
App Notes
Blog
Case Studies
Coursework
Guides
Product Documentation
Publications
Webinars
White Papers
Support
Company
Contact Us
About Us
Leadership
Partners
News & Updates
Press
Events Calendar
Careers
Store
Moku:Delta
Moku:Pro
Moku:Go
Upgrade Moku:Pro
Upgrade Moku:Lab
Upgrade Moku:Go
0
Get a quote Buy Now
Build personalized instruments with GenInst Studio in minutes, not months. | Register for the webinar
Blog

Tuning a digital PID Controller with a unit step response

Learn where to start when tuning a real-time, digital PID Controller using the unit step response method

February 27, 2025

    This blog provides a practical guide on tuning a digital PID controller using the unit step response method, leveraging real-time feedback and oscilloscope visualization for efficient adjustments.

    Guide to feedback and control loops Explore PID Controller

    When tuning a digital PID controller, you can adjust parameters interactively on a gain plot and observe the response in real time on an embedded oscilloscope. This makes experimentally tuning your controller much easier than in traditional feedback systems, and requires far less calculations from the user. For a detailed guide on frequency-domain control, read our application note.

    feedback control system block diagram

    Figure 1: Typical feedback control system block diagram

    When constructing a feedback control loop as seen in Figure 1, using the block diagram approach can greatly simplify analysis. Figure 1 describes a closed-loop frequency control system, where Xsp represents a set point input, C represents the controller, H represents the system under control, and Xfreq represents the output frequency of the system. In our feedback loop, S represents a sensor to measure our system output. By comparing this output to our desired setpoint, the controller can compensate for changes in the system.

    This difference between our desired set point and the system output is our error signal, ε. If the sensor output and the set point match, our error signal will be zero. If our output is larger than the desired set point, the error will be negative and cause our controller to reduce the output.

    There are many ways to tune a feedback control system. In this example, we will outline how to begin tuning a digital PID controller experimentally, by beginning with a unit step input signal, viewing our system unit step response, and adjusting P, I, and D parameters while observing the response to achieve the desired result. To simulate a plant under test, we configure the Moku:Pro in Multi-Instrument Mode (Figure 2), using a 100 Hz, 2nd order low-pass filter in the Digital Filter Box (Figure 3). The Oscilloscope’s embedded waveform generator produces a square wave as our input step signal (Figure 4).

    Multi-instrument Mode configuration to use the Digital Filter Box to simulate a plant

    Figure 2: Multi-Instrument Mode configuration to use the Digital Filter Box to simulate a plant

    Digital Filter Box low-pass filter configuration

    Figure 3: Digital Filter Box low-pass filter configuration

    step signal generation using an embedded Waveform Generator

    Figure 4: Step signal generation using the embedded Waveform Generator

    Set up the system

    1. Connect the Moku:Pro PID Controller to your system as C, controller, in Figure 1.
    2. Ensure the input signal, which is the difference between the actual sensor output and the desired set point, Xsp, and output control signal, which is the output of C in Figure 1, are properly configured. To learn more about the input control matrix of the PID Controller, read this Knowledge Base article. Connect the sensor feedback into Input 1 of Moku:Pro. Connect Output 1 of Moku:Pro to the tuning input of your plant, or system under control, H. This tuning input could be for a voltage-controlled oscillator (VCO), laser modulation input, or motor controller.
    3. Open the gain plot view by clicking on the Controller block for tuning and the embedded Oscilloscope at probe points before and after the controller in the Moku PID Controller, seen in Figure 5.

    Block diagram view of the Moku PID Controller, top. Gain plot of the Moku PID Controller and the embedded Oscilloscope view, bottom

    Figure 5: Block diagram view of the Moku PID Controller, top. Gain plot of the Moku PID Controller and the embedded Oscilloscope view, bottom.

    Start with Proportional (P)

    Moku PID Controller interface

    Figure 6: I and D equal to zero, increasing P.

    1. Disable I and D initially.
    2. Increase P by dragging it on the gain plot until the system starts responding quickly.
    3. Watch the oscilloscope output—if the system oscillates too much, reduce P slightly.

    Add Integral (I) to remove steady-state error

    1. Slowly increase I to eliminate any steady-state error, as seen in Figure 7.

    Figure 7: Reduced P, modifying I.

    1. Monitor the oscilloscope for overshoot—too much I can cause excessive oscillations. In Figure 8, increasing I to 300 Hz causes noticeable oscillations.
    Oscillations increase showcased on PID controller

    Figure 8: Oscillations increase with increased I.

    1. If oscillations increase, consider slightly reducing P.

    Add Derivative (D) to improve stability

    1. Gradually increase D to reduce overshoot and dampen oscillations, seen in Figure 9.

    Figure 9: P and I set, adding D at 100 Hz.

    1. Be careful—too much D can make the system noisy due to amplified high-frequency signals. You can also enable a differentiator saturation term to limit high-frequency gain.
    2. Adjust P, I, and D interactively while watching the oscilloscope for optimal performance.

    To further fine-tune the response, use small adjustments and observe the real-time response on the Oscilloscope. Using the Oscilloscope’s built in measurements, you can also monitor rise time, overshoot, undershoot, and more, logging this information to a file if desired. These Oscilloscope traces can also be exported as .MAT files for further analysis in MATLAB. If needed, adjust output limits to protect external components, filters, or sampling rate for better stability. To implement cascaded controllers, use Multi-Instrument Mode on Moku:Pro.

    Try Moku in demo mode Download the Moku app → Get answers to FAQs Visit Knowledge Base → Connect with Moku users Join the user forum →

    Other Recommended Blog Posts

    Blog
    What is Generative Instrumentation?

    The AI-enabled technology for creating customized test solutions, including specialized measurements, real-time signal processing, and control capabilities

    Date: July 14, 2026

    Blog
    5 Advantages of FPGA-Based Customization for Test & Measurement

    How instruments with user-programmable FPGAs are replacing racks of test equipment, and what that means for your lab.

    Featuring: Moku Cloud Compile

    Date: May 22, 2026

    Blog
    Faster, more powerful real-time customization with MokuOS 4.2

    MokuOS 4.2 unlocks higher bandwidth, faster real-time processing, and more instruments on Moku:Delta, all with a simple software update.

    Date: March 19, 2026

    Back to all Blog

    Nav

    • Products
    • Instruments
    • Resources
    • Support
    • Company
    • Contact Us
    • Privacy Policy
    • Terms of Use

    Offices

    United States
    (619) 332-6230
    12526 High Bluff Dr.
    Suite 150
    San Diego, CA 92130

    Australia
    +61 2 6171 9730
    243 Northbourne Avenue
    Suite 1, Level 1
    Lyneham, ACT 2602

    Australia
    +61 3 7073 3594
    Suite 5C, Level 5,
    700 Swanston Street,
    Carlton, VIC – 3058

     

     

    Follow us

    LinkedIn YouTube X Facebook Instagram

    官方微信

    © 2026 Liquid Instruments. All rights reserved.