Sunday, 21 December 2014

27MHz PLL Frequency Synthesizer and ASK Modulator


New 27MHz, PLL Frequency Synthesizer and ASK Modulator, , for RC car remote transmitter, replacing the DDS RF signal source, for lower power consumption and higher tunning frequency range. The circuits consist of ADF4002 PLL IC, PIC16F1716 MCU, op-amp active filter for pulse shaping filter and RMS-2 diode-ring mixer as modulator.

Sunday, 14 December 2014

Remote control receiver ver 2014 integrated field test

Remote control receiver, version 2014, which has been went through a whole year of development, is put to the field test with a hobby RC car as a testing platform. The test is successful. When the car is come in very close range of transmitter, it still welly controlled without any issue, which is a great improvement from previous version.


The changes for version 2014 is to replace the previous dsPIC30F6014 microcontroller, with the lower cost PIC16F1716, this sound's like a minor modification, and it turns out not like that, the 16F microcontroller is 8-bit and 33F is 16-bit, which means the computation of all 16 bit variables would takes much more cycle and the maximum clock of 16F is 32MHz which is a lot slower than the 120MHz 30F controller. MCU code have to be speed optimized to make the old algorithm running in the new 16F controller.

The 16F comes with a advantage of having a 8-bit digital to analog converter (DAC) which is handy for controlling the gain of analog variable gain amplifier, in 33F MCU there are no such modules, the old DAC is constructed externally by resister ladder, just messy. 8-bit embedded DAC is nice, however in earlier version of PCB, it is found that the output current of the DAC is insufficient to drive the variable gain amplifier (20mA), as the result an OPAMP buffer is added to boost the current up.

The 10-bits Analog to digital converter (ADC) of 16F MCU is also a downside, when the 30F MCU ADC is 12-bits, the 16F analog sample is 4 times less resolution than 33F, which cause problem when receiving signal level is small, additional input scaling is applied to scale the sample value up so to improve the quantization error in amplitude estimation filtering.

There are some other difficulties such as servo pulse resolution and they have been mostly investigated and overcome.


Thursday, 11 December 2014

Baseband decoding - PIC16F1716 MCU coding work

The remote control car receiver 2014 version is almost complete, analog circuit is done, after finished analog part, now is the MCU programming part. 
MCU is 16F1716, the point of this MCU is having a 8-bit DAC, which is vital to generate analog voltage to control the variable gain amplifier, and the drawback is, this is a 8-bit MCU, making 16-bit variables calculation a bit painful, and the ADC is only 10-bit, i hope this resolution is OK for sampling the received baseband signal.
Data coding method is switched to Manchester code, which looks like solving the problem of threshold floating issue in the previous NRZ coding method. Bitrate is shorten to 500uS, data length keep 8 bits for each of two channel.


Using two probe is very rare in here. But this is digital debugging, the more probe the better.


Generating a narrow but high resolution pulse for interface with RC servos and ESC(electronics speed controller). The difficulties is the control pulse required a narrow(1-2ms) and high-res short burst and same time having a long period (~20ms). 


Friday, 5 December 2014

Rescursive digital filter quantization error

In ASK decoding, a narrow band lowpass filter is used to estimate the amplitude of carrier so the decision threshold  can be set to the average carrier amplitude. In integer arithmetic digital filter, When signal is numerically small or the bandwidth of a filter is narrow, quantization error become severe. But how severe? Some Matlab simulation is carried out to demonstrate the effect of quantization error on small number and different bandwidth of lowpass filter.

Small input 
Final filter output is very departed from the expected value

Larger input
Final filter output is less departed from the expected value

Even larger input
Final filter output is quite close to the expected value





Thursday, 4 December 2014

Amplitude estimation

In ASK demodulation, the amplitude of received baseband signal is varying, the fluctuation is caused  by various factor such as path loss, obstacle in the path and multipath fading. In such way, the threshold of 1/0 decision must be adaptive to the dynamic changing amplitude, a digital lowpass filter  is needed. and the bandwidth needed to be narrow compare with the symbol rate, because the symbol is random. for the computational efficiency reason, power of 2 coefficient is chosen.
The proposed filter is consist of two stage, first stage is a recursive filter running at 8x of symbol rate

y = (31y + x)/32
x is input and y is output

The second stage is another recursive filter running at 2x of symbol rate
g = (31g+y)/32

Green trace is the output of first filter and red trace is the output of the second filter. It produce a quite smooth amplitude smoothing despite the symbol is random with equal chance of 1 and 0.