Process controller

Zaber's universal process controller is a powerful tool for integrating your Zaber setup with 3rd party voltage-controlled devices and can deliver up to 48V with 4A of current. The following guide shows how to configure it in two of its four modes: MANUAL and PID. Before diving into either though, we will demonstrate how to create instances of the ProcessController and Process classes.

Please note that although we configure settings programmatically in this guide, we encourage users to use the Process Controller app in Zaber Launcher to perform initial setup and validation on their choice of settings. That said, if a user still wishes to perform setup programmatically, we recommend that they refer to the process settings documentation in the Zaber ASCII protocol manual.

For detailed information on how to physically set up the device, please refer to the online user's manual.

Enabling Processes

Connect your device and use Zaber Launcher to find its device address on its device chain, then get the device instance in your code and use it to instantiate a new ProcessController.

Python
C++
process_controller = ProcessController(device)
ProcessController processController(device);

Each process controller has four processes, numbered 1 to 4. Here we get the first process.

Python
C++
process = process_controller.get_process(1)
Process process = processController.getProcess(1);

The following two sections describe how to set up a process in PID and MANUAL control mode.

PID Mode

In this mode, the device will run a control loop which automatically updates the process output voltage.

First, set the process' mode to PID.

Python
C++
process.set_mode(ProcessControllerMode.PID)
process.setMode(ProcessControllerMode::PID);

The user must then specify the input source for the control loop, which can be one of the two thermistor or analog inputs on the device. In this example, we look at how to set up a control loop using thermistor 1.

Python
C++
process.set_source(ProcessControllerSource(ProcessControllerSourceSensor.THERMISTOR, 1))
process.setSource(ProcessControllerSource(ProcessControllerSourceSensor::THERMISTOR, 1));

After setting the mode and control source, there are a number of other general of some PID-specific settings which should be set. The first to consider are the control direction, min and max output voltages and max current.

Python
C++
process.settings.set("process.control.dir", 0)
process.settings.set("process.control.voltage.min", 0.0, Units.VOLTAGE_VOLTS)
process.settings.set("process.control.voltage.max", 10.0, Units.VOLTAGE_VOLTS)
process.settings.set("process.current.max", 1.0, Units.DC_ELECTRIC_CURRENT_AMPERES)
AxisSettings settings = process.getSettings();
settings.set("process.control.dir", 0);
settings.set("process.control.voltage.min", 0.0, Units::VOLTAGE_VOLTS);
settings.set("process.control.voltage.max", 10.0, Units::VOLTAGE_VOLTS);
settings.set("process.current.max", 1.0, Units::DC_ELECTRIC_CURRENT_AMPERES);

Next, because we are using a thermistor as the source for the controller, we need to set the setpoint temperature and low-pass filter time constant.

Python
C++
process.settings.set("process.control.setpoint.temperature", 20.0, Units.ABSOLUTE_TEMPERATURE_DEGREES_CELSIUS)
process.settings.set("process.control.setpoint.tf", 5.0, Units.TIME_MILLISECONDS)
settings.set("process.control.setpoint.temperature", 20.0, Units::ABSOLUTE_TEMPERATURE_DEGREES_CELSIUS);
settings.set("process.control.setpoint.tf", 5.0, Units::TIME_MILLISECONDS);

Finally, we set the kp, ki and kd coefficients of our PID controller. Please note that these coefficients depend on the application and tuning them will require at least some basic knowledge of control systems.

Python
C++
process.settings.set("process.pid.kp", 1.0)
process.settings.set("process.pid.ki", 0.5)
process.settings.set("process.pid.kd", 0.25)
settings.set("process.pid.kp", 1.0);
settings.set("process.pid.ki", 0.5);
settings.set("process.pid.kd", 0.25);

Now that the PID process has been configured, it is ready to be turned on.

Python
C++
process.on()
process.on();

The PID process will run until off is called. You can optionally pass a duration parameter to the call to on to indicate how long you'd like the control loop to run for.

Manual Mode

In manual mode, the user is responsible for setting the voltage and turning the process on and off.

First, set the process' mode to MANUAL.

Python
C++
process.set_mode(ProcessControllerMode.MANUAL)
process.setMode(ProcessControllerMode::MANUAL);

This next step is optional, but it may be useful to set the maximum current for your process.

Python
C++
process.settings.set("process.current.max", 1.0, Units.DC_ELECTRIC_CURRENT_AMPERES)
settings.set("process.current.max", 1.0, Units::DC_ELECTRIC_CURRENT_AMPERES);

Next, we configure the output. There are options for specifying the voltage of an initial pulse, the pulse's duration and then the final holding voltage of the signal. It may also be relevant to set the time constant for the process' output low-pass filter.

Python
C++
process.settings.set("process.voltage.start", 10.0, Units.VOLTAGE_VOLTS)
process.settings.set("process.voltage.start.duration", 100.0, Units.TIME_MILLISECONDS)
process.settings.set("process.voltage.on", 5.0, Units.VOLTAGE_VOLTS)
process.settings.set("process.voltage.tf", 7.5, Units.TIME_MILLISECONDS)
settings.set("process.voltage.start", 10.0, Units::VOLTAGE_VOLTS);
settings.set("process.voltage.start.duration", 100.0, Units::TIME_MILLISECONDS);
settings.set("process.voltage.on", 5.0, Units::VOLTAGE_VOLTS);
settings.set("process.voltage.tf", 7.5, Units::TIME_MILLISECONDS);

Now that the manual process has been configured, it is ready to be switched on.

Python
C++
process.on(500.0, Units.TIME_MILLISECONDS)
process.on(500.0, Units::TIME_MILLISECONDS);

Note that above we specify optional parameters telling the process to turn off after 500 milliseconds.

Wrapping Up

If you have turned on a process without specifying a duration, then you may want to turn it off.

Python
C++
process.off()
process.off();