Experimental Baofeng RD-5R version

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Fri Feb 19, 2021 9:03 pm

Increasing the spectrum bandwidth to 100 KHz allows us to understand what happens with the Baofeng. These are the pictures, taken without modulating signal:

This is the GD77.
fm_rad_100Ks.jpg
fm_rad_100Ks.jpg (26.37 KiB) Viewed 3476 times
This is the Baofeng.
fm_baof_100Ks.jpg
fm_baof_100Ks.jpg (28.94 KiB) Viewed 3476 times
We notice that the Baofeng power amplifier adds spikes ever 10 KHz. The spikes are about -50dB under the central signal spike. This is not so good, but I suppose that this is the kind of compromise that explains the price.

The next problem is, I believe, more serious.

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Fri Feb 19, 2021 9:11 pm

Edit: Please disregard this message, the spectrum analyser was probably saturated.

This is difficult to analyse with a spectrum analyser, so take the following messages with a grain of salt. I noticed some erratic spikes on the GD77 with the open firmware when pressing the PTT. This is how it looks like (on the waterfall):
fm_rad-100K-ptts.jpg
fm_rad-100K-ptts.jpg (27.32 KiB) Viewed 4301 times
There, I pressed the PTT repeatedly, but was not able to capture the transient spikes on the spectrum curve. But you can see on the waterfall that the spikes can be quite high.

A look in the relevant literature taught me that this kind of effect may come from power supply instabilities when switching on and off the amplifier. You probably know more than I do on the subject.

Of course, DMR switches power on and off all the time, because of TDMA, the results are shown in the next message.
Last edited by do1jml on Sat Feb 20, 2021 5:53 pm, edited 1 time in total.

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Fri Feb 19, 2021 9:22 pm

Edit: Please disregard this message, the spectrum analyser was probably saturated.

This is the DMR modulation. First, the Baofeng:
dmr_baof_150ks.jpg
dmr_baof_150ks.jpg (42.26 KiB) Viewed 4299 times
We still notice the spikes and they are a bit higher than in FM, relative to the signal.

This is the GD77 with the open firmware:
dmr_rad_150Ks.jpg
dmr_rad_150Ks.jpg (43.18 KiB) Viewed 4299 times
I don't think this is very good.The spectrum may be about OK at the particular time of capture, but the waterfall tells a different story with transients.

For comparison, this is another GD77, with the manufacturer's firmware:
dmr_rad_orig-150ks.jpg
dmr_rad_orig-150ks.jpg (33.47 KiB) Viewed 4299 times
We have a much cleaner signal. We also notice that there is more power in the useful part of the signal.

What do you think?
Last edited by do1jml on Sat Feb 20, 2021 5:54 pm, edited 1 time in total.

VK3KYY
Posts: 7590
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: Experimental Baofeng RD-5R version

Post by VK3KYY » Sat Feb 20, 2021 2:46 am

Thanks for sharing all of your research

The Baofeng RD5R is known to not have very good RF performance, because of its hardware design.

I don't have a schematic, but people have told me the design is similar to the Baofeng dual band FM radios, where there is only one PA for both VHF and UHF , and only one receiver RF section.
I think the radio uses a switchable RF filter near the antenna, to reduce the harmonics from VHF being produced on UHF.

I'm not an RF design expert, so I can't explain the spikes at 10kHz spacing


I'm a bit surprised that the OpenGD77 firmware produced a cleaner signal than the official firmware.
I think that would need to be re-tested, because the only possibly difference would be calibration values, and the calibration functionality that was originally written my Kai DG4KLU should be a identical to the calibration functionality of the official firmware.

If anything, I would expect the OpenGD77 firmware to be worse than the official firmware, because its possible that Kai did not find all the necessary calibration adjustments that needed to be applied to the C6000 DMR chip and the AT1846S RF chip.

Perhaps the OpenGD77 firmware omitted some calibration setting, but the default setting in the AT1846S was better than the value set by the official firmware.


Re: Spikes on Tx start.

I would not be surprised if this occurs. The voltage stabilisation in the GD77 is much better than the RD5R, but when the Tx is triggered there will be a drop in voltage until the regulator can compensate.
I think the PA / finals voltage is directly from the battery, but the driver stages are probably stabilised.


If you look at the RD5R when its running the OpenGD77 firmware on DMR, we definitely have a problem with the DMR power pulse envelope.

RD-5R OpenGD77
OpenGD77 DMR pulse
OpenGD77 DMR pulse
rd5r_open.png (42.72 KiB) Viewed 4284 times

RD-5R Official
(Note the timebase is different to focus on the beginning of the pulse)
Close up of official firmware DMR pulse
Close up of official firmware DMR pulse
rd5r_official.png (43.98 KiB) Viewed 4284 times

Compared with the GD77
GD-77 OpenGD77
GD77 running OpenGD77
GD77 running OpenGD77
open_full_1w.png (36.2 KiB) Viewed 4284 times

And the DM1801

DM1801 - OpenGD77
DM1801 OpenGD77
DM1801 OpenGD77
dm1801_open.png (44.04 KiB) Viewed 4284 times

Which although not as good as the GD77, is actually better than the official Baofeng DM1801 firmware
DM180 - official Baofeng firmware
DM180 - official Baofeng firmware
dm1801_official.png (71.04 KiB) Viewed 4284 times

The control of the PA etc is identical for all radios.

https://github.com/rogerclarkmelbourne/ ... #L680-L710

So I think probably the official RD5R firmware does not turn of everything during the alternate TS.

One possibility is that the official firmware leaves the PA enabled, but only turns off the Tx from the RF chip (AT1846S) or possibly even just sets the RF output from the RF chip to 0mW

However, its not a simple change the code, to test this experiment, because we must not enable the Rx Pre-Amp when the PA is enabled, or the radio will be damaged.

So probably the first test would be to modify the code, so that the RF Pre-Amp is never enabled, then it would be safe to test some changes to Tx, e.g. In the activateRx() function, only disable the PA if the PTT is released.

BTW. The DMR chip controls the CPU to change the radio hardware from Tx to Rx, rather than the firmware actively controlling this.

i.e the firmware sends a command to the C6000 DMR chip to transmit , or receive, on the next TS, but the C6000 then tells the CPU when to actually turn on the Tx or Rx.

Although there are separate commands from the C6000 to the CPU, for Tx and Rx; The C6000 sends the command for Rx to mean end Tx.
i.e There is a command from the CPU to the C6000 for "Do Not Tx or Rx on the next TS", but the C6000 still sends the Rx command to the CPU and the end of the transmitted TS, to tell the CPU to turn off the transmitter hardware, even though it does not require the Rx hardware to be enabled.

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Sat Feb 20, 2021 7:19 am

I perfectly understand that PA control is not trivial. Moreover, the manufacturer may have implemented tricks you did not think about or require hidden commands. For example, if you look at the image "RD-5R official firmware", you see a ramp-up of the PA before the DMR pulse.

I intend to re-install the manufacturer firmware on the radios and re-test. It is possible that my GD-77 is malfunctioning and that the spikes have nothing to do with the firmware. After all, this is the radio with the ticking sound.
This may take me a few days, though.

I would like to point out to other members of this forum which may be reading this thread that this kind of measurement could be done with a 30$ RTL-SDR stick and free software and that it would be nice to have data about more radios...

VK3KYY
Posts: 7590
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: Experimental Baofeng RD-5R version

Post by VK3KYY » Sat Feb 20, 2021 8:42 am

do1jml wrote:
Sat Feb 20, 2021 7:19 am
I perfectly understand that PA control is not trivial. Moreover, the manufacturer may have implemented tricks you did not think about or require hidden commands. For example, if you look at the image "RD-5R official firmware", you see a ramp-up of the PA before the DMR pulse.

I intend to re-install the manufacturer firmware on the radios and re-test. It is possible that my GD-77 is malfunctioning and that the spikes have nothing to do with the firmware. After all, this is the radio with the ticking sound.
This may take me a few days, though.

I would like to point out to other members of this forum which may be reading this thread that this kind of measurement could be done with a 30$ RTL-SDR stick and free software and that it would be nice to have data about more radios...

I don't have a good analogue power meter, so I can't take any measurements of power on the RD-5R to compare with the GD77, but I know I need to set the power to a higher setting with the RD5R to access my local repeater.
However the difference in the power which is required, is probably caused by the pulse power envelope problem and also the additional spurious signals produced by the RD-5R which require it to be set to a higher power so that the repeater can decode its signal.

If you have access to an oscilloscope, then you could try to replicate my tests.

Although I have a hacked DS2072A, which is now equivalent to to a DS2302A, and has a bandwidth of 300Mhz (because the hardware of the Rigol DS2xxx series is all identical), you don't need such a fast oscilloscope

I think possibly even a 50Mhz or 100Mhz oscilloscope would be enough.

Or you may be able to make some sort of signal detector using a high frequency diode, and a capacitor + resistor network, and then observe the waveform on a very slow oscilloscope.

Its difficult to know if perhaps your radio has a hardware fault.

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Sat Feb 20, 2021 5:59 pm

I probably made a mistake in measuring spike power. The spectrum analyser has an automatic attenuator which was probably fooled by the DMR spikes. I did not notice it switched itself on and off. I added a warning to the original messages.

More measurements are coming.

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Sat Feb 20, 2021 9:28 pm

So, here is the latest info.

First, the measurements above are probably an error. I think that the spectrum analyser was saturated by the DMR spikes as a signal which was attenuated externally showed no spikes. The same signal on an offset also showed no spikes (this is how I found out).

I first reinstalled the manufacturer's firmware on both radios. Then, re-installed the open firmware on the GD-77.

I'll keep this short as it is late in my part of the world, so here is the DMR spectrum of the GD77 on open firmware (which I installed back):
rad_dmr_open.jpg
rad_dmr_open.jpg (27.03 KiB) Viewed 4201 times
This is the same GD77 on the manufacturer's firmware:
rad_dmr_s.jpg
rad_dmr_s.jpg (26.31 KiB) Viewed 4201 times
The two signals are similar enough to call it a day.

An interesting report: a quick test of the motorboarding / ticking sound showed that it is gone on the manufacturer's firmware.

do1jml
Posts: 53
Joined: Fri Sep 11, 2020 10:56 am

Re: Experimental Baofeng RD-5R version

Post by do1jml » Sat Feb 20, 2021 9:42 pm

Now on the Baofeng RD-5R. Manufacturer's software installed back.

This is the FM spectrum. You'll notice that the spikes are gone:
baof_fm_s.jpg
baof_fm_s.jpg (30.15 KiB) Viewed 4199 times
This is the DMR spectrum, with added attenuation. It is a lot cleaner, but there is a strange extension at frequencies above the main signal.
baof_dmr_s.jpg
baof_dmr_s.jpg (26.68 KiB) Viewed 4199 times
I also measured the power with the analog meter. This are the figures, attached to the figures presented earlier in this thread:

Code: Select all

Ref level		0,5	1	2	3	4	5
GD77 FM			0,3	0,5	1,1	2	2,9	3,9
RD5R FM			0,05	0,5	1,1	1,9	2,5	3,6
GD77 DMR		0,3	0,5	1	1,75	2,3	3
RD5R DMR		0	0,1	0,5	1	1,1	1,5

RD5R FM			-	0,9	-	-	-	4
RD5R DMR		-	0,4	-	-	-	2,5
The first 4 lines are the open firmware, the last 2 lines are the manufacturer's firmware on the RD-5R.

VK3KYY
Posts: 7590
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: Experimental Baofeng RD-5R version

Post by VK3KYY » Sat Feb 20, 2021 10:03 pm

I didn't do the original port of the firmware to this radio. It was done by a Russian Ham, whose callsign I can't remember at the moment.

Its possible he made mistakes with things like the PA settings, and the VHF PA may perhaps be used in the OpenGD77 firmware on UHF and vice versa.

I can't remember if I confirmed he had correctly identify the VHF and VHF RF Pre-amp control.
I would need to listen to a signal on UHF and then try changing the code to use the UHF and then the VHF pre-amp to see which one gives the most signal.

On Tx, I suppose perhaps I could look at the power envelope on my oscilloscope to see if the signal is more when each "PA" is selected.

The radio hardware on the RD-5R is significantly different between the GD-77 / DM1801 and the RD-5R, and possibly there is some big mistakes in the code from the Russian Ham :-(

Post Reply