Different calibration settings by using Scope WebApp and python API

Applications, development tools, FPGA, C, WEB
Post Reply
tdinapoli
Posts: 2
Joined: Tue May 30, 2023 6:56 pm

Different calibration settings by using Scope WebApp and python API

Post by tdinapoli » Sun Jan 21, 2024 10:30 pm

Hi all,

I recently updated my RP's OS to the latest stable version:

#######################################################################
# Red Pitaya GNU/Linux Ecosystem
# Version: 2.00-43f2d6cd9
# Build: 23
# Branch:
# Commit: 43f2d6cd994dfc684cd1e5e1c3ce85bab91e8e44
# U-Boot: "redpitaya-v2022.1"
# Linux Kernel: "branch-redpitaya-v2022.3"
# Pro Applications: ""
#######################################################################

by flashing an SD card. Because of that I re-calibrated my RP following this tutorial (automatic) https://redpitaya.readthedocs.io/en/lat ... ation.html.
After calibration, the oscilloscope readings using the oscilloscope WebApp seem fine.
Calibration parameters are for CH2 HV:
AA: 16901
BB: 193419
PP: 9830
KK: 14260634

Even though that works fine, I need to get the CH2 data through the python API, and here I stomp with a few problems:
1) There are different python APIs (the one on the jupyter notebook examples that uses mercury overlay and the one that is a wrapper of the C API shown here:
https://redpitaya.readthedocs.io/en/lat ... -exm1.html)
. I tried with both and both give me different results than the WebApp. For example, for a 5Vpp 100hz square wave with the jupyter notebook API and forced trigger I get this:
https://imgur.com/a/jB1DmdG
2) That is the best I could manage to get, but sometimes the trigger doesn't work properly and I get weird signals like in this picture:
https://imgur.com/a/v1rqhpc
Both APIs have these problems.
I didn't have these problems with the old version of the OS.
The code used for each acquisition is:
this one for the jupyter API:
https://github.com/RedPitaya/jupyter/bl ... rced.ipynb
This one for the C wrapper API:
https://redpitaya.readthedocs.io/en/lat ... -exm2.html

Why is this happening and how can I fix it?
What is the difference between the jupyter notebook (mercury) API and the API that is a python wrapper around C API? Which one should I use and why?
Why are the readings on the oscilloscope webapp right but wrong by using any python API? what API does the webapp use?

Thank you very much

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: Different calibration settings by using Scope WebApp and python API

Post by redpitaya » Mon Jan 22, 2024 12:00 pm

Hello tdinapoli,

Thank you for writing to us.

For a long time, the Jupyter Notebook used the Mercury image, but it had a major problem of not being documented well. For the past year, we have been working on improving the Jupyter Notebook. In the process, we created Python API commands, which are just a wrapper for the C API commands, and finally, with the 2.00-30 OS, we enabled the Python API commands in Jupyter.

The Mercury image is deprecated and will not be used in the future anymore. Now Jupyter Notebook uses the standard v0.94 FPGA image.

As for the image explanation:
- The spikes should be fixed by applying a 50 Ohm termination to your input.
- the second picture is what the start of the signal generation looks like. First, when the generator is enabled, the INIT voltage appears on the output (SOUR<n>:INITValue <amplitude>), then the signal starts generating.

If you are capturing signals at 100 Hz, you should consider putting some time delay between ACQ:START and ACQ:TRIG commands, as Red Pitaya needs some time to capture the samples (to fill the 16384 sample-long buffer). An insufficient time delay may result in old samples before the trigger delay (which is at 8192nd sample in the buffer, when ACQ:TRIG:DLY is set to 0).

I hope this helps. I used SCPI commands for explanation, but you can easily map this to Python API commands through the command table.

Please let me know if there is anything else I can help you with.

tdinapoli
Posts: 2
Joined: Tue May 30, 2023 6:56 pm

Re: Different calibration settings by using Scope WebApp and python API

Post by tdinapoli » Fri Feb 02, 2024 6:48 pm

I tried the solutions but nothing changed. The problem was that I was not setting the gain, I didn't know that I had to bc It is not done in any of the examples of the documentation in the official website. But thanks to your comment I found the header files of the C API that have the explanation for every API function.

Thank you very much for your help

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: Different calibration settings by using Scope WebApp and python API

Post by redpitaya » Mon Feb 05, 2024 2:17 pm

Hello tdinapoli,

I am glad you were able to resolve the issue. We will add the gain setting to the examples to make it clear.

Good luck with your project.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 95 guests