Author Topic: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG  (Read 50989 times)

0 Members and 1 Guest are viewing this topic.

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #150 on: September 17, 2024, 01:54:42 pm »
In order to make espbode (or the python script) into a siglent emulating SCPI frontend for any AWG, that respects at least some of the standards, 3 loops/threads/processes are needed:
  • 1 that does portmap on UDP (this part is used for broadcasts/discovery and by the HD scopes)
  • 1 that does portmap on TCP (this part is used by direct VISA communication, as with the non-HD scopes
  • 1 that does the VXI-11 communication (on TCP)
The latter should switch to a new port after every LINK_DESTROY, and communicate the new port to the port mappers.

Made this work in the python version, in today's commit. Previously it only ran 1 of those loops at a time, which messed up communication with other SCPI tools.
Haven't really looked yet at how espbode does it.

Thanks, bateau. The espBode code assumes a sequential process, and of course at the moment, does not correctly respond to the HD scopes. It does not change ports, and it does not check the AWG to be sure the command succeeded. (At least for the FY6900 driver, it checks only for the newline character that is returned whenever a command is issued.) There is an interesting quirk in the code where it sends some commands twice, "because the AWG doesn't always respond the first time," and yet at the same time it also has some code to avoid repeating the same command when it has been issued by the scope - a comment says that the 1000-series scopes repeat some commands. All of this, and much, much more, is why this code is overdue for a complete rewrite.

I did have a chance last night to do a q&d test of UPD communication, just enough to verify that I can receive the expected 56-bye packet. Hopefully later today I'll have time to work up the rest of code to respond, change ports, etc.

I look forward to reviewing the changes you've made to the python code to allow the various loops to occur in tandem, rather than sequentially - and again, thank you for your tremendous help and work on this project!
 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #151 on: September 17, 2024, 07:40:42 pm »
Hi awakephd,

I made the driver for the FY3200.
 
The following users thanked this post: awakephd

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #152 on: September 18, 2024, 03:30:09 pm »
Thanks! I will include that in my "history" of the program.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #153 on: September 19, 2024, 12:29:33 am »
bateau,

I have been working on a q&d implementation of the espBode code that will handle a UDP bind request. I think I am almost there, using your python code as a reference. But I am not understanding the next-to-last line of your process_rpcbind_request_udp method:

self.rpcbind_socket.sendto(resp_data, address)

Does this send back to the originating IP and port? How does it get the data length? I would have thought the format would be sendto(buffer, length) - but "address" doesn't sound like a length.

For that matter, I am confused by the line near the start of the method where you set address as follows:

address = bytesAddressPair[1]

This would seem to set address to equal the address of the buffer + 1 byte (maybe??).

As is probably obvious, some of my confusion has to do with minimal knowledge of python. Any help you can give will be most appreciated!

By the way, I tried to figure out if there was a way to contact you via the github repository, but I could not figure out how to do that. :(
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 288
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #154 on: September 19, 2024, 05:25:54 am »
PM sent.
 

Offline Reemuson

  • Newbie
  • Posts: 3
  • Country: au
    • Ryan Dynamics
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #155 on: October 02, 2024, 01:28:47 am »
Hey, first time post and I thought it was important.

If you're using any version of ESPBode, please note that for the ESP-01 non S the inbuilt LED is sharing the pin with TX. So you'll need to comment out any LED related code in order to get serial communication.

I unfortunately didn't realise this :palm: and spent a long time re-writing code trying to figure out why nothing was communicating thinking it was a driver issue. (At least I have some tidier code and have a deeper understanding of what's going on in the code base)
 
The following users thanked this post: awakephd

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #156 on: October 08, 2024, 01:03:09 pm »
Reemuson,

Many thanks for this information! I do have the S version, and was not aware of the potential problem. I'll add that to my code so that people can leave out the LED if they have the -S version.

Meanwhile, if anyone is interested in seeing where I am taking the espBode project, I'd welcome comments and suggestions. My repo is here: https://github.com/awakephd/espBode/tree/version-2.0

Note that this is the version-2.0 branch, not the master. The master branch in the repo is only slightly edited from the hamhackin fork, enough to try to consolidate the changes that were made by Knutselaar and to rig up a rudimentary test of UDP binding.

The version-2.0 branch is essentially a rewrite from the ground up. It draws on the previous espBode versions and on the insights provided by bateau020 in his sds1004x_bode python version, but very, very little of the original code will make it into this new version. This version attempts to take advantage of C++, but without incurring significant overhead. An example of the latter is that I am avoiding the use of C++ strings, except where required by a couple of libraries - though the Arduino libraries have worked hard to reduce overhead in their String implementation, I am trying to avoid it altogether.

The current (and only) commit to the version-2.0 branch contains the overall structure up to the point of successfully communicating with the oscilloscope. I'm now working on parsing the SCPI commands and translating them for the non-Siglent AWGs. Thus, still a ways from a fully working product, but more than enough to see where I am going with it. Again, should anyone be interested in taking a look, I welcome suggestions, corrections, gentle ridicule, or other helpful comments! :)
 
The following users thanked this post: bateau020, Knutselaar

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #157 on: October 09, 2024, 08:33:59 pm »
More progress on espBode version 2 - I have just committed changes that implement parsing of the SCPI commands from the oscilloscope. The "only" thing left is to set up the AWG base class, then create the specific implementations for the various AWG versions.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #158 on: October 14, 2024, 01:01:31 am »
I am pleased to announce that espBode 2.0 is now working! This represents a complete rewrite from the ground up. While it definitely owes a debt to the earlier espBode versions, this is not simply an edit of those; it is an entirely new program, written to take advantage of C++, and hopefully much more robust.

So far, I only have the code for the FY6900 with recent firmware, but the way I have implemented the code, it should be trivial to add any other FY models.

The key difference among these models seems to be the format and magnitude of the value they send and receive for the various parameters. For the FY6900 that I have, with firmware 1.5, it takes a floating point value to set frequency (in Hz), amplitude (Vpp), offset (V), and phase (°). For example, to set the frequency on channel 1 to 103.27 Hz, one sends the command "WMF103.27".

It would make way too much sense for it to return the same sort of value when reading parameters. And indeed, it does return the frequency as a floating point number (in Hz): Send the command "RMF" to the FY6900 (read main-channel frequency), and it returns 00000103.270000 - zero-filled before and after, but as noted above, the zero-fill is not required when setting the value.

Unfortunately, reading amplitude, phase, and degrees does not return the value in a floating-point format, but rather as an integer ... and the magnitude is not consistent. it returns amplitude as an integer that equals the Vpp * 1000, but it returns both offset and phase as integers that equal the value * 1000. Go figure! (I have not looked to see what duty cycle or other such commands do, since those are not used in the Bode plot, but I am guessing there are other delightful inconsistencies there.)

My implementation uses a "translation table" that tells the software what sort of value to send and to receive, and how it needs to be adjusted for magnitude. Thus, changing from the current FY6900 to, say, a FY6600 requires only determining the format of the send and receive values, and filling in the table accordingly.

I should add that, while I have tested this version (and gotten a beautiful Bode plot of a single-transistor Class A amplifier, attached below), I have not yet tested this exhaustively. Moreover, bateau020 has been giving extraordinarily helpful feedback, particularly with respect to things that are going on at the network level (e.g., responses that might "work" but are ultimately in danger of crashing the wifi); there may be more tweaks needed in response to that feedback. And beyond all of that, there is still work to be done to document everything - I have included a lot of comments, but there is some code that still needs comments, and I need to revise all of the comments to be a more standard format.

Still ... I am beyond delighted to have a working version, and I would very much welcome any input, suggestions, questions, etc. Github repository is here: https://github.com/awakephd/espBode/tree/version-2.0.
« Last Edit: October 14, 2024, 01:07:03 am by awakephd »
 
The following users thanked this post: bateau020, Knutselaar

Offline sp9bsl

  • Contributor
  • Posts: 10
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #159 on: October 27, 2024, 10:26:21 pm »
Thank you Andy and the rest for your work and sharing it here!
I'd like to inform you that it worked for me. My SDS1204X HD works now with FY6900 without problems. One minor issue is the include file for credentials.

You should change in main .ino file in the 6th line:
Code: [Select]
#include "credentials.h"
to
Code: [Select]
#include "credentials_format.h"

 

Offline sp9bsl

  • Contributor
  • Posts: 10
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #160 on: October 31, 2024, 07:28:33 pm »
Andy, one more thing: I had to change the frequency exponent from 0 to 1 in pt6900 array. In my case frequencies synthetized by FY6900 were 10 times lower.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #161 on: November 02, 2024, 02:16:28 pm »
sp9, thank you so much for this feedback! I am especially delighted that it works with the SDS1204X, since I do not have a way to test with anything other than my SDS804X.

Can you tell me what firmware your FY6900 is running? I have been aware that there are different versions of the FY6900, and have been debating how to account for all of them. One though I have had is to work up a "setup" routine that could be accessed via telnet, which would lead the user through setting and verifying results, then write the correct pt6900 array out to eeprom.

On the include file - I was trying to set up a system where I could have my private credentials in a file that I could set to be ignored by git - but still show how the credentials file should be set up. My idea was that people would copy the credentials_format.h file over to credentials.h with the proper login credentials. I would welcome a better way to do this - I have scratched my head over it, and done a fair bit of searching on the internet, but this is the best I have come up with so far.

If any others use this code, I will greatly welcome additional feedback, especially for how to configure it for various FY models!
 

Offline sp9bsl

  • Contributor
  • Posts: 10
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #162 on: November 02, 2024, 06:34:54 pm »
Hello Andy,
my FY6900 has firmware v1.3 installed, I bought it over 5 years ago. It is sad that Feeltech doesn't allow firmware upgrade but I knew it at the moment of buy.
This would be great if settings could be changed without removing ESP from FY, reprogram and then put it back. Although, in my case I did it twice and everything works fine now.
Regarding the credentials file, your idea is ok I didn't think this way. I think you should move branch version-2.0 to master and write info about credentials file to readme.md just to save other initial problem with build.
Anyway, thank you for your work, now I can set sweep frequency above the limit of 25MHz which original stuff has. In my case I can work up to 40Mhz, for some reason ESP hangs above this frequency loosing  connection with oscilloscope.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #163 on: November 02, 2024, 07:19:53 pm »
Hmm, interesting on the problem above 40MHz. I haven't tried anything going that high - mostly I need up to 10MHz or so. I'm guessing there is some problem with EMD at the higher frequencies. I have thought about going ahead and sending the simple interface board that I built using toner-transfer over to JLCPCB and have some "real" boards printed ... maybe some better shielding on the board would help? (High speed noise is definitely getting into the territory where I don't actually know what I'm doing ...)

Based on what others have said in this and other threads, I think they must have changed the interface slightly between 1.3 and 1.4. If you looked at my comments, you will see that the interface on 1.5 is very inconsistent, and I'm guessing it may be equally but differently inconsistent on 1.3 and earlier as well. :(

Have you tried the "passthrough" mode? If you telnet into the ESP-01 when it is connected to your FY6900, you can type passthrough and it will toggle the passthrough mode. When passthrough is on, you can type into the telnet interface and it will relay it to the serial port, and vice versa - in other words, you can telnet directly into the serial interface. In this mode, if you type WMW123456.12345678 and hit Enter, what does your FY6900 show as the set frequency? And if you then type in RMF, what does it send back?

Based on what you have said, it appears that firmware 1.3 is shifting by a factor of 10 ... but is it catching all of the decimal places? On mine, I can set, e.g., 12345678.12345678 and it will show up as 12,345,678.123456 Hz - six digits after the decimal, up to eight digits before. From what I have read, it sounds like some units need to have the value sent as an integer scaled by 1000, so that sending WMW123456789 becomes 123,456.789 Hz. The "translation table" should be able to take care of anything like that - or at least that was my goal. I would love to get several others with various models testing this, so that I have a better understanding of whether my code will work "universally" (with the right settings in the translation table) or whether there are still some bugs in there.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #164 on: November 11, 2024, 12:07:47 am »
New developments on the new espBode2.0:

Merged the version-2.0 branch into master
Renamed the repository as espBode2.0 (https://github.com/awakephd/espBode2.0.git)
Extensive documentation including doxygen tags
Added doxygen documentation in docs/html

On edit: off-line conversation with bateau020 helped me see that it is better to leave the repository as espBode and instead use a version tag. As soon as this reaches a point where I am ready to consider it "done for now," I'll generate a release and tag it as v2.0. Thus, the repository remains https://github.com/awakephd/espBode.git
« Last Edit: November 11, 2024, 08:57:23 pm by awakephd »
 

Offline lololo

  • Contributor
  • Posts: 16
  • Country: ch
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #165 on: November 17, 2024, 05:25:55 pm »
hello, nice job!
I have a jds2900 and i would like to know if espbode is compatible? Apparently, it is the same as the jds6600, there is just the case that changes. Inside there is a connector that i could use with a level shifter to put an esp.

 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #166 on: November 18, 2024, 01:16:16 am »
hello, nice job!
I have a jds2900 and i would like to know if espbode is compatible? Apparently, it is the same as the jds6600, there is just the case that changes. Inside there is a connector that i could use with a level shifter to put an esp.

Thanks! And yes, it should be possible to set up the jds2900 to work with espBode. The key is getting hold of the Serial/USB protocol. I tried to find a manual on-line, but thus far the only thing I've found wants to charge me to download it. The little bit I could see without paying looks like it uses a different protocol than the FY series - different, but shouldn't be any trouble to work with once I know what it is!

Do you have a copy of the communication codes / USB protocol / programming guide / whatever it is called? If so, if you could scan and send it to me (or send an electronic copy), that would be super helpful!
 
The following users thanked this post: lololo

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 288
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #167 on: November 18, 2024, 07:30:08 am »
JDS6600 has an implementation in the python version (https://github.com/hb020/sds1004x_bode), so that might be a start. That device uses quite different commands from the fy devices. Example: ":w23=25786,0."  sets the output frequency of channel 1 to 257.86Hz.
« Last Edit: November 18, 2024, 01:20:22 pm by bateau020 »
 
The following users thanked this post: awakephd

Offline lololo

  • Contributor
  • Posts: 16
  • Country: ch
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #168 on: November 18, 2024, 08:56:24 am »
Thanks for your answer, I will try the python version. (I confused JDS and FY 🤦‍♂️)
Here is the pdf of the protocol just in case :-D
Have a nice day.
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 288
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #169 on: November 18, 2024, 01:19:49 pm »
First glance tells me it is rather similar to the JDS6600, so that driver might work. Let me know if you find any issues.
 
The following users thanked this post: lololo

Offline lololo

  • Contributor
  • Posts: 16
  • Country: ch
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #170 on: November 18, 2024, 01:27:56 pm »
Yes, Thanks !
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 167
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #171 on: November 20, 2024, 01:03:08 am »
Thanks for the protocol .pdf; that will help. It does look like it is similar if not identical to the JDS6600 protocol. Bateau, I took a quick peek at the Python code for the JDS6600, and figured I'd start with that.

Currently in the midst of improving the asynchronous interaction, so that a failed serial command can be cancelled by a DESTROY_LINK command. When I get that sorted, I will start working on implementing other scopes, e.g., the JDS2900.
 
The following users thanked this post: lololo


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf