rrTV-PHOTO   New HD TV
HOME   rrTV-PHOTO   GALLERIES   MY GALLERY   HELP-FAQ
myHOME PM pmRR MEMBERS 822 ONLINE 21 EVENTS SEARCH REGISTER  START HERE
 
9 pages [ <<    <    ( 1 )     2      3     NEXT    >> ]14491 viewsPOST REPLY
CanoMod . Futaba-RC . A Main Hobbies

.
.
Radio - Servo - Gyro - Gov - Batt > Starting a Home-Brewed PCM Receiver Project
 
 
MarkF
Senior Heliman
Location: Palo Alto, CA

Hi, Gang!

After some great discussions in a thread started by w.pasman called Airtronics: \"World's Fastest\"?, I've decided to start up a home-brewed PCM Receiver project. The main goal of the project will be to understand current PCM systems and how they work, and hopefully, to be able to play around with different possible enhancements.

For folks who aren't into the technology behind their radios and just want to go flying, you won't want to waste your time with this thread! For those few of us that are curious about radios, and ways of possibly making them better, we'll dive into lots of gory technical details as we learn how things work. Make no mistake, I've got a lot to learn, but the best way I've found to learn about things is just to dive in and tackle a project. Along the way, I'm sure we'll run into a few dead ends and blind alleys, but for the few of you that are into this sort of thing, it'll hopefully be an interesting ride.

The Goal

The first goal of the project will be to build up a basic servo-driving platform that uses some of the ideas I came up with in the Airtronics thread, including an efficient method of driving the servos in parallel, and a mechanism for "hiding" almost all of the latency in the receiver.

Once that stage is done, we'll then see if it's possible to reverse engineer the transmission format used by an existing R/C manufacturer, and by tapping into the RF section of a commercial PCM receiver, try to make this work with a real R/C signal.

The Next-Generation?

Along the way, it'll also be fun to play with mocking up a hypothetical next-generation PCM receiver. As a strawman, I'm thinking about a 16-channel PCM receiver that has 8 analog and 8 digital (switch) channels. We'd use differential encoding for speed, and possibly set it up as though QPSK were being used, which would enable a data rate of 16K bps in a single R/C channel. With a very simple differential encoding format, this would provide a sub-frame time of ~6 mS (the servos would be updated every 6 mS), and a frame time of ~12 mS (in the event of a bit error, the servos would recover in 12 mS).

[Note that we probably won't get to the stage of actually building a QPSK encoder and decoder for this platform, since that would require changing the RF section, along with a fast A/D converter for signal conversion. Instead, we'll most likely just stick to the digital realm for this phase, and simulate a 16K bps data stream from another CPU.]

Selecting a Chip

The first decision to make on a project such as this is what platform to use. While microcontrollers such as the Microchip PIC series would be nice due to their low cost, wide availability, and free tools, they really don't offer the performance we'd be looking for for a next-generation receiver platform. In the other thread, I'd mentioned that a 16-bit 16 MHz CPU would probably do the trick, and CPUs such as Fujitsu's MB90F455 would be just about right (other than having too much memory!).

After looking around at a number of 16-bit CPUs, I've decided to make the leap to a 32-bit ARM7 microcontroller. The reality is that no 16-bit architecture has the same breadth of support that ARM does. Instead of having to deal with a proprietary CPU, selecting ARM allows a wide choice of possible chip vendors, a well-stabilized tool chain, and excellent CPU documentation.

The factors that seem to be most important in a microcontroller for a PCM receiver include small package size, low power consumption, low price, and reasonable performance. With these in mind, I'm selecting the Philips LPC2104 chip. This chip in many ways is overkill, with 128KB of on-chip FLASH ROM, 16KB of RAM, and a 60 MHz max core speed! However, this is an extremely efficient core, requiring only about 50 mW of power at full speed. Moreover, its tiny 7mm X 7mm package is ideal for cramming into a tight PCM receiver. Finally, it's priced well below $5 in volume!

The Development System

Since we want to make life as easy as possible, my preference is to start with a preassembled PCB. After looking at what's available for the Philips part, I've selected the $200 Nohau Philips Target Board, shown below:


If you look closely at the board, the Philips chip is the tiny IC that's located halfway between the leftmost serial port and the five pin DIN connector, in the middle of the white square. That's a tiny chip! The picture also shows the Nohau EMUL-ARM debugging probe - this is used to load, execute, and debug code on the Philips chip. Nohau has a special $295 deal that bundles the EMUL-ARM with a "dumbed down" version of the Hi-Tech C compiler that's limited to "just" 16 KB code. For this project, that's way more than we'll need, so it's a good fit (I know the prices may seem quite expensive, but this is actually an extremely good deal in the always pricey development tools market).


Well, that's it for now! I'm waiting for the tools to arrive, am learning about the Philips chip, and am coding up the basic servo-driving code in C (ultimately, this will most likely evolve to assembly language). I have no idea whatsoever how long this'll take, since my schedule is completely unpredictable thanks to work, but hey, even a journey of 1,000 miles begins with a single step.

Any feedback? Thoughts? Comments? I really am interested in knowing what folks would like to see in a project like this, and will try to make it match what folks would find most interesting as we move forward. Thanks for wading through all this!

Have Fun!
MarkF
10-08-2003 Over year old.
HOMEPAGE  
 
 
Carps
Veteran
Location: Caterham, Surrey, England

Quote 
Any feedback? Thoughts? Comments?


Just one - you're nuts

Good luck...
10-08-2003 Over year old.
HOMEPAGE  
 
 
mr.rc-cam
Heliman
Location: USA

Sounds like an interesting project. Good luck.
10-08-2003 Over year old.
HOMEPAGE  
 
 
Andy Williamson
Heliman
Location: Pahoa, Hi

Cool!
10-08-2003 Over year old.
 
 
sharam
Elite Veteran
Location: Northern California

Good project.

Have you thought about a Transmitter/Receiver project that has handshake codes between them that will enable them to only work with each other?

Might this prevent hits from someone who turns on a Transmitter on your frequency? Essentially, the thought is that if the Rcvr receives two sginals, it looks to see which one has the correct handshake header code. It then rejects the other one and executes the one with the correct code.

Thoughts?
10-08-2003 Over year old.
 
 
pilotError
Key Veteran
Location: Long Island, NY

Transmitter and Receiver???

A while back Angelos was looking to start a homebuilt transmitter project, he was looking for help and went and did some research, here's a couple of links regarding some of it. You guys had some similar conclusions as far as chips, etc. I was somewhat interested in jumping in, but with 3 little ones at home, it wasn't realistic. You guys might want to coordinate with your efforts and come up with something pretty cool.

http://www.runryder.com/helicopter/t43034p1/

http://www.runryder.com/helicopter/t45470p1/

Mike...

Good Judgement comes from Experience. Great Judgement comes from Bad Experience.
10-08-2003 Over year old.
 
 
Angelos
Key Veteran
Location: nr Oxford, OX11, UK

pilotError already covered most of what I was about to say. The PCM decoder is complete but I still haven't found anyone with RF experience to design the RF part for me.

The transmitter project is going well too. The CPU now reads all switches, sticks, knobs, trims... and generates PPM. No special features yet like curves etc but I am not concerned about that. It is only software. I need to get all hardware working first.

-Angelos
10-08-2003 Over year old.
 
 
RotorX
Key Veteran
Location: London

Trying to keep up, would be nice if you could add in brackets what the acronyms are - sorry to be a pain, but very very interesting, but carps is right you is mad - go Mark


Kaz


Kaz
10-08-2003 Over year old.
 
 
mr.rc-cam
Heliman
Location: USA

Quote 
...I still haven't found anyone with RF experience to design the RF part for me.
Why not use an existing RF module like JR's NET-J72P. If you use a 6-meter version and you are a ham, the project would even be FCC "legal."
10-08-2003 Over year old.
HOMEPAGE  
 
 
Angelos
Key Veteran
Location: nr Oxford, OX11, UK

mr-rc-cam,
this is exactly what I have done. For the TX project I use the case and joysticks of an old Futaba challenger. I have added some switches so it now had 8 in total, trims are converted to digital and I also added sliders. The nice thing with this radio is that the RF part is on a separate PCB inside. http://www.model-gadgets.com/tmp/tx3.jpg Some of the electronics like amplifiers and analogue multiplexers go inside the TX, the CPU board is for now on a separate PCB outside the radio connected with a ribbon cable http://www.model-gadgets.com/tmp/tx02.jpg

My problem is the PCM receiver RF part. For now I use the RF front-end from a GWS receiver and works fine. http://www.model-gadgets.com/tmp/pcm.htm However, I am looking for a good (possibly PLL - synthesized) design for a production receiver.
10-09-2003 Over year old.
 
 
mr.rc-cam
Heliman
Location: USA

Quote 
... I am looking for a good (possibly PLL - synthesized) design for a production receiver.
You might be able to get some RF front end ideas from this synthesized Rx project: http://home.nordnet.fr/~fthobois/anglais/introrx21.htm
10-09-2003 Over year old.
HOMEPAGE  
 
 
MarkF
Senior Heliman
Location: Palo Alto, CA

Hi, Gang!

Everyone: Thank you very much for the great encouragement - that's very cool of you! This probably is kind of a nutty project, but it's nice to know that I'm not alone!

Angelos: Congratulations on pulling this off - great job! I hadn't heard about your efforts previously, so I just dove in! Hmmm, since you've already made such great progress, maybe I ought to shift the emphasis of my project to the next-generation QPSK [Quadrature Phase Shift Keying] setup. The biggest problem is that this requires that the RF [Radio Frequency] strips change from a simple "hard" digital encoding to a linear encoding (consequently, the receiver doesn't use a data slicer). With good linear response, all we need is a D/A [Digital/Analog] converter on the transmitter, and an A/D [Analog/Digital] converter on the receiver. Modulating and demodulating QPSK is quite straightforward.

As it turns out, the Philips chip I'm using is actually a good choice for both the transmitter and the receiver, with up to 128KB FLASH ROM [FLASH ROM is rewriteable "Read Only Memory"] and 64K RAM on the LPC2106 chip, plus a solid 60 MHz core (plus a 256-bit FLASH prefetcher that delivers 0-wait state code access). The only thing that would be a slight pain for the transmitter application is that this chip doesn't have lots of on-chip A/Ds for reading the pots, so it'd be necessary to add on an external multichannel A/D converter.

So, while I won't promise anything yet, if we're going to consider tackling the RF section, we might as well get a significant benefit out of it, and QPSK would be a BIG benefit!

Sharam: Thanks for the idea! As it turns out, I've already got two features that will help the receiver from being fooled by interference, including a special preamble, and a two-byte CRC [Cyclic Redundancy Check] that will prevent a frame from being acted upon if any bits are received in error.

Your suggestion to include a unique ID would definitely work, but I'm not sure that it would accomplish what you would like it to. Since RF signals mix together, the only real benefit this would offer would be to prevent someone else from taking off with your model, if your receiver was turned on, but your transmitter was turned off! If both transmitters are on, the preamble and CRC checks will force a hold condition, and if the errors continue, eventually failsafe will kick in. Note that if transmission weren't continuous, your idea could offer a significant benefit, but to reduce latency, each transmitter will essentially transmit continuously. Good idea, though!

RC-Cam: Thanks for the excellent pointers! As I mentioned earlier, the key difference with QPSK is that it needs nice linear phase response on both the transmitter and the receiver's RF strips, but maybe I'll experiment with tapping into commercial RF modules to see if any of them can hack it!


Starting Up

Wow - that was fast! As it turns out, Nohau's located not far from me, and I received the target board, the in-circuit debugger, and the C-compilers the day after I ordered them!

Everything looks OK, with the exception of the Hitech C Compiler and IDE [Integrated Development Environment] - for some reason, they're locking up hard on my system. Fortunately, Nohau provided TWO different 16KB-limited C compilers, and the second is by a company called IAR, which is running fine. At least we are able to load, execute, and debug code!


Proposed PCM Format

Particularly since Angelos has already reverse engineered the Futaba PCM format, I'm thinking more about the 16-channel format I'd mentioned above. The encoding I'll probably start with would be a very basic differentially encoded format that's conceptually similar to the Futaba format described earlier. It would include a (length to be determined) preamble, followed by nine 10-bit words, as follows:
  • The Control Word would be bit mapped, with Bit 9 indicating a Failsafe frame if high/Normal frame if low, Bit 8 would indicate an Odd Frame if high/Even frame if low, and bits 0..7 would be the switch channels.
  • During an even frame, the next four words would contain absolute values for analog channels 1-4. During an odd frame, these words would contain the absolute values for analog channels 5-8.
  • During an even frame, the next two words would contain four 5-bit differentially encoded values for channels 5-8, and during an odd frame, it would contain differential values for channels 1-4. With linear encoding, this would only offer the ability for alternate frames to encode a position value of +/-15, so I'll probably encode the differential values with the equivalent of an ~exponential function, allowing faster response to large control changes.As one possible example, the values could be encoded as something like 0, +/- 1, 2, 3, 4, 5, 6, 8, 16, 32, 48, 80, 128, 208, 336, 544.
  • The last two words would be the Cyclic Redundancy Code that detects bit errors.
During Failsafe frames, the Failsafe values would be encoded in the absolute value words, and the hold/set state for each value would be encoded in the switch bits. I'm still thinking about what we might put in the differential fields during Failsafe frames, but it might well be a set of four possible endpoints for each On/Off switch state, allowing "analog" control values to be sent from the "digital" switches.

Well, that's where we are today! Thanks again, everyone, for the encouragement!

Have Fun!
MarkF
10-09-2003 Over year old.
HOMEPAGE  
 
 
rockier
Key Veteran
Location: Las Vegas

MarkF,

Quote 
Your suggestion to include a unique ID would definitely work, but I'm not sure that it would accomplish what you would like it to.


This would be a great idea because this would allow two people on the same channel to not interfere with each other. Or may not for the time you would need to get the model down. This may also help on doing a synthesize module.

------,\\\|///,-----
___*| # # |*
oo0---(_)---0oo
10-09-2003 Over year old.
HOMEPAGE  
 
 
Angelos
Key Veteran
Location: nr Oxford, OX11, UK

MarkF,
a few quick points

I am using ARM9 CPU capable for 133MHz but the frequency can be lowered by an internal PLL to reduce power consumption. 133Mhz though means that it could run the CSM simulator if the software was ported

I use Smartmedia card. The boot firmware is limited to decoding FAT16 file system and load the firmware located in the smartmedia. This also means that you can save your model programs in the smartmedia as ASCII files.

Of course I wouldn't miss a USB connection The USB controller is build in the CPU and will allow accessing the smartmedia or making the TX show as a joystick on the PC. I haven't written any code for that yet.

My software is very modular and designing this is where i spent most of the time. At the moment I wrote code only for PPM but you can add plug-ins for PCM or whatever else you like. It is good to have more channels but remember you are working on a very limited bandwidth which is less than 5KHz. This limits your data rates and thus the number of channels. You are of course suggesting QPSK but isn't this more sensitive to interference?
10-09-2003 Over year old.
 
 
MarkF
Senior Heliman
Location: Palo Alto, CA

Hi, Angelos!

Sounds like a great TX platform - very nice! QPSK is surprisingly efficient. FSK is used primarily because it is simple and cheap, but a good differentially demodulated coherent QPSK receiver can actually deliver superior SNR performance than a simple FSK setup! Phase shift keying is fundamentally more noise tolerant than frequency shift keying by about 3 dB, and QPSK delivers twice the spectral efficiency of BPSK [Binary Phase Shift Keying].

Here's a useful general link that contains a good table of usable SNRs for different modulation formats at equivalent bit error rates (check the table on page 18). See Fundamentals of Digital Modulation.

The downside of QPSK is that it is more expensive, since making the power amplifier linear costs more than a simple two-state driver, plus the need for D/A and A/D converters, plus more processing power is required. However, in the context of the chips we're talking about, that's just not a big deal!

In summary, QPSK is hot stuff!

Have Fun!
MarkF
10-09-2003 Over year old.
HOMEPAGE  
 
 
Optech
Key Veteran
Location: Vista/Oceanside, CA.

Same Frequency confusion.

I think what people are getting confused about is that when two transmitters are operating on the same frequency, and they are not syncronized somehow, there is no way to seperate out data efficiently.

Think of it this way. If you run two streams of water together how will you determine what water came from what stream or more to the point, how would you reject the water from one stream without rejecting the other.

One way would be spread spectrum frequency hopping but I don't think the FCC will let that one by.

Mike

Viva La Airtronics!
10-09-2003 Over year old.
 
 
rockier
Key Veteran
Location: Las Vegas

Optech, Good point on that.

------,\\\|///,-----
___*| # # |*
oo0---(_)---0oo
10-09-2003 Over year old.
HOMEPAGE  
 
 
MarkF
Senior Heliman
Location: Palo Alto, CA

Hi, Folks!

I should have elaborated a bit about that noise table. The value in the table isn't actually SNR (Signal/Noise Ratio), but Eb/No (Energy/bit / Noise level). However, with coherent decoding, there is no interference or crosstalk between the two carriers that comprise a QPSK transmission, so the bit error rate is identical to BPSK transmission. Now, QPSK is normally transmitted differentially (a symbol's value depends on the value of the prior symbol), so errors usually occur in pairs, making the BER in the real world twice as high. However, in R/C, we aren't correcting bit errors, so a single error in a frame will already cause us to reject the frame! If a second error occurs due to the first symbol error, it doesn't make any difference, so we can actually use the high-performance differential encoding "for free"! A couple of other tricks such as grey coding help to further deliver slight improvements in SNR performance.

As a result, we can actually deliver double the bit rate of current FSK schemes with better real noise ratio performance!

Cheers!
MarkF
10-09-2003 Over year old.
HOMEPAGE  
 
 
Angelos
Key Veteran
Location: nr Oxford, OX11, UK

MarkF,
Here is what I have in mind… I plan to develop a direct replacement processor PCB for the 9Z. There are lots of the original 9Z radios out there which are not longer very respected. I hope that I won’t have to replace the large PCB at the rear but I could do that if necessary.

In my current design the ARM9 CPU does everything. From reading the ADCs to generating the PPM or PCM protocol. This is an elegant solution that Futaba is also following with all their radios. However, you need to be very careful with the timing of generating the PCM bit stream. This is the highest priority task for the ARM9. My current calculations work ok with PCM and PPM and other variants but I may get in trouble if I try to develop ‘exotic’ modulation techniques. For QPSK I would also need to redesign the rear (large) PCB if the 9Z and perhaps the TX module.

One possibility is to have a dedicated microcontroller on a RS232 link to the ARM9 which also has an RS232 controller build into it. Then let the microcontroller handle the encoding of the signal. Microcontrollers nowadays cost next to nothing and this is a neat solution as the microcontroller handles the time critical task of protocol generation. This makes it difficult to update the firmware on the microcontroller though. It is possible for ARM9 to check what firmware the microcontroller uses and if it requires updating to send the new one through the RS232 so that the microcontroller can re-flash itself. I know microcontroller that can do that, but wouldn’t it be better if I didn’t put myself in all that trouble and have the ARM9 do all the tasks?

-Angelos
10-09-2003 Over year old.
 
 
MarkF
Senior Heliman
Location: Palo Alto, CA

Howdy, again!

As further confirmation of the value of QPSK, the IS-136 TDMA cellular system delivers 48.6 Kbps in a 30 KHz channel, by using a variant of QPSK called pi/4 DQPSK. In a nutshell, pi/4 DQPSK uses eight possible transmit states, alternating between two different sets of four possible transmit phases with each symbol.

In our 10 KHz channels, we should be able to deliver very close to 16 Kbps using QPSK!

Have Fun!
MarkF
10-09-2003 Over year old.
HOMEPAGE  
 
 
9 pages [ <<    <    ( 1 )     2      3     NEXT    >> ]14491 viewsPOST REPLY
Boca Bearings . Modefo's RC Helicopters . XHELI.COM

.
.
Radio - Servo - Gyro - Gov - Batt > Starting a Home-Brewed PCM Receiver Project
 PRINT TOPIC Advertisers 

Subscribe to This Topic

Thursday, December 4 - 10:18 pm - Copyright © 2000 - 2008 runryder.com | email | link to rr | runryder needs cookie