Build Your Own Phased Array Beamformer

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is John Kraft and in this video I'd like to walk you through how to build your own fairly low-cost digital beamformer I've made a couple of videos where I do phased rate beamforming to point an antenna and the response to those videos has been great I think a lot of people like seeing how these beamforming Concepts play out in a simple system but even those simple systems that I've done can cost tens of thousands of dollars so that's not always in the budget especially for those that are just curious about getting hands-on experience with this technology so in this video we are going to build a low-cost two-channel digital beamformer using the very friendly Pluto software-defined radio and even though it's only two channels you can really explore a lot of the concepts of beamforming with it I will walk you through what items you'll need how to assemble it and most importantly how to program it and then we'll start playing with it and you'll see beamforming come to life okay so here's what we'll cover in this video we'll start with the obligatory quick overview of beamforming then we'll discuss the main differences between analog and digital beamforming next we'll construct our two channel digital beamformer then we'll calculate what we should expect from that beamformer then we'll create a simple python script to vary the phase and plot the signal strength and we'll spend a lot of time on that but as we do we'll quickly realize a major flaw and how we've constructed this beamformer so I'll point that out and then we'll fix it and then we'll finish up with a compass style graph for the direction of arrival we're doing beam forming and direction of arrivals so it's pretty much mandatory that you have some kind of a compass view in your video and finally I'd like all of you to comment on what you'd like to see next on this we can do a lot more with this simple setup uh so please leave a comment with what area you would like to see next it could be grading lobes monopolis tracking we could look at the transmit side of beamforming we could look at time delay for beamforming let me know what you'd like to see and I'll try to learn it and and think of a way to demonstrate it with our two channel beamformer but before we dig into that let me offer the following two caveats first while I do work for Analog Devices on this channel these are my own thoughts and opinions I'm not trying to sell you any Analog Devices items but of course I do use their stuff a lot because that's what I use in my day job secondly I am not an expert in phased rate beamforming but I happen to be at a company where this is a big area of research and development and so we have a lot of experts and a lot of focus in this area and I try to learn from them and then do something with that knowledge but I'm not particularly good with math or programming or beamforming Theory and that's actually a major motivator for why I want to do these Hands-On activities I want to see how these things actually work and then after getting an intuitive sense for them I can then better understand the math and equations behind it all and my hope is that others might also try this and add their own experiments or improvements to what I've started here and then share that with me and then we can all learn this stuff together so if that sounds good then let's get started with a brief refresher of what RF beamforming means so we start with some RF Source it shines down onto our antenna array and depending on the angle of that RF Source it's going to hit one of the elements first and then some small time later it's going to strike another element and then so on and so on across the face of the array each of these signals is delayed in time so the goal is to choose a delay for each of these antenna elements such that they are all aligned and then they get summed together coherently to make a much larger signal and essentially there's three ways to describe this delay we could describe it as an incremental distance that the wavefront must travel to strike the adjacent element and that incremental distance we call L or we could describe it as a time delay between elements and that time delay is just the distance L divided by the speed of light or we can describe it as a phase shift but that phase shift is really just the time delay at one particular frequency but we often use phase shifts instead of time delays because phase shifts are generally much easier to implement okay um now let me give you a little bit of background on analog hybrid and digital beamforming because what we've done in some past videos have been analog and hybrid beamforming and uh and now we're going to do digital beamforming so let me just very quickly explain the key differences so what you may have seen in another video of mine is is this 16 element X microwave phased array Cube and that was all analog beam forming we had 16 elements and we applied various phase shifts to each antenna element and those phase shifts were applied in the RF domain they were applied at 10 gigahertz but then all those signals those antenna element signals were summed together into from a four to one combiner and then mixed down to one receiver on Pluto so that's in a nutshell analog beam forming the phase shift is applied at the at the RF domain but we could break up the elements into smaller arrays and digitize each of those arrays and then further phase shift and sum digitally and that's what we did on the video above and this was something I presented at the gnu radio conference a couple years ago so that was hybrid beamforming some delays are created at RF and other delays are created after groups of those elements are summed and hybrid beamforming is a nice trade-off between flexibility and the total cost of the system or the total power draw of the system so it's a it's a fairly common technique but today we want to do digital beam forming so in digital beam forming we digitize the information in each antenna element and then we apply the phase shift or the time delay in some kind of program fuel arrays have enormous flexibility and they are able to form a great number of beams and track multiple targets simultaneously the trade-off is in the cost size and power of these all digital arrays also the software burden can become quite large if they're just large arrays and it just becomes a lot of data to store and process now the digital array that we are building today is only going to be two elements so we can only form one beam but you'll see how that's done and get some appreciation for for how that would scale with larger digital arrays okay so let's go through the setup now for our simple digital beamformer so to build our two-channel digital beamformer we'll use the Pluto software to find radio Pluto is an open source design using the ad93630if transceiver chipset from Analog Devices by default Pluto has one received Channel and one transmit Channel but you can add a second receive and a second transmit Channel if if you open up the case and use a u.fl to SMA cable um Pluto can can digitize or transmit RF signals anywhere from 70 megahertz to six gigahertz so we will use two receive channels as the basis for our digital beamformer and then we'll use one of its transmit channels and this will be the signal that we track so first if you have a Pluto you'll need to modify it to to expose that second receive Channel and there's a video here the link is right here that will walk you through step by step how to do that and it even walks you through the python installation and and how to get that up and running it ends with a simple python script that you can run to ensure you've set up everything properly so if you want to build the digital beamformer that we're doing today you must watch that video and you must be sure that you can run that python script at the end of that video if you run into trouble uh leave a comment on that video and I'll try to help you so inside Pluto is this ad9363 transceiver chip and it's important to understand a bit about what is happening inside this chip so the two received ports go into an LNA and this LNA amplifies the receive signal while maintaining a low noise floor the signal then travels into a mixer and this mixer is what's called a zero if mixer it means that we can go straight from RF to zero Hertz which is called baseband so the RF carrier gets completely stripped out so the only thing coming out of that mixer is just the signal or modulation that we want and then on the transmit side it's the reverse we we create a signal or modulation and we put that into the DAC and then we up convert it to RF and then output that on the transmit SMA connector just to put some numbers to this the receive and transmit Lo that we're going to use today is 2.3 gigahertz and then the signal that we'll generate in the DAC is a 200 kilohertz sine wave so think about that DAC making a 200 kilohertz signal then mixing with a 2.3 gigahertz Lo the output of that on the transmit Port will be 2.3 gigahertz plus 200 kilohertz which is still very very close to 2.3 gigahertz and this signal goes out to an antenna and it comes back to our receive one and receive two antennas will again go through a mixer but this time we're mixing down with that 2.3 gigahertz Lo so the output of that is 2.3 gigahertz plus 200 kilohertz minus 2.3 gigahertz which is just 200 kilohertz and that's what the ADC digitizes and that is the data we'll have available to play with in Python so using that dual Channel Pluto here's how we'll construct our digital beamformer we plug Pluto into a computer through its USB cable and this also Powers Pluto no other power sources needed then we connect low-pass filters to the SMA ports of Pluto then we just connect to our antennas we'll start with just using the stock antennas that came with Pluto but then later on after we do our first few experiments you'll see why these are probably not the best option and so then we'll switch to something better later on so what you see in the top left corner is just a quick time lapse of me assembling this as shown in the diagram so we're connecting up the two receive antennas there and I just I just tape them down with a little bit of painters tape but of course we want to make sure that the spacing is set to 65 millimeters that's a half Lambda spacing for 2.3 gigahertz and then I can move the transmitter around so with this configuration you can see that if our transmitting antenna is in this kind of a direction it'll strike the RX1 receive antenna first and then sometime later it will strike the rx2 receive antenna and if our signal was directly in front of the array then the steering angle Theta would just be zero degrees we call this the mechanical bore site or the broadside Direction so with the RF Source at the broadside Direction you can see that there would be no time or phase difference between RX1 and rx2 but let me go back to those low pass filters for a minute those filters are important I would not omit them the reason is that Pluto uses a square wave Lo and this Square wave Lo is great for Jitter that means that things like evm are going to be improved but square wavelo is really bad for harmonics it means that when you program Pluto to Output 2.3 gigahertz it will also output two times that and three times that and four times that Etc even Beyond 10 gigahertz these signals are still pretty strong and on the received side the adcs will be tuned to all of those frequencies so it means that both the transmit and the receive side need filters and the filters are not expensive they're they're maybe 30 each and I'll put a link uh to the filters uh that I used in the description um and just to emphasize that here's what the transmitter Pluto looks like if you don't use those filters this is a spectrum analyzer plot of the output power across frequency when we program Pluto's transmit to be a 2.2 gigahertz sine wave you see a bunch of Peaks there but the only one you really want is the 2.2 gigahertz Peak all the others are even an odd harmonics of 2.2 gigahertz and they are undesirable and they are pretty strong and even at 11 gigahertz we've still got a pretty strong tone so all of those tones will hit our two element antenna array and so the beam pattern you get will be a summation of all these different frequencies and signals in each kind of an effective different Lambda spacing but if we use a cheap low pass filter things look a lot better this data was actually taken with the mini circuits LFC g2500 low-pass filter but that filter is not connectorized so our our SMA connectorized filter that we're going to use won't be quite this good it might be 10 or 15 DB worse but it's still good enough for us but this just demonstrates the point that a simple low-pass filter is going to greatly attenuate all of those harmonics okay so that's our setup and and probably more than you wanted to see about filters um let's now get into the details of how we are going to steer Our Two element digital beamformer we've gone through this slide already these are the basic equations for how to calculate the delay that we'll need to steer to a certain angle so here's an example of using those equations let's position our transmit antenna such that it was 20 degrees off of mechanical bore sight and we'll transmit at 2.3 gigahertz so we set our spacing between the receiving tennis to 65 millimeters that's one half of a 2.3 gigahertz wavelength so using the equations we just saw if we plug in 20 degrees which is 0.35 radians and D equals 65 millimeters we can see that we would need a Time shift of 74 picoseconds to steer the array or we could also use a phase shift so using the equations we just saw we we would find that we need a 62 degree phase shift between RX1 and rx2 in order to steer that antenna array to 20 degrees so we can do either a Time shift or a phase shift to steer this array but let's start with a phase shift it's easier to do for a number of reasons and then in a future video I'll do an example of this again using a Time shift time shift is just a little bit harder but it's not much it's just a few extra lines of code and using a Time shift can help with wider band signals so it is often the preferred method with digital beamforming so in this video we'll build our beamformer with the phase shifter and if we solve those equations for a variety of steering angles then these are the phase shifts that will be needed between our two elements now please note that this is for any frequency where the spacing between the antenna elements is equal to one half of that frequencies wavelength but hopefully just seeing these values gives you a sense for how much phase shift that we're going to need to apply in our Python program and with our simple beam former we can also measure the half power beam width of our two element array the half power beam width is the size of the main lobe measured three DB down from its peak and this will make more sense once we actually see it but here's the kind of numbers that we can expect for our n equals 2 array we should see something like a 50 degree half power beam width and that's a pretty broad lobe um and it's a it's just a consequence of of only having two elements If instead we had four or eight elements you can see how much sharper our main load would be and these are all measurements that we can make on our simple digital beamformer so let's go ahead now and set this up and try it out with the Python program and then we'll see if these values check out okay so we're going to go ahead and we're going to launch Python and if you followed my video on how to make your Pluto into the two Channel version then you should already be set with the basics here that video ended with all the instructions to control Pluto with python and and even how to plot the data so I'm not going to repeat that information here just take a look at that video and it'll walk you through the whole process so we're going to start our Python Programming today based on the understanding that you've already watched that video and you can at least get the get the basic script working okay so we're finally into python here and we can walk through this program here the first program we're going to do is we're going to just plot the ffts as we rotate the phase around so here's some beautiful boilerplate I'm going to place these files on my GitHub page so github.com johncraft these python files will be so as we start through here we're just going to import a couple standard libraries like matpot live in numpy the key one is to import ADI that's going to give you access to all the Pluto commands and then the basic things that we're going to set up here are sample rate is 2 megahertz number samples doesn't matter so much rxlo this is the 2.3 gigahertz that we talked about before and you'll see that that the transmit Lo is going to also be set there the um receive mode we could be in manual or slow attack I haven't played around with it that much I've been in manual for most of these experiments and it's worked out fine the um the 200 kilohertz signal that we're going to impose on the DAC is is in this uh fc0 frequency here and we're just going to have a transmit gain of about or trans attenuation of -3 DB this phase Cal will talk about uh actually later on on the next setup we'll we'll see how we arrived at that but it's just a simple calibration to subtract out the the um the phase errors between RX1 and rx2 you know different cable lengths and things like that the rest of these things here were covered in my other videos so I'm not going to repeat them we create a 9361 uh solver defined radio object we populate it with all the attributes that it needs they're they're fairly self-explanatory especially if you watch that other video here we're going to make our IQ Vector to send to the transmitter and that's with this command here this is DBS is just a simple function to convert the raw data from Pluto into scaled dbfs values dbfs stands for decibel full scale so it's a it's a ratio of how much of the full scale of Pluto's range that we're using it's not the same as dbm I mean it it tracks kind of one-ish for one-ish but dbfs is not the same as as dbm dbm is like what you would get on a spectrum analyzer dbfs is looking at it from the adc's perspective and then we're just going to grab a bunch of data so we grab buffers of data with this this command here sdr.rx and then we separate the data because it comes back as as two arrays we separate the data into um uh receive zero and receive one we're going to go through this for Loop and the for Loop comprises a set of phase delays that go from minus 180 degrees to plus 180 degrees and as we go through these phase delay these face delays we're going to do a complex multiplication against the receive data that we got just for Channel One and we're going to do a complex multiplication it's going to have the effect of adding phase onto RX1 so we're going to shift the phase on RX1 by these amounts here we'll start at -180 um and go on all the way to uh to Plus 180. and then we're going to add those things together so receive zero which is our Channel One um that doesn't that doesn't change at all that's just that's just fixed because it's arbitrary which one is fixed but phase is relative to something and so we just made it relative to um to receive zero and then um the the channel That We're rotating is RX1 and um and so we just add those together then once we add them together we just plot those ffts so let's go ahead and run this now so you can see it started out pretty low and as we increase the phase shift here from -180 closer to zero it's rising Rising now it's rising a tiny bit but it's awfully flat still flat it's pretty much at its peak value and now the phase shift is increasing into the positive territory and now it's starting to come down a little bit so this is interesting right we we grabbed one buffer of data from Pluto and from that one buffer we've manipulated it to apply all these different phase delays to it and we've seen you know 20 or so DB of variation in gain on that 200 kilohertz signal so this result is interesting right it means that we are indeed improving the signal to noise ratio by Shifting the phase around but it's not terribly instructive like it's real difficult to tell what phase shift do we hit the peak value because there were so many phase shifts that kind of seem like they produce kind of the same large Peak value so let's go to a different program now and in this different program we're just going to plot the magnitude of this 200 kilohertz Peak and that new program is this uh plots Peaks program here again this will be up on my GitHub page and if we look at the major changes to this program now we're gonna we're gonna do something where we we need to know what D is so the distance that we set between the two receive antennas we need to know what that is because we're actually going to calculate a steering angle here uh setting up uh the radio is the same setting up the transmit channel is the same uh we also added a new function calculate Theta so this is going to calculate the steering angle for a given phase Delta we're still going to go through a range of phase shifts from -180 to 180 degrees and so we're going to delay the RX1 and we're still going to sum them together the difference is though now now we have this new array called Peak sum and this is just going to take the peak of these fft bins only the peak and specifically only the peak around our 200 kilohertz signal that's what the signal start signal end is um is it we look at we look at our fft bins and we just find the bins that are somewhere in the range of 200 kilohertz because that's the only Peak that we care about so we append whatever that Peak is into this peak sum signal here and then out of that whole array which consists of Peaks from the fft bin we're going to find the maximum value of that whole array and that's Peak dbfs and then we're going to find out at what steering what phase shift that that occurs at and from that we're going to get the steering angle so this is all about finding finding the peak which is going to be our direction of arrival um and then the rest of this is just plotting it uh so let's go ahead and run that so when we run this what we're getting is a plot of the different phase shifts we applied from minus 180 degrees all the way over to plus 180 degrees and what was the peak fft signal in dbfs that we saw there and so you can see from the the webcam that we're at the mechanical bore site you know our transmit antenna is directly in front of our receive array so our Peak should be at zero degrees phase shift instead it's at 116 degrees phase shift and this is just a calibration offset there's mismatches in the cables and in RX1 and rx2 in the circuitry and so whatever that number is if we just enter it here that will be our calibration and then we rerun this okay great and now now it now it's essentially calibrated so that zero degrees is zero degree steering angle corresponds to a zero degrees phase shift so this red dotted line here is going to be where our Peak is and at that Peak I printed out some information here about the peak signal occurs with this such and such phase shift and if our spacing really is 65 millimeters then that phase shift is going to correspond to a steering degree of in this case uh one one degree so this is an interesting plot this is actually a plot of the array factor it's not the antenna pattern of our two element array but it's the array Factor um plot and so from this remember we had made a calculation about what the half power beam width was going to be and from this we can kind of get that information we can look at if I go down 3 DB from my Peak it puts me maybe somewhere over here at -70 and then over here at plus 70. so about 140 degrees of phase shift in total and then if we look up what 140 degrees corresponds to for steering angle shift remember we had that little chart there 140 degrees is going to fall somewhere between what we had calculated for 45 degrees and 60 degrees so that feels like a good fit because we had calculated a half power beam width for a two element array that it was going to be 50 degrees so we're right we're right in that ballpark I guess we could kind of zoom in and put some cursors in here and and get a more accurate kind of a number but but we're we're right in that ballpark of what we partic predicted for for what the shape of this uh this lobe was going to be so this is all great it's very interesting we now have a way to kind of get a direction of arrival what should happen now is if we do many of these sweeps together real time as I move the transmit antenna around we should see this peak track with that transmit antenna it should move back and forth this lobe will be mostly unchanged it'll always kind of kind of look more or less like this but we should see this peak move back and forth and we should see the steering angle update with approximately where the steering angle is the direction of arrival is to the transmit antenna um let's try that now and then um it's probably not going to work uh quite like that and so let's talk about then why it's uh why it's not quite working right so now as I move this transmit antenna around mechanical boresight you can kind of see now if I put it right here this is this is about 20 degrees and we're saying it's minus minus 18 degrees it's jostling around quite a bit though here's plus 15 degrees plus 35 it's not it's kind of working it's not quite there's a lot of jostling and movement so we just saw some kind of wonky Behavior with our beam former and what I think is happening is that we are picking up multi-path interference basically we have these stubby omnidirectional monopole antennas and so they are picking up all the scatter from other objects in the room and so we can swap out our monopole antennas with directional Yogi style antennas these are very inexpensive on Amazon or Ebay they're just a few dollars and they operate over a very wide band so these are the yogi style antennas that we can use then for the stands I've got a bunch of these little lab tweezer instrument uh clippy stands here these these work well to hold the pcbs and let's check our spacing again we want 65 millimeters okay uh so let's try this again now with the new yagi antennas so I'm going to reset my face Cal to zero and the number of scans to five just to get a quick read for the phase calibration and we need to do a 60 degree phase shift for face Cal so we put that in there rerun that again okay good now let's try doing a long run here and see if we can't better track um the transmitter so here's zero degrees and if we move it over to about a 20 degree spacing that's pretty good or about 22 degrees and then over here at -20 right about minus 17 minus 18. so as I slowly move it back and forth you can see we go all the way to one horizon on the negative Direction [Music] and then it comes back to Mechanical boresight zero you can see already it's it's tracking much better there's much less jostling around take it all the way over to the other Horizon um still a little bit of movement with still a two element array and so there's a limit to kind of how how accurate that we can be with it and everything but uh you can tell it's far far better okay so now let's do a fun Compass plot here so we set our plot Compass to true and this will give what everybody wants for direction of arrival stuff nice compass with a little degree read out there so right now we're at zero degrees as we move this back and forth so we'll move it in the negative Direction here we're at minus 20. over here minus 45 much more stable with those yagi antennas there okay I mean that's that's pretty much it that's as as exciting as it gets for this demo this video kind of already went quite a bit longer than I had initially thought but I think there's a lot of other fun things that we could do in the future um multiples tracking we could look at grading lobes we could look at uh time delay instead of phase delay um we could uh we could do something with the transmit beam instead of just the receive side um so please leave a comment if any of that is of interest to you and you'd like me to do a video on on something like that but um thank you for watching thank you for your time and I hope you enjoyed it
Info
Channel: Jon Kraft
Views: 193,670
Rating: undefined out of 5
Keywords:
Id: 2QXKuEYR4Bw
Channel Id: undefined
Length: 30min 37sec (1837 seconds)
Published: Mon Oct 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.