Search This Blog

Thursday, December 30, 2021

An SDR For All Seasons

 

 Random Internet screen shot of Vintage Lock-In Amplifiers

I recently acquired one of the Open Source, Analog Devices Pluto Software Defined Radios (SDR) [1] to do some experiments on making a DC-1 GHz Lock-In Amplifier out of it. Since I had some questions when starting it up and I saw that the Internet had some confusion also, I thought I would add my findings and research.
 

Figure 1 – My Pluto connected to my trusty, 45-year-old HP355D, 100 dB Attenuator, to simulate the loss of a test sample in my initial Lock-In Amplifier investigations.

The Analog Devices Wiki for the Pluto [2] does a great job of getting you the right drivers, etc. They also have a demonstration program called “IIO Scope” which is a quick way to get the device running. They also have videos on the web that go through a lot of this.

I suggest that you follow the directions from the Wiki [2]. I run Windows 7 / 10 and I had no issues with any of the drivers or IIO Scope.


Frequency Extension

[Edited  9Jan22 - This section works for all Pluto's so far. If you have a Rev D PCB and want the frequency extension AND access to the other two RX/TX channels, skip ahead to the next section.]

The first issue that comes up is that Analog Devices is somewhat unclear about modifying the software configuration to extend the frequency range from 325-3800 MHz to 70-6000 MHz (Figure 2). They kind of lead you the believe that this configuration modification is only available for the very first devices that they made (Figure 2). Upon further research, it turns out that even the current Matlab Toolbox does this configuration upgrade on every device, and it does indeed work on my Rev C software, Rev D PCB (The current design as of Dec 21).

Figure 2 – The note from the Analog Devices Wiki is unclear as to the ability to do the frequency range extension configuration change for all Pluto’s – but it does indeed work for ALL Pluto's ever made (as of Dec 2021).

The exact commands used for the Frequency Extension Configuration Change are also somewhat muddled on the Wiki, but for the current Rev C / Rev D PCB Pluto the commands shown in Figure 3 are all you need. To log into the Pluto I just used the serial terminal that I use for embedded debugging as the Pluto enumerates itself as a Serial COM port also. See the Device Manager in Windows to find the COM port where the Pluto has been enumerated as. The default user name is: “root” and the password is: “analog” (without the quotes). Again this is all on the Analog Devices Wiki.
 
Figure 3 – Log in to the Pluto with your favorite terminal program and type the commands as shown above and like magic you will have an extended frequency range Pluto. (Rev C / Rev D PCB running FW Version 0.32, these commands may change in the future, this is current as of Dec 2021).

You can use IIO Scope to confirm that the device will now sample at 61.44 MHz and tune to 6 GHz as shown in figure 4.

Figure 4 – By running IIO Scope you can confirm that the configuration changes now work. The Properties panel now will let you set the bandwidth, sampling rate, and upper-frequency range to the enhanced limits as shown.

 

Possibly Useful Configuration Changes

[Edited- 9Jan22 - This section is for Rev C Pluto's with Rev D PCB's only]
The Pluto has a single RX and TX port to the outside of the box via SMA connectors, but the AD9363 transceiver chip that the Pluto is based on has two RX and two TX ports. The Rev D PCB has the extra two ports pinned out to UFL snap connectors that are populated on the board (inside the case). There is a configuration command that activates the firmware in the Pluto to be able to access these two extra ports. The command is,

fw_setenv mode 2r2t

However, there is a problem with the Firmware Version 0.32 that my Pluto arrived with. According to a post on the Analog Devices User Forums [3], there is an issue that prevents the 2r2t command from actually surviving a reboot. So it won't work.

The post describes that you should download [4] the latest firmware zip file, yes the entire zip file, place it in the root directory of the Pluto's onboard drive and then follow the rest of the procedure to upgrade the firmware as detailed here [5]. Today (January 2022) the latest version of firmware is 0.34, that is what I used.

With FW version 0.34 to get both the extended frequency range and the 2 RX and 2 TX paths enabled use these commands,

fw_setenv attr_name compatible
fw_setenv attr_val ad9361
fw_setenv compatible ad9361
fw_setenv mode 2r2t

Then reboot the device. So far this has worked for me - Now I have both extended frequency range and both RX / TX ports enabled.

If you have problems and the settings get confused, just re-update the flash to get everything to a known state and try again. If things go badly, you can always revert to the version that your Pluto shipped with.

Firmware updates always scare me, but I updated my Pluto about ten times today trying different versions out and they all went just fine. So just follow the instructions here [4] and it will all (probably) be fine.

To change back to 1r1t mode just use this command then reboot the Pluto,

 fw_setenv mode 1r1t

Note: Setting the 2r2t mode reduces the maximum sampling rate from 61.44 MSPS to 30.72 MSPS.


Useless Configuration Changes

There is a lot of 'chatter' on the internet on turning on the second ARM core in the ZYNQ FPGA that is used in the Pluto. No one pushing this change can point to any real benefit, however. 

Remember, the XC7Z010 FPGA is not a multicore Intel i7 processor, but instead has two seperate high-performance ARM cores that can indeed share peripherals, but they aren't "multicore" in the same sense as a modern Intel i7 processor that can 'spawn' threads quite easily onto other cores. Hence the standard Pluto firmware won't use the other core, just because you turn it on.

Analog Devices 'official' response is: Is it won't do any good on the standard Pluto (See below). If you are going to write custom FW for the Pluto then, yes by all means you can use the second core as you wish. All that turning on this core will do for the standard Pluto is again 'presumably' turn on the second ARM cores clocks and probably consume more power without any benefit to the standard Pluto.

 


If you read or watch any of the Analog Devices Webinars, then Robin will be a familiar name to you. Here is his take on turning on the second ARM core on the stock Pluto. Bottom Line: It won't help you at all. Source: SignalsEverywhere Youtube channel.

The Analog Devices Wiki documents all the firmware configuration options that may be set - see Reference [6] below.


RF Performance

So the next question that arises is: “What is the performance”, well I have not tested the EVM yet, but just doing a CW source to Single-frequency receiver FFT shows that the uncorrected response is perfectly fine for what this device was designed for, there is no undue roll-off in the extended frequency bands, so excellent job Analog! (See Figure 4).

 

Figure 4 – Using the freeware program SATSAGEN [7] getting a source to receiver plot is easy. This plot, made without any corrections shows a very flat source to receiver response curve over the full 70-6000 MHz frequency range is just over 2 dB peak-peak. I did use a 10 dB attenuator between the TX and RX ports on the Pluto to improve the match.

I also measured the match of the RX and TX ports on my Network Analyzer as shown in Figures 5 and 6. The match is also perfectly acceptable for what this device is intended for.
 
Figure 5 – S-Parameter Plot of the RX port match over the full frequency range. This is perfectly usable for what this device was intended for.
 
Figure 6 – S-Parameter Plot of the TX port match over the full frequency range. This is perfectly usable for what this device was intended for.


Software Compatibility

I found that the Pathosware open-source collection of tools [8] was the easiest way to get GNU Radio and the Pathos Flow programs running on a Windows PC. The only gotcha that I found was that the current release needs Python for Windows 3.9.0 installed. The current Python release is 3.10 and this did not work for me. This information is current as of December 2021 and will change in the future, so be sure to check the Pathosware release notes. I had issues getting the SDR radios to show up with every other release of GNU Radio for Windows install that I tried, but Pathos ware worked the first time out of the box. This is probably because Pathosware uses its own SoapySDR radio drivers. Pathosware also has excellent tutorials on GitHub along with instant help (I got a question answered the same day).


Programming With Other Languages

It looks like Analog Devices has a pretty robust binding package for Python, but my go-to language is C#. Analog Devices also has C# bindings on the Github page [9] and I was able to build a working example in an hour without any major issues, that’s a first, I assure you! Just start a .NET Framework project using a Winform or Console project, and add all the *.cs files from the Analog Devices Github c# bindings to your project. You don’t have to add any references to any DLL’s as Windows will find the proper DLL's at runtime.

On my first compile, I got the error as shown in Figure 6. I searched for this error and found a Forum Post at Analog Devices that told me that this was because I had my C# program in “Any CPU" mode and that the DLL that is referenced is a 64 bit DLL. So by changing the program to "X64" mode this error went away.
 

Figure 6 – If you get this error from the Analog Devices C# example program, then switch to “X64” mode instead of “Any CPU”. The reason is that the DLL being called here is a 64 Bit DLL and won’t work in 32 bit, "X86" mode.

The only other error that I found was with the initial context instantiation in the supplied Example Program. The sample IP address shown in the Example Program is not correct.

You can address a locally connected Pluto one of three ways,

1) Through the USB descriptor (USB:3.7.5) (Your exact digits will be different, here and will change every time the Pluto is plugged into a different USB Port on your PC, so beware).
2) Through the default Pluto IP Address (ip:192.168.2.1)
3) Through the string: “ip:pluto.local”


To verify these Addresses, open a Command Prompt window and type: “iio_info -s”, the results will be something like as shown in figure 7.
 

Figure 7 – The command “iio_info -s” will show you the possible descriptor strings that you can use with the C# bindings to open your Pluto. Don’t worry about the warning (see Red Arrow above), apparently this is not important, and I have even seen it in some Analog Devices Webinars and they go right past it, so it is not an issue. The important bits are the USB descriptor, shown here on my PC as: [usb:3.7.5], note however that this number will change every time you plug the Pluto into a different port of your PC, so beware. The second descriptor is the IP address shown here as “192.168.2.1”, and the third, and easiest one to use is the “ip:pluto.local”, this last descriptor never changes.

If you only have one Pluto connected to your PC then this is the way to go, just use the descriptor “ip:pluto.local” and be done with it.

If you are going to have multiple Pluto's connected then see the Analog Devices Wiki on how to change the default IP address as you will probably want to give each Pluto a unique IP address and then use that as the context descriptor.

 

Figure 8 - An excerpt from the the Analog Devices C# Example program, this context descriptor is not correct for most Pluto users, you should use instead the descriptors as shown in the list above and figure 7. The safest descriptor for most people to use is: "ip:pluto.local".


Conclusion

The Pluto uses a LINUX Industrial IO (iio) interface that also can be wrapped for windows. This is a great concept and one that works well. Overall the entire Pluto Eval Board and Software Ecosystem is very, very well thought out and well documented. Pluto works with nearly every open source SDR tool out there and is a great tool for teaching digital communications concepts. It is even is a passably good scanner receiver even without any filtering or amplification on the input.

I am running my Pluto on a very low performance Dual Core/Windows 7 computer in the lab and it works just fine, so there are not a lot of performance constraints on the host PC's horsepower either.



Extra Bonus – Filter plot

SATSAGEN has a tracking generator/receiver mode that allows a calibration by normalizing the response over a band. I dug up a 1.26 GHz Cavity notch filter that I had in the junk box and measured it with the Pluto (Figure 9). Even without optimizing anything, the dynamic range was excellent and the response showed good agreement to what my ‘real’ HP Network Analyzer showed.
 

Figure 9 – I dug up and measured with SATSAGEN an old 1.26 GHz Notch filter that I in the Lab with the Pluto. The gain response showed good agreement with what my real network analyzer measured. Thus the Pluto is a truly universal kind of RF Building Block, it even works as a Scalar Network Analyzer, and Lock-In Amplifier!

 

References:

[1] https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/adalm-pluto.html


[2] https://wiki.analog.com/university/tools/pluto

[3] User forum post on problems with 2r2t command,

https://ez.analog.com/adieducation/university-program/f/q-a/544531/pluto-rev-c-how-to-activate-the-2nd-rx-channel

[4] Pluto Firmware download location,

As per [3] download the ENTIRE Zip file, do not unzip it, just use this ENTIRE file as per the update procedure below,

https://github.com/analogdevicesinc/plutosdr-fw

[5] Pluto Firmware Update Procedure,

You will want to follow the "Mass Sorage Update" procedure listed here.

https://wiki.analog.com/university/tools/pluto/users/firmware

[6] Pluto list of firmware configurations,

See: "Updating to the AD9364" on this page,

https://wiki.analog.com/university/tools/pluto/users/customizing

See: "All Environmental Settings Table" on this page,

https://wiki.analog.com/university/tools/pluto/devs/booting


[7] SATSAGEN home page, there is no manual, but the author has how-to videos on Youtube.
http://www.albfer.com/satsagen-download-page/

[8] Pathosware homepage,

https://pothosware.com/


Pathos Project on Github,

https://github.com/pothosware/PothosCore/wiki


[9] Analog Devices Pluto C# Bindings and example project on Github

https://github.com/analogdevicesinc/libiio/tree/master/bindings/csharp

 

Post updated: 9Jan22

 

Article By: Steve Hageman www.AnalogHome.com    

We design custom: Analog, RF and Embedded systems for a wide variety of industrial and commercial clients. Please feel free to contact us if we can help on your next project. 

This Blog does not use cookies (other than the edible ones).

No comments:

Post a Comment