Python: PID controller
-
Moku:Go
Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Frequency Response Analyzer Moku:Go Logic Analyzer & Pattern Generator Moku:Go Oscilloscope & Voltmeter Moku:Go PID Controller Moku:Go Spectrum Analyzer Moku:Go Waveform Generator Moku:Go Power Supplies Moku:Go Digital Filter Box Moku:Go FIR Filter Builder Moku:Go Lock-in Amplifier Moku:Go General Moku:Go Logic Analyzer/Pattern Generator Moku:Go Time & Frequency Analyzer Moku:Go Laser Lock Box Moku:Go Phasemeter
-
Moku:Lab
Moku:Lab General Moku:Lab Arbitrary Waveform Generator Moku:Lab Data Logger Moku:Lab Digital Filter Box Moku:Lab FIR Filter Builder Moku:Lab Frequency Response Analyzer Moku:Lab Laser Lock Box Moku:Lab Lock-in Amplifier Moku:Lab Oscilloscope Moku:Lab Phasemeter Moku:Lab PID Controller Moku:Lab Spectrum Analyzer Moku:Lab Waveform Generator Moku:Lab Time & Frequency Analyzer Moku:Lab Logic Analyzer/Pattern Generator
-
Moku:Pro
Moku:Pro Arbitrary Waveform Generator Moku:Pro Data Logger Moku:Pro Frequency Response Analyzer Moku:Pro Oscilloscope Moku:Pro PID Controller Moku:Pro Spectrum Analyzer Moku:Pro Waveform Generator Moku:Pro Lock-in Amplifier Moku:Pro Digital Filter Box Moku:Pro FIR Filter Builder Moku:Pro Phasemeter Moku:Pro Multi-instrument Mode Moku:Pro General Moku:Pro Logic Analyzer/Pattern Generator Moku:Pro Time & Frequency Analyzer
- Python API
- MATLAB API
- Arbitrary Waveform Generator
- Data Logger
- Digital Filter Box
- FIR Filter Builder
- Frequency Response Analyzer
- Laser Lock Box
- Lock-in Amplifier
- Oscilloscope
- Phasemeter
- PID Controller
- Spectrum Analyzer
- Time & Frequency Analyzer
- Waveform Generator
- Logic Analyzer & Pattern Generator
- Multi Instrument Mode
- Moku Cloud Compile
- Moku general
- LabVIEW
Example Python script to implement the PID controller
For more examples, please refer to this link: Moku API
# # Moku example: Basic PID Controller # # This script demonstrates how to configure one of the two PID Controllers # in the PID Controller instrument. Configuration is done by specifying # frequency response characteristics of the controller. # # (c) 2023 Liquid Instruments Pty. Ltd. # from moku.instruments import PIDController # Launch PID Controller and connect to your device via IP i = PIDController('192.168.###.###', force_connect=False) try: # Configures the control matrix: # Channel 1: input 1 gain = 1 dB, input 2 gain = 0 dB # Channel 2: input 2 gain = 0 dB, input 2 gain = 1 dB i.set_control_matrix(channel=1, input_gain1=1, input_gain2=0) i.set_control_matrix(channel=2, input_gain1=0, input_gain2=1) # Configure PID Control loop 1 using frequency response characteristics # P = -10dB # I Crossover = 100Hz # D Crossover = 10kHz # I Saturation = 10dB # D Saturation = 10dB # Double-I = OFF i.set_by_frequency(channel=1, prop_gain=-10, int_crossover=1e2, diff_crossover=1e4, int_saturation=10, diff_saturation=10) # Configure PID Control loop 2 using gain # Proportional gain = 10 # Differentiator gain = -5 # Differentiator gain corner = 5 kHz i.set_by_gain(channel=2, overall_gain=0, prop_gain=10, diff_gain=-5, diff_corner=5e3,) # Enable the outputs of the PID controller i.enable_output(1, signal=True, output=True) i.enable_output(2, signal=True, output=True) except Exception as e: print(f'Exception occurred: {e}') finally: # Close the connection to the Moku device # This ensures network resources and released correctly i.relinquish_ownership()