Objective: limit the slew rate of an analog output of the RevPi AIO in PiCtory and check the voltage curve with piTest.

The slew function can be used, e.g., for the analog setpoint specification for a frequency converter. It prevents abrupt changes in the output voltage.

This tutorial shows the configuration using a voltage output that is changed from 3 V to 8 V.

For the check, you connect output 1 to the free input 1. This allows you to follow the actual voltage curve in the process image without an additional measuring device.

This tutorial applies to the following base modules:

Prerequisites #

Devices

✓ RevPi AIO

Hardware Installation

✓ RevPi AIO is connected to the RevPi base module via the PiBridge.

✓ Other devices are disconnected from input 1. Other inputs that are already in use can remain connected.

Software Installation

✓ RevPi Bookworm or higher is installed on the RevPi.

✓ Web browser on your PC

✓ There is a network connection between the RevPi and your PC.

1. Configuring the Analog Output #

Caution
Damage to the device due to installation under voltage supply

While the RevPi device is connected to a power source, no other devices may be connected or disconnected, as this may cause damage to the devices.

▷ Do not connect the power supply until all other devices are connected correctly.

▷ Switch off the power supply before disconnecting a device from the system.

▷ With the power supply switched off, connect output 1 to the free input 1.
See also pinout:

Output 1 Input 1

Pin 1 (V+)

Pin 28 (+)

Pin 5 (−)

Pin 24 (−)

There must be no wire jumper between pin 26 and pin 28: it would connect the internal shunt for current measurement.

▷ Switch on the power supply.

▷ Drag the RevPi base module from the Device Catalog to the empty slot in the configuration area with position number 0.

▷ Drag the RevPi AIO from the Device Catalog to the left of the base module.

▷ Select the RevPi AIO in the configuration area.

▷ In the Value Editor, select the value 0 … 10 V for input 1 under Input1Range and for output 1 under Output1Range.

▷ Select the following settings for input 1 so that the measured value is displayed in mV:

  • Input1Multiplier = 1

  • Input1Divisor = 1

  • Input1Offset = 0

2. Setting the Slew Function and Step Size #

▷ For output 1, set Output1EnableSlew to On.

You define the step size with Output1SlewStepSize. It is specified in LSB (Least Significant Bit).

Step Size in LSB:

The D/A converter of the RevPi AIO operates with a resolution of 16 bits.

In the output range 0 … 10 V, one LSB corresponds to approx. 10 V / 216 ≈ 0.15 mV

When changing from 3 V to 8 V, the voltage change is 5 V. With a step size of 1 LSB, this requires approximately 5000 mV / 0.15 mV ≈ 33 333 steps.

▷ For Output1SlewStepSize, select 1 LSB in the drop-down menu.

The larger the value for Output1SlewStepSize, the more the output voltage changes per step and the faster the target value is reached.

3. Determining the Clock Rate #

With Output1SlewClock, you define how often the individual steps are executed.

Clock Rate:

With a step size of 1 LSB and a clock rate of 3.3 kHz, a change from 3 V to 8 V takes approximately 33 333 / 3300 1/s ≈ 10 s by calculation.

With a clock rate of 258 kHz, the calculated time is approximately 33 333 / 258 000 1/s ≈ 0.13 s.

▷ For Output1SlewClock, select the clock rate 3.3 kHz in the drop-down menu.

A higher clock rate or a larger step size shortens the time until the new output value is reached.

4. Applying the Configuration #

▷ Select File › Save as Start-Config. to save the configuration.

▷ Select Tools › Reset driver to apply the configuration.

5. Checking the Slew Rate with piTest #

Write two setpoints to the process image one after the other and read back the voltage via input 1.

▷ Log in to the RevPi via a terminal.

▷ Use piTest to set the value for output 1 (OutputValue_1) to 3000 mV:

piTest -w OutputValue_1,3000

▷ After a few seconds, read the measured value of input 1. It should be approximately 3000 mV:

piTest -1 -r InputValue_1

▷ Set output 1 to 8000 mV and immediately afterwards start the continuous measurement:

piTest -w OutputValue_1,8000
piTest -r InputValue_1

❯❯ The measured values of InputValue_1 rise from about 3000 mV to 8000 mV within approximately 10 seconds.

▷ Stop the repeated measurement with Ctrl+C.

Further Resources #