MarkF Senior Heliman Location: Palo Alto, CA
| Hi, w.pasman!
Congratulations on measuring the Futaba latency! When I make a little more progress on my project, I'll dive into it. For now, though, I'll address your questions below - I suspect most of your questions may have come from skimming the thread a little too quickly!
How is that possible? A PCM frame takes 14.25ms to transmit from start to end, and you can check the CRC only after the frame is received, so how can you get a latency of 410us from the START of the frame?
As I mentioned, this was a measurement of the raw speed of the code, taken by having the event_delay routine immediately return, instead of waiting for the proper event time. This is a good way of measuring total processing requirements in a real-time system (ignoring hot spots, which are dealt with individually).
Mmmm actually the servos are updated every 14.25ms with Futaba PCM. So I would think they can handle a slightly higher rate of 12ms properly?
Let's hope so! We'll see if this is a problem or not soon enough.
I agree that multiprocessor approach would be good idea. But I wonder why to do this with a serial datalink. How about shared memory, that would cause much less latency and more straightforward software updating.
I'm proceeding with a totally one-chip solution, for both the PCM-FSK and PCM-FQPSK solutions. I'll try to support Angelos' dual-chip solution, since that's the way that he would like to develop his system. As far as shared memory goes, there are very few CPUs in this range that support shared memory - you'd need to do some pretty serious ASIC development. Obviously, one CPU offers the lowest latency, so that's what I'm developing.
I dont know too much about this, but can't you UNDERclock a 900MHz chip? And is a dual conversion setup so difficult, or is it the combination with QPSK modulatin that makes it difficult?
No, you can't underclock these RF chips - they are tuned to have resonant frequency ranges for their amplifiers and filters, and they won't work at all at 72 MHz. As far as the difficulty goes, RF design is always complex and time-consuming, and is hard to prototype properly. This is made even more challenging in the software-defined radio environment, due to the need to prevent digital noise from disturbing the sensitive RF sections (I'm familiar with this - we design software-defined radio gear at work). Dual-conversion just adds to the complexity and the layout, by incorporating a whole new set of oscillator spurs that have to be isolated and filtered out. It's one thing when we have a $4M project at work, it's quite another when I'm trying to do this in my basement!
Developing an FQPSK solution dramatically increases the complexity of this development, since we don't just need to add A/D and D/A converters, we need to do some quite complex math to make this work. This is a major project, which is why it took me so long to decide to tackle it to begin with.
I would consider the code to be illustrative to the things you didn't explain, but probably not many people are really going to run it. The documentation and explanations here are I think more important, just as the specs and design decisions. To interest a manufacturer, I think you have to show a working system, not just a piece of software...
I'm sensing some skepticism in your answers, and that's OK - I'll answer it with results, for the code will speak for itself. One of the reasons that this is taking as long as it is is that I am very heavily documenting the code, as I usually do, specifically to help allow other folks to understand how this works.
As I've mentioned repeatedly, I am definitely going to develop both the hardware and the software for this project.
Be careful not to overestimate the gains from assembly code. Gains up to 3 may be realistic, above that not.
I'm sorry, but that is incorrect. I have more than 25 years of assembly language development experience, and have delivered order-of-magnitude improvements on dozens of projects. On this project, the use of assembly language already delivered more than a 10X speedup, even before I wrote the event compiler. By combining this with the event compiler, it's delivering a ~~20X improvement right now (back-to-back events in pure C would be about ~~4 uS, with the event compiler they currently range from 17nS-217nS, based on event type).
What I'm still missing is a good evaluation of the modulation scheme.Up to now you stick with Futaba's PCM scheme but is that really the way to go to get the smallest latency?
No, I'm not using Futaba's scheme at all. I'm currently using my own 16-channel data format, which consists of a preamble, then nine 10-bit words form the data packet. The first word contains the even/odd and failsafe bits, plus eight switch channel bits. The next four words contain the absolute channel values for channels 1-4 during even subframes, and channels 5-8 on odd subframes. The next two words contain dual 5-bit differentially encoded values with exponential coding - they address channels 5-8 during even frames, and channels 1-4 on odd frames. Following those seven words, are two 10-bit CRC check values. There is no interframe gap. The data rate I am running at for the PCM-FSK version is 6,400 bps, and it'll be ~~10K bps for the PCM-FQPSK solution.
I'm still wondering whether putting more checksums/CRCs/parity bits through the frame could not result in another latency improvement. Like Simprop PCM, but simprop has such a low datarate that most gains are lost in that...
Sorry, I can't comment here, since I'm not familiar with Simprop equipment or data format. I am working hard to deliver much higher data rates, though!
So what's your latency now, MarkF?
The current latency is exactly one RF sample delay after the last symbol of the CRC is received. At 6,400 bps, using 5X RF oversampling, the code is running right now with a minimum latency after the end of each subframe of 31.25 uS. Since I'm trying to use the same microsecond PCM step size of today's servos, the maximum latency after the subframe is 1055.25 uS. If I changed to use PCM to communicate with the servos, as I mentioned earlier, the maximum latency would be about 60 uS.
Best Regards!
MarkF |