Archive | Software

Python Interface, Continuous Switching mode

Back to the Python HVPS User Interface

Check Description of the Python interface for an explanation of each control and indicator of the interface

To generate a continuous square wave, switching between 0V and a user-defined voltage at a user-defined frequency, use the following configuration:

Continuous switching configuration
  1. Source output on (default setting when starting the interface).
  2. Switching mode: Switching.
  3. Switching source: internal timer
  4. Voltage control mode: internal regulated control (this leads to accurate output voltage, according to the calibration file of the HVPS). It should be kept on regulated except for very specific applications.
  5. Set the desired voltage with the slider (5a), or the numerical keypad (5b).
  6. Set the desired frequency in Hz. The frequency range is 0.001 Hz to 1kHz. You can use the slider (6a), or the numerical keypad (6b). The bounds and resolution of the frequency sliders are defined in the config.ini file. You can use the numerical keypad 6b to set a frequency value in the 0.001 Hz to 1000 Hz range, irrespective of the bounds and resolution of the slider.
  7. “infinity” symbol means the HVPS generates a continouous switching signal.

Button (1) allows to easily turn the HVPS on/off, i.e. to toggle the output voltage between the voltage defined in (5) and 0V. In addition to these settings, the 6VDC power jack must be plugged in, and the high voltage enable switch (s2) must be in position 1 in order to have high voltage at the output.

Python Interface, DC output

Back to the Python HVPS User Interface

Check Description of the Python interface for an explanation of each control and indicator of the interface

To generate a constant output voltage, use the following configuration:

Configuration for DC voltage output

  1. Source output on (default setting when starting the interface).
  2. Switching mode: DC mode (default setting when starting the interface).
  3. Switching source: internal timer.
  4. Voltage control mode: internal regulated control (this leads to accurate output voltage, according to the calibration file of the HVPS). It should be kept on regulated except for very specific applications.
  5. Set the desired voltage
    a) Using the slider. The resolution of the slider depens on the HVPS voltage rating and is defined in the file config.ini
    b) Using the keypad to enter a numerical input. Use the keypad to enter a number that you validate with Ok. Canc. closes the dialogue without taking the new value into account. C clears the entrered value so that you can enter a new one (in case of a typing mistake)

Button (1) allows to easily turn the HVPS on/off, i.e. to toggle the output voltage between the voltage defined in (5) and 0V.

In addition to these settings, the 6VDC power jack must be plugged in, and the high voltage enable switch (s2) must be in position 1 in order to have high voltage at the output.

Python Interface, limit the output voltage

Back to the Python HVPS User Interface

Check Description of the Python interface for an explanation of each control and indicator of the interface

When sensitive devices are connected to the output of a HVPS, such as a dielectric elastomer actuator, it can be desirable to limit the output voltage of the HVPS to prevent against a wrong manipulation on the front panel. This can be done on the HVPS options dialogue, which you can access by clicking the tool button at the top right of the interface (red rectangle).

In the displayed dialogue box, you can define a maximal voltage using the slider(blue rectangle), or the numerical keypad (orange rectangle). Then click on OK to close the option dialogue box.

Then, as illustrated on the figure below, the upper bound of the voltage set point slider (red rectangle) is modified to the limit voltage you defined in the option dialogue box (in this case 1500V). If you are using the numerical input to set a voltage using the keypad, the voltage setpoint will be capped to the value you entered in the option dialogue box.

When you define a limiting voltage, it will be enforced as soon as you close the dialogue box with ok. For example if the HVPS has a set point of 2.5kV with no safety limit, and a safety limit is then defined at 1.5kV, the set point and output voltage will be decreased to 1.5kV as soon as you press the ok button.

Current limitations of the Python interface

The python interface is a work in development and doesn’t (yet) integrate all of the functionalities of the LabVIEW interface. These are the current limitations:

  • The interface can only be used for the single channel (SHVPS) configuration. (i.e. no multichannel support.)
  • The interface can only handle a single SHVPS connected to a computer. (if two HVPS are connected to the same computer, the interface will connect to the one connected to the first USB port.)
  • The automatic calibration routines are not implemented. It is necessary to use the LabVIEW interface to calibrate a new HVPS, or use the manual calibration methods.
  • The configuration parameters of a new HVPS (name, maximal voltage, I2C address, etc.) cannot be entered from the interface. You should perform the initial configuration of a new HVPS using the LabVIEW interface, or enter the parameters manually using a serial connection.
  • The Waveform mode is not yet implemented.

Description of the Python interface

Launching the interface

Be sure to have read the page on the installation and prerequisites for the python interface. It contains the information required to install and launch the interface.

Using the interface

Python GUI

  1. On/Off button. Quick way to toggle between no output voltage and the programmed output. If the button is On and you have set a voltage >0 with (5), but there is no output voltage (Feedback on the current parameters (10) remains 0), then the safety HV enable switch (Switch S2) is probably in the off position.
  2. You can toggle between the different output modes of the HVPS: DC (constant voltage), and Switching (square signal of defined amplitude and frequency).
  3. The source of the switching signal for the output, i.e. what controls the output switch that pulls the output high (to the voltage set point) or low (to 0V). The 3 settings are:
    1. Timer: an internal timer that enables switching at a programmed frequency set by (6),
    2. External: a 5V signal applied to pin 6 (F) of the 10-pin header,
    3. Button: the manual push button on the PCB (S1) controls the switching. The software selection of the switching source with button (3) is only possible if the header H2 on the PCB is on the “onboard” position. Otherwise the header forces the setting of the switching source.
  4. How the output voltage is controlled. The default (Regulated) is probably what you want. The “external” setting enables to apply a 0-5V signal to pin 5 (V) of the 10-pin header. Open-loop disables the regulator. If using either external or open-loop, refer to the datasheet of the EMCO DC/DC converter for the relation between input and output voltage, as it is strongly dependent on load!
  5. Slider to choose the output voltage. The voltage can also be set using the numerical inputs (11)
  6. The frequency of the output signal. The range and resolution of the slider can be set in the config.ini file which is located with the interface files. You can edit this file if you wish to change the bounds and resolution of the slider. Minimum value is 0.001 Hz, and maximum value is 1000 Hz. The frequency can also be set using the numerical inputs (11).
  7. If the HVPS is generating a square signal, you can programme a limited number of cycles to perform. Possible values are between 1 and 65535 cycles. The number of cycles can also be set using the numerical inputs (11). The slider is disabled if the HVPS is set to produce a continuous square waveform. This can be changed using (8). At the end of the cycles, pressing the on (1) button, or the push button on the PCB (S1) will start a new series of cycles.
  8. If the HVPS is generating a square signal, this button allows to change between a continuous square signal (infinity of cycles), or a limited number of cycles. In the latter case, the number of cycles can be set with slider 7.
  9. Allows to change the range of the cycle slider (lower and upper bound) by power of 10. The default range is 1 to 10. Pressing on (+) changes the range to 10-100, etc.
  10. This panel of indicators shows the current parameters of the HVPS. It allows to double check that the orders you give to the device are correctly understood. You can also check the feedback voltage value, which represents the voltage at the output of the EMCO. It is important to understand that the feedback voltage is not the voltage at the output of the HVPS. Indeed, to have the high voltage at the output, the HV switch must also be closed. This can be done by pressing the on/off button (1), or putting the HVPS in switching mode. The feedback voltage is present at the output if the HV LED on this panel (and LED D3 on the board) is on. If the voltage set point is >0, but the feedback voltage remains at 0, it is likely that the safety HV enable switch (S2) is off).
  11. Entering a precise value can be difficult with the sliders. You can therefore use the numerical input panel to set the voltage, frequency and cycle number. You can select values outside the slider range for frequency and cycles, and you are not limited to the resolution of the slider. Once you have entered a value, you can press OK (to confirm), Canc to cancel (close dialogue box without taking change into account or C to clear the value if you did a typing error and want to start again. For example, if you enter 1233.8 for the voltage setting and press Ok, the slider will indicate 1230, because it has a 10V resolution. However, the voltage set point in indicator 10 will show 1233, because the HVPS can set voltage with a 1V resolution.
  12. Shows the content of the memory. Some of the parameters are configuration and calibration of the HVPS (Name, PID coefficients, voltage calibration coefficients, etc.), but some other parameters indicate in which state the HVPS will be initialised when powered up. This can be useful if you want to run a demo that requires a configuration and you don’t want to enter it each time the HVPS starts. Unless required for this, the HVPS should not be configured to output a non-0 voltage on startup, as it can be dangerous for an unsuspecting user. The current state of the HVPS can be stored in memory with button 13.
  13. Saves the current configuration of the HVPS in the memory. When the HVPS is powered up, it will start with the parameters stored in memory. The saved information includes:
    1. On/off status (1)
    2. Switching configuration (2)
    3. Voltage and frequency (5, 6)
    4. Number of cycles (7, 8)
    5. Source of switching (3)
    6. Voltage control mode (4)
  14. Options button. It opens a dialogue box where options can be set. The Limit Voltage slider enables the user to set a voltage value (via slider or keypad) that must not be exceeded. If for example the HVPS can output up to 5kV, but it is used to drive an actuator that should not be driven above 3kV, you can limit the output voltage to 3kV as a safety measure. It will then be impossible to set a voltage higher than 3kV on the GUI, which can prevent accidental destruction of the actuator. The Button mode can be set between Latching and Push Button. It defines the behaviour of the manual switch S1: in latching mode, the state of the output is toggled between on and off each time the button is pushed and released, and in push button mode, the output is high as long as the button is pressed.
  15. Disconnect button. Press this to close communication with the HVPS and close the interface.
  16. Strobe setting pannel. You can generate a 5V pulse synchronised with the HV signal (when generating a square wave). Refer to this page for more information on this functionality.

Python Interface installation

Getting started

  1. Assemble a HVPS, including the low voltage and high voltage testing.
  2. Perform the initial configuration and calibration, using either the LabVIEW interface (point 2.1) or sending commands to the board (point 2.2).
  3. It is recommended to perform a calibration of the HVPS if you have a HV probe and a multimeter
    1. You can make make a manual calibration (point 2)
    2. If you also have a NI-DAQ platform, you can use the LabVIEW interface to perform an automatic calibration

Windows: using the executable file

  1. From the Download page, grab the archive and uncompress it somewhere on your computer
  2. Double click on the main.exe executable to launch the interface
  3. The interface opens. You must have an HVPS connected to the USB port, or you will get an error message.

Using the source code

Currently, we only have made an executable for Windows. If you are using OSX or Linux, you can easily launch the interface using the source code. This also applies to Windows if you want to modify the source code.

  1. Install Python 3 on your system.
  2. Install PySerial from command line (command prompt / terminal): pip install pyserial (if you have both python 2 and python 3 on your system, you may need to use pip3 intall pyserial).
  3. Get the from the download page and uncompress it on your computer.
  4. to run: python (must be done from the directory that contains the interface files. If you have Python2 and Python3 on your system, the command might be python3
    1. On Linux-based systems, you can use the file to start the interface. You may need to change the file attribute to give it permission to launch (chmod +x
    2. On Windows, you can create a GUI.bat file in the interface folder with the line
      python .\
      Double clicking on it will launch the interface. You can then create a shortcut to your desktop to easily launch the interface.
  5. The file install.txt contains more info on the requirement, installation, and configuration on different platforms.



Python HVPS user interface

In the spirit of our open-source project we are now developing a python interface to replace (or complement) the LabVIEW interface.

The python interface is multiplatform and can therefore run on Windows, Mac OS, Linux, etc. It is designed with touchscreens in mind, and is easy to use on tablets, or even a Raspberry Pi with the official 7” touchscreen.


Download 2.7

1 Board PCB files

1.1 v4b3

1.2 v4b2

2 Drivers and components

3 User Interface

3.1 Version 2.7.1

3.1.1 Multiplatform Python Interface

3.1.2 Labview Interface

4 Firmware

4.1 Single Channel HVPS

4.2 Multi Channel HVPS

4.3 Testing programs

5 Enclosures

5.1 Full Enclosure

5.2 Minimal Enclosure

6 Documents

  • Bill of Materials BOM_SHVPS_v4b2.xlsx
  • Poster presented at the 19th SPIE conference on electroactive polymer actuators and devices, Portland, OR, march 2017. HVPS_poster


Switching edges

Result of the switching speed measurement (click to enlarge)

The aim of this test is to characterise the shape of the high voltage square signal generated by the HVPS when in switching mode. It is also the speed at which the HVPS reacts when the on/off button of the GUI is pressed (i.e. when the the HVPS changes its switching mode from off to any other mode, or the opposite.

To perform this test, the HVPS is placed in switching mode and its output at different frequencies (1, 10, 100 and 1000Hz) is recorded. Press the Start button to launch the acquisition. The required recording time is displayed at the bottom left corner of the window. The test is performed at the highest voltage rating of the unit (e.g. 5000 V for a 5 kV HVPS).

Once the acquisition is finished, you can see the shape of the switching profile in the graph indicator. The frequency of the displayed curve can be chosen at the top right corner of the window between the 4 acquired frequencies. The lower part of the window gives a quantified description of the switching profile, such as the rise time and fall time. Typically switching time lower than 300 us can be obtained for a 5kV HVPS.

The button Save Data can be used to save the data in the excel file, whicle the Cancel button can be used to quit without saving the results.

Default and manual calibration

There are basically 3 options to calibrate the HVPS depending on the material that you have at your disposal. Using the default calibration (section 1) requires no tool but is the less accurate. You can perform a manual calibration (section 2) if you have a high voltage voltage probe and a multi-meter. The precision of this method depends on the number of point you take. Finally, if you have a NI-DAQ unit, you can perform an automatic calibration of the HVPS.

1 Default calibration

When you perform the initial configuration described in section 1.2 above, a default calibration factor is stored into the HVPS. The HVPS ADC transforms a 0-5V analogue voltage to a 10 bit values. It therefore expects to map 0 to 5V between 0V and the maximal rating of the HVPS. However, the resistive divider which steps down the high voltage to a value that can be fed to the microcontroller has a slightly higher ratio to enable the detection of an overvoltage. The ratio for the different HVPS voltage ratings is given on this page in column c1. When you perform the configuration mentioned above, the HVPS is initialized with a linear correction factor c1 given in the column c1 of the table.

This default configuration is a good guess, but is not extremely precise, due to the uncertainty on the resistance values and other imperfections. The graph below shows the error in volt between the set point and the true output voltage for a 5kV HVPS. It can be seen that the error is (for this particular unit) comprised between +/- 50 V, i.e. 1% of the full scale

2 Manual Calibration

It is recommended to calibrate each HVPS to increase the precision. We recommend to use the calibration routine included with the interface, but this requires some external equipment and components. If you don’t have them, you can proceed with a manual calibration. The only equipment you need is a high voltage multimeter probe that can sustain the full voltage output of your HVPS (such as the High-voltage probe, 34136A, Keysight). Although these multimeter probes have a defined voltage division ratio (typically 1000), a better accuracy can be obtained by performing a calibration of the probe (see section 2 of the automatic calibration page)

Here is how to proceed to perform a manual calibration:

  1. Establish a direct serial connection to the HVPS
  2. Set the calibration factors C0=0, C1=1, and C2=0 by issuing the commands
    SC0 0
    SC1 1
    SC2 0
    It is important to disable any correction before proceeding to the next step. setting C0 and C2 to 0 and C1 to 1 leads to no correction at all: y=c1 x = x.
  3. Connect the output of the SHVPS to the HV probe and the multimeter
  4. Launch the GUI
  5. Place the HV enable switch on position 1
  6. Select different voltages using the voltage set point dial. Write down the voltage read by the HVPS (feedback voltage in the GUI), and the voltage indicated by your multimeter.
  7. Multiply the voltage read on the multimeter by the probe ratio (e.g. 1000), or by your own calibration equation to obtain the true output voltage
  8. On a graph, plot the true output voltage form the previous step (y axis), as a function of the voltage read by the HVPS (x axis).
  9. Use curve fitting to obtain the correction coefficients. In a perfect linear world, we physically expect to obtain a curve of the form y=c1 x. However, we have found that a correction equation of the form y=c0 + c1 x + c2 x^2 leads to a much better accuracy. This 2nd order polynomial correction is implemented in the HVPS with the coefficient c0, c1, and c2. But you can easily used a purely linear correction if you prefer by assigning a value of 0 to c0 and c2.
  10. Once you have calculated the coefficients for your HVPS, close the GUI and establish a direct serial connection to the HVPS.
  11. Set the coefficients to the values you desire using the commands
    where is the value you want to assign to each correction coefficient. Important: there is a 1E-6 multiplier for coefficient c2: if you calculate a coefficient c2 of 1.45e-6, you have to enter the command SC2 1.45

2.1 Example

The graph above show a manual calibration of a 5kV HVPS with 14 points. The voltage read by the HVPS and displayed in the interface is on the x axis, and the voltage read by the voltmeter (after correction by the probe calibration) is on the y axis. A 2nd order polynomial is fitted to the data, leading to the equation displayed on the graph. To enter this calibration into the HVPS, the following commands needs to be used:

  • SC0 50.63
  • SC1 1.055
  • SC2 -4.84