An open source GUI framework for RedPitaya based instruments

Applications, development tools, FPGA, C, WEB
yoelk
Posts: 7
Joined: Sat May 23, 2015 8:12 pm

An open source GUI framework for RedPitaya based instruments

Post by yoelk » Wed May 27, 2015 12:01 pm

Hello,
My name is Joel Koenka, I'm a PhD student in the University of Basel.

I have a question to the guys at RedPitaya. I tried sending this through the "Contact" link but didn't get an answer.

In the past 2 years I've developed an open-source software framework (written in Python) to create GUI programs for custom-made instruments.
I called it Instrumentino, because I started working with Arduino boards to control my instruments, but I soon realized this doesn't have to be the case and I wrote it in such a way that multiple hardware controllers of different types can be used.
I've also published two scientific articles about it (https://github.com/yoelk/Instrumentino/ ... /documents).

I chose Python as the GUI programming language because of its inherent cross-platform nature but mostly because it's such an easy programming language, and Instrumentino users would be other PhD students and system developers which don't necessarily have a strong programming background. I've put a lot of thought into this and I also considered using HTML (for cross-platform support) but since it's much easier to program in Python, I'm convinced it's the best solution.

These days I'm preparing version 2 of Instrumentino, using Kivy as the graphical framework, and I aim to be able to run Instrumentino on PCs and mobile devices (phones, tablets) alike.
There are many other planned improvements for V2, which I believe will make it an outstanding free program for instrumental control.

One of the items in the list is to get Instrumentino working with RedPitaya for high data throughput applications, and I already have a specific application in mind - an open-source Capillary Electrophoresis system for environmental monitoring, which is in the middle of a startup company initiative I'm involved in, so if it works, we'd order a lot of RedPitayas :)

For RedPitaya to work with Instrumentino, it needs to run a program called controlino, which is very similar to your SCPI server, but with slightly different abilities.
I saw your SCPI command documentation and wanted to look at the code, but couldn't find the source code in your GitHub repository (only a compiled library).

So I have a request and a proposition:

1. Could you please share the source code for your SCPI server? I feel a bit silly writing it from scratch if you've already implemented it.

2. I'd like to propose Instrumentino as an official GUI program for RedPitaya instruments.
I think many of our interests are in line, and that a collaboration between us would be very fruitful for both parties. Please have someone from the development or management team to contact me.

Thanks and have a nice day,
Joel

Karri Kaksonen
Posts: 24
Joined: Mon Dec 29, 2014 7:09 am

Re: An open source GUI framework for RedPitaya based instrum

Post by Karri Kaksonen » Fri May 29, 2015 8:58 am

Hi Joel.

A few comments about your approach.

Using Kivy is a very good move. The benefits of Kivy is multi touch and kinematics that is very nice for tablets.

Python is also a good choice. One thing we have been using is an architecture where the "controllino" provides values to a large table. Many old fashioned industrial monitoring systems use this kind of approach. In Python you can easily create bindings to scales that automatically change whenever the content in some table cells change. This is kind of parallel programming where callbacks take care of the gauges.

Perhaps you could add this kind table API to your programming? It would keep all the sensors in a place somewhere and you could then create different views to the data using Kivy. For visualizing data Kivy would be a good choice to view 3D models, have playback of stored data etc. Keep up the good work. And thank you for sharing. This is what Open Source is all about.

I hope that someone from redpitaya contacts you about your question about getting sources for the non-open source parts.

Best regards,
Karri

yoelk
Posts: 7
Joined: Sat May 23, 2015 8:12 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by yoelk » Fri May 29, 2015 9:32 am

Hi Karri,
Thanks a lot!

You said that Kivy would be good for data visualization. Do you already know a project using Kivy this way (visualizing experimental data)?
This is something I don't want to write from scratch so I'm looking for the right library to use.
As I have yet to find something fitting in the Kivy/Python world (perhaps I didn't search well enough), I've turned to Java.
Next month I'll give a talk about Instrumentino in eclipsecon in Toulouse, where I'll meet some of the people from the Eclipse science working group.
They have very strong libraries for experimental data visualization so I hope to make the right contacts there and embed their Java code in Instrumebntino (probably using pyjenius).

But if you already know of another library, I'd be happy to hear about it.

BTW, if you're interested in joining us in order to develop Instrumentino v2, you're very welcome!
We've just recently started and there's much to do :)

Have a nice day,
Joel

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by pavel » Fri May 29, 2015 11:14 am

I chose Python as the GUI programming language because of its inherent cross-platform nature but mostly because it's such an easy programming language
Do you already know a project using Kivy this way (visualizing experimental data)?
This is something I don't want to write from scratch so I'm looking for the right library to use.
Have you considered PyQtGraph or PyQwt?

They are not using Kivy but they are still Python libraries and there are some data acquisition projects that are successfully using them.
Here is a couple of examples:
https://github.com/xmikos/qspectrumanalyzer
http://pymca.sourceforge.net

What would be the advantage of your framework compared to the SCPI+Python+PyQt+PyQtGraph combination?

yoelk
Posts: 7
Joined: Sat May 23, 2015 8:12 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by yoelk » Fri May 29, 2015 11:31 am

Thanks for the pointers.
I'll have a closer look at them.
I'm also looking for a library that has advanced features like automatic peak identification and integration.

As of the advantages of using Instrumentino, I didn't really understand the question.
Of course you can combine SCPI+Python+PyQt+PyQtGraph, and this is more or less what I do in Instrumentino.
It's just that you have to do it, right? :)

Until now I haven't found a ready open-source project that can replace Instrumentino.

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by pavel » Fri May 29, 2015 12:56 pm

Are there any examples of how to use Instrumentino? I've checked the github repository, looked through the first article but still don't understand how to use it.
Until now I haven't found a ready open-source project that can replace Instrumentino.
I don't know how it compares to Instrumentino, but I've seen that it's possible to use Scilab/Xcos to control some instruments:

https://atoms.scilab.org/categories/instruments_control

including Arduino:

https://github.com/fizcris/Scilab_Xcos_ ... id_MPU6050

https://www.youtube.com/watch?v=4Z-3W1EFe0A

yoelk
Posts: 7
Joined: Sat May 23, 2015 8:12 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by yoelk » Fri May 29, 2015 2:03 pm

Interesting. I came across it last year but didn't realize Scilab can be used this way.
I guess an Instrumentino equivalent could be built on the Scilab platform, but I don't suspect (correct me if I'm wrong) it could be deployed as a standalone application nor work on mobile devices (which is why I use Kivy for v2 of Instrumentino).

Sorry for not having too many examples on Githhub. But at least one good example is there:
https://github.com/yoelk/Instrumentino/ ... 0%28MFC%29
We built an MFC control box for 4 MFCs using an Arduino.

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by pavel » Fri May 29, 2015 2:05 pm

I'm also looking for a library that has advanced features like automatic peak identification and integration.
In case of Red Pitaya, the peak identification can be easily done on the FPGA. For example, here is an IP core that detects minima/maxima and measures pulse height (max - min):

https://github.com/pavel-demin/red-pita ... lyzer_v1_0

I'm using it for a multichannel pulse height analyzer.

The peak integration should not be much more difficult.

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by pavel » Fri May 29, 2015 2:32 pm

Thanks for the examples!

You are right about SciLab on mobile devices.

Actually, I'm not sure if Python would be a good choice for mobile applications. Even on a PC, some applications written in Python are quite slow.

Have you looked at the Qt/QML combination? It's mobile friendly, WebSockets can be used for the client/server communication, JavaScript can be used for UI and high level logic, there is a basic open source plotting library. There is also a very nice looking visualization library from Qt but unfortunately it's not open-source.

I'm currently using Qt and QML for a Red Pitaya based project and I'm quite happy with this combination.

Here is a couple of interesting links:

http://doc.qt.io/qt-5/mobiledevelopment.html
http://doc.qt.io/qt-5/qtqml-index.html
http://doc.qt.io/qt-5/qtwebsockets-index.html

yoelk
Posts: 7
Joined: Sat May 23, 2015 8:12 pm

Re: An open source GUI framework for RedPitaya based instrum

Post by yoelk » Fri May 29, 2015 3:02 pm

Well, Instrumental control GUI programs typically shouldn't take up soooo many resources.
The only real "heavy" part might be graphically presenting high sample-rate data, but I'm sure it can be solved by skipping points according to the current zoom the user has on the graph. I don't think Python's inherent slowness because of being an interpreted language will put up big difficulties. Yet of course I might be wrong (hope not)...

I chose Python because it's an easy language to learn and master - and this is very important in my eyes.
Not necessarily to make my life easier, but to make the lives of users easier.
Users of Instrumentino are typically PhD students that build a new experimental setup. They're not necessarily experienced programmers, and I'd like to keep the programming effort to set up the GUI for a new system to a minimum. This was my first guiding point - hence the choice of Python over other web based cross platform solution or Qt, though I'm sure you can generate really nice outputs with them.

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 56 guests