Archive | Software

Python Interface, Keyboard input

Back to the Python HVPS User Interface

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

The Python user interface has been developed with touchscreen in mind (e.g. stand-alone configuration or running on a tablet). However, it can of course also be run on desktop or laptop, or any other platform with a keyboard. For those cases, we have included handy keyboard shortcuts to make the interface more convenient to use.

Shortcuts in the main interface window

Keyboard shortcuts in the main interface window

  • [<space bar>]: toggle output on/off
  • [s]: Change the switching mode (DC/Switching/Waveform)
  • [<right>]: increment voltage
  • [<left>]: decrement voltage
  • [<up>]: increment frequency
  • [<down>]: decrement frequency
  • [v]: display numerical input to set the voltage
  • [f]: display numerical input to set the frequency
  • [c]: display numerical input to set the number of cycles
  • [n]: toggle the number of cycles between infinity and finite number n
  • [z]: changes the resolution of the voltage slider (1 –> 10 –> 100 –> 1)
  • [x]: changes the resolution of the frequency slider (multiplies by 10 until fmax/10, then goes back to 0.001)
  • [k]: changes the lower bound of the frequency slider (between 0.001 and fmax/10)
  • [l]: changes the upper bound of the frequency slider (between fmin*10 and 1000)
  • [w]: toggle the right panel of the GUI between strobe mode and waveform mode
  • [m]: Display the content of the memory
  • [o]: Display the options dialogue box
  • [q]: quit the programme

Note that [z], [x], [k], and [l] can be useful to adapt the slider to one particular task. However, if the resolution or bounds of the slider needs to be from the default used when the interface starts, this can be done in the config.ini file.

Shortcuts in the numerical input dialogue box

Numerical input dialogue box

  • [0] to [9]: 0 to 9
  • [.]: decimal point
  • [<Enter>]: accepts new entered value
  • [<Escape>]: Cancel (closes dialogue box discarding the new value)
  • [<BackSpace>]: Deletes the rightmost digit (or decimal point)

Example

a few examples on how to use the keyboard for common tasks

  • Setting voltage to 4500V: v4500<Enter>
  • Toggles output off, change frequency to 2.5Hz, toggles switching mode to switching (from DC), toggles output on: <Space>f2.5<Enter>s<Space>

Download 2.8

General compatibility table

SHVPS firmwareMHVPS firmwareGUIPCBVersion summary
91.52.9v4b2, v4b3, v6b1Improved python interface and python library of functions
81.42.8v4b2, v4b3, v6b1python interface. Standalone version with battery.
71.32.7, 2.7.1v4b2, v4b3, v6b1Initial release of the PetapicoVoltron project

We recommend to use the first line of the table (i.e. the most recent version)

Most Recent Version: GUI v2.8 / SHVPS v8 / Board v4bx

Direct Access to file repository: https://osf.io/uwb25/

Below is the description of each file included in this release

General Files

PCBs

Software

Enclosure Files

Previous files for GUI v2.7 / SHVPS v7 / Board v4bx

Version 2.7

 

Python Interface, Switching mode with finite number of cycles

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 square wave switching between 0V and a user-defined voltage at a user-defined frequency, and for a limited number of cycles, use the following configuration:

Square signal with a limited number of cycles

Switching configuration for a limited number of cycles

  1. HVPS 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. ‘n’ symbol means the HVPS generates a limited number of square pulses.
  8. The slider (8a )is used to select the number of switching cycles to make. The range of the slider can be selected on a logarithmic scale with the ‘+’ and ‘-‘ buttons, with a resolution depending on cycles. Alternatively the numerical keypad (8b) can be used to enter the number of cycles (1-65535), irrespective of the slider range and resolution

When cycles are in progress, the number of cycles that have already been made are indicated in the information panel that displays the current state of the HVPS. Once the total number of cycles is reached, the counter is reset to 0, and the HVPS will turn off (1). A new series of cycle can be initiated by turning the HVPS back on (1), or by pressing the bush button (s1) on the HVPS.   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, 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. But the good news is that with release 2.9, additional functionality was implemented, and the Python interface now has most of the LabVIEW inteface functionalities. However, here is what is still missing:

  • The interface can only be used for the single channel (SHVPS) configuration. (i.e. no multichannel support.)
  • 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.

back to the Python Interface menu

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

Waveform panel

  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), Switching (square signal of defined amplitude and frequency), and Waveform (a user-defined waveform of low frequency, see (17))
  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. Serial listening mode is only used for the standalone configuration, and enables to connect the HVPS to a computer and to send commands directly, bypassing the GUI displayed on the touchscreen. Right panel display enables to select which panel to show on the right-hand side of the interface. The choices are Strobe mode (16) and Waveform (17).
  15. Disconnect button. Press this to close communication with the HVPS and close the interface.
  16. Strobe setting panel. Whether Strobe or waveform is shown when the interface starts can be defined in the config.ini file. Once the interface is launched, what is displayed on the left panel can be chosen in the Options (14).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.
  17. The strobe panel (16) can be replaced by the waveform panel to generate a user-defined output waveform of low frequency. Whether Strobe or waveform is shown when the interface starts can be defined in the config.ini file. Once the interface is launched, what is displayed on the left panel can be chosen in the Options (14). Refer to this page for a detailed explanation of the waveform parameters. The Python GUI implements the same functionalities as the LabVIEW interface. Briefly, a) allows you to select between a few type of pre-programmed functions. The custom option reads datapoint from the waveform.txt file to give full freedom on the waveform. b) gives the possibility to use the square root of the function shape, which can be useful when driving dielectric elastomer actuators, given that the relation between voltage and strain is quadratic. c) defines how many points to use per waveform period (not use for the custom option). d) defines the relative duration (as a fraction of the period) of the ramps for the Trapezoid waveform only. e) uploads the waveform with the current parameters to the HVPS. f) downloads the current waveform. If the HVPS is in Waveform mode with a voltage higher than 0, then it will also display the measured waveform.

back to the Python Interface menu

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), The Python library (point 2.2), or sending a command to the board (point 2.3).
  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. Be sure the drivers are installed on your system.
  2. From the Download page, grab the py-hvps-interface-exe_vx.x.zip archive and uncompress it somewhere on your computer
  3. Double click on the main.exe executable to launch the interface
  4. 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, Linux, or another OS, you can easily launch the interface using the source code. This also applies to Windows if you want to modify the source code, or use the HVPS class to write your own programmes.

  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 install pyserial).
  3. Optionally, if you want to be able to display the custom waveform within the interface, you need to install the Pillow library (pip install Pillow). Matplotlib is also required, but usually installed with Python. In any case, if these packages are missing, a warning message will be displayed.
  4. Get the py-hvps-interface.vx.x.zip from the download page and uncompress it on your computer.
  5. to run: python main.py (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 main.py)
    1. Alternatively, on Linux-based systems, you can use the file GUI.sh to start the interface. You may need to change the file attribute to give it permission to launch (chmod +x GUI.sh)
    2. Alternatively, on Windows, you can use the  GUI.bat file to start the interface.
      Double clicking on it will launch the interface. You can then create a shortcut to your desktop to easily launch the interface.
  6. The file install.txt contains more info on the requirements, installation, and configuration on different platforms.

back to the Python Interface menu

 

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. Keyboards shortcuts makes the use of the interface easy to use on a system with a physical keyboard.