[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuradio-discuss
Subject:    Re: [Discuss-gnuradio] Changing the USRP transmitter gain after a timeout
From:       Qurat-Ul-Ann Akbar <quratulannakbar2015 () u ! northwestern ! edu>
Date:       2017-02-24 17:29:52
Message-ID: CAJwfNj1i5XMgtbswJCNxzuMBBaVwjN8hkKeEco9s+fhopiOorA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I have looked at that file and you have made gain, frequency, and LO offset
variables and then you send messages every 2 secs. When I run the file, I
try to change the frequency from 2.4 to 2.5 G using the glider in the GUI.
It should change the value of the variable which should be reflected in the
actual center frequency. However, I do not see the frequency changing after
2 secs in the Frequency Sink Plot. Is that the right way to change the
value of the variable ?

On Fri, Feb 24, 2017 at 11:06 AM, Derek Kozel <derek.kozel@ettus.com> wrote:

> Hello,
>
> For every message which you send UHD would change the gain once. So in
> order to alternate every 100ms you would send 10 messages a second,
> advancing the timestamp value by 100ms each time. The example I linked to
> shows the frequency and gain being changed every two seconds. You'll just
> need to alter the arguments to have it alternate the gain.
>
> Regards,
> Derek
>
> On Fri, Feb 24, 2017 at 8:52 AM, Qurat-Ul-Ann Akbar <
> quratulannakbar2015@u.northwestern.edu> wrote:
>
>> Also I want to keep doing this in a loop (the values keep alternating
>> after an interval). Will it be possible through the command port interface ?
>>
>>
>> On Fri, Feb 24, 2017 at 9:17 AM, Qurat-Ul-Ann Akbar <
>> quratulannakbar2015@u.northwestern.edu> wrote:
>>
>>> Hi Derek,
>>>
>>> Thank you for your email. If you could find that file it would be really
>>> helpful. What I want to do is to alternate between two or more values of
>>> gain after specific intervals. Can I alternate like this using the command
>>> port interface? How will the block USRP sink block know which value to use
>>> ? Can you kindly explain that a bit.
>>>
>>>
>>>
>>> On Thu, Feb 23, 2017 at 4:23 PM, Derek Kozel <derek.kozel@ettus.com>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> The command port interface can be used to change the gain value. There
>>>> is an example of creating messages for tuning included in gr-uhd.
>>>> https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/exam
>>>> ples/grc/uhd_msg_tune.grc
>>>>
>>>> I've used a function probe to generate coarsely timed "tick" messages
>>>> to a custom python block which is correctly formatting the messages before.
>>>> Unfortunately I cannot find that GRC file at the moment. The function probe
>>>> will run at an approximate interval dependent on your system and GNU
>>>> Radio's scheduler. If you don't need exact timing then just use the gain
>>>> message and function probe, if you do need exact timing include both time
>>>> and gain values in the pmt command message then the gain will be applied at
>>>> the specific time based on the radio timestamp. Set the Sync setting to
>>>> unknown_pps, which will set the radio timestamp to 0 when the flowgraph
>>>> starts, and set the initial timestamp for the command port message to a
>>>> second or two in the future to account for the startup time of the
>>>> flowgraph.
>>>>
>>>> Regards,
>>>> Derek
>>>>
>>>> On Thu, Feb 23, 2017 at 1:36 PM, Qurat-Ul-Ann Akbar <
>>>> quratulannakbar2015@u.northwestern.edu> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I want to alternate the gain of the USRP between two values after a
>>>>> certain period of time. For example after 100 ms it should go from A to B
>>>>> and after another 100 ms the value should go from B to A and so on.
>>>>>
>>>>> Is there an easy way of doing this in the GNU Radio companion or would
>>>>> I need to start a timer in python and put an IF condition to keep changing
>>>>> the value? Can I do this somehow using the probe block?
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Discuss-gnuradio mailing list
>>>>> Discuss-gnuradio@gnu.org
>>>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>>>
>>>>>
>>>>
>>>
>>
>

[Attachment #5 (text/html)]

<div dir="ltr">I have looked at that file and you have made gain, frequency, and LO \
offset variables and then you send messages every 2 secs. When I run the file, I try \
to change the frequency from 2.4 to 2.5 G using the glider in the GUI. It should \
change the value of the variable which should be reflected in the actual center \
frequency. However, I do not see the frequency changing after 2 secs in the Frequency \
Sink Plot. Is that the right way to change the value of the variable ?<img \
src="http://t.sidekickopen68.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v5dq_jN6 \
3K5dvd_KNjW3LyyZ81pctGFW1dsDB71k1H6H0?si=5925899090264064&amp;pi=c9815ef6-c1a5-4e3b-bad0-2248f1c49eed" \
style="display:none!important" height="1" width="1"></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 24, 2017 at 11:06 AM, \
Derek Kozel <span dir="ltr">&lt;<a href="mailto:derek.kozel@ettus.com" \
target="_blank">derek.kozel@ettus.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello,<br><br></div>For every \
message which you send UHD would  change the gain once. So in order to alternate \
every 100ms you would  send 10 messages a second, advancing the timestamp value by \
100ms each  time. The example I linked to shows the frequency and gain being changed \
every two seconds. You&#39;ll just need to alter the arguments to have it alternate \
the gain.<br><br></div>Regards,<br></div>Derek<br></div><div class="HOEnZb"><div \
class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 24, 2017 \
at 8:52 AM, Qurat-Ul-Ann Akbar <span dir="ltr">&lt;<a \
href="mailto:quratulannakbar2015@u.northwestern.edu" \
target="_blank">quratulannakbar2015@u.<wbr>northwestern.edu</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div dir="ltr">Also I want to keep doing this in a loop \
(the values keep alternating after an interval). Will it be possible through the \
command port interface ?<div><br></div><img \
src="http://t.sidekickopen68.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v5dq_jN6 \
3K5dvd_KNjW3LyyZ81pctGFW1dsDB71k1H6H0?si=5925899090264064&amp;pi=f21059c0-c5d6-4c49-ef56-0c96126c2201" \
style="display:none!important" width="1" height="1"></div><div \
class="m_-4891498870591987319HOEnZb"><div class="m_-4891498870591987319h5"><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 24, 2017 at 9:17 AM, \
Qurat-Ul-Ann Akbar <span dir="ltr">&lt;<a \
href="mailto:quratulannakbar2015@u.northwestern.edu" \
target="_blank">quratulannakbar2015@u.northwe<wbr>stern.edu</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div dir="ltr">Hi Derek,<div><br></div><div>Thank you \
for your email. If you could find that file it would be really helpful. What I want \
to do is to alternate between two or more values of gain after specific intervals. \
Can I alternate like this using the command port interface? How will the block USRP \
sink block know which value to use ? Can you kindly explain that a \
bit.</div><div><br></div><div><br></div><img \
src="http://t.sidekickopen68.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v5dq_jN6 \
3K5dvd_KNjW3LyyZ81pctGFW1dsDB71k1H6H0?si=5925899090264064&amp;pi=4f36a709-a3d4-4deb-9386-afd6a3aae064" \
style="display:none!important" width="1" height="1"></div><div \
class="m_-4891498870591987319m_-4185960513569192428HOEnZb"><div \
class="m_-4891498870591987319m_-4185960513569192428h5"><div \
class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 4:23 PM, \
Derek Kozel <span dir="ltr">&lt;<a href="mailto:derek.kozel@ettus.com" \
target="_blank">derek.kozel@ettus.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div>Hello,<br><br></div><div>The command port \
interface can be used to change the gain value. There is an example of creating \
messages for tuning included in gr-uhd.<br><a \
href="https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/examples/grc/uhd_msg_tune.grc" \
target="_blank">https://github.com/gnuradio/gn<wbr>uradio/blob/master/gr-uhd/exam<wbr>ples/grc/uhd_msg_tune.grc</a><br><br>I&#39;ve \
used a function probe to generate coarsely timed &quot;tick&quot; messages to a \
custom python block which is correctly formatting the messages before. Unfortunately \
I cannot find that GRC file at the moment. The function probe will run at an \
approximate interval dependent on your system and GNU Radio&#39;s scheduler. If you \
don&#39;t need exact timing then just use the gain message and function probe, if you \
do need exact timing include both time and gain values in the pmt command message \
then the gain will be applied at the specific time based on the radio timestamp. Set \
the Sync setting to unknown_pps, which will set the radio timestamp to 0 when the \
flowgraph starts, and set the initial timestamp for the command port message to a \
second or two in the future to account for the startup time of the \
flowgraph.<br><br></div><div>Regards,<br></div><div>Derek<br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote"><div><div \
class="m_-4891498870591987319m_-4185960513569192428m_-8841826378603234757h5">On Thu, \
Feb 23, 2017 at 1:36 PM, Qurat-Ul-Ann Akbar <span dir="ltr">&lt;<a \
href="mailto:quratulannakbar2015@u.northwestern.edu" \
target="_blank">quratulannakbar2015@u.northwe<wbr>stern.edu</a>&gt;</span> \
wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div \
class="m_-4891498870591987319m_-4185960513569192428m_-8841826378603234757h5"><div \
dir="ltr">Hi,<div><br></div><div>I want to alternate the gain of the USRP between two \
values after a certain period of time. For example after 100 ms it should go from A \
to B and after another 100 ms the value should go from B to A and so on.  \
</div><div><br></div><div>Is there an easy way of doing this in the GNU Radio \
companion or would I need to start a timer in python and put an IF condition to keep \
changing the value? Can I do this somehow using the probe \
block?</div><div><br></div><div><br></div><img \
src="http://t.sidekickopen68.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v5dq_jN6 \
3K5dvd_KNjW3LyyZ81pctGFW1dsDB71k1H6H0?si=5925899090264064&amp;pi=90efd9b4-7cb7-4111-8f5f-e5f6378206f5" \
style="display:none!important" width="1" height="1"></div> \
<br></div></div>______________________________<wbr>_________________<br> \
Discuss-gnuradio mailing list<br> <a href="mailto:Discuss-gnuradio@gnu.org" \
target="_blank">Discuss-gnuradio@gnu.org</a><br> <a \
href="https://lists.gnu.org/mailman/listinfo/discuss-gnuradio" rel="noreferrer" \
target="_blank">https://lists.gnu.org/mailman/<wbr>listinfo/discuss-gnuradio</a><br> \
<br></blockquote></div><br></div> </blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>



_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic