Electronic – DSP for single-precision control signal generation

controldsp

At present I am frustrated by the limitations of fixed-point arithmetic on a microcontroller for a quadrotor aircraft. The aircraft I am experimenting with is using an ATMEGA. I got to thinking, would it be possible to replace the ATMEGA with a single-point floating unit equipped DSP?

My requirements are:

  • 12 bit ADC
  • single percision FPU
  • 100 Hz control signal rates
  • would like gcc as a compiler toolchain

The existing control board has specifications listed online. It uses an ATMEGA1284P, and that is the part I am looking to replace. That would mean the CPU clock should be at least 20 MHz and there needs to be around 32 output pins, some of which support I2C.

If you have experience with DSP controllers and have some recommendations for this project. CPU part numbers that are available from digikey or online would be even better.

EDIT: latency changed to rate

Best Answer

100 Hz is really slow for most micros. A dsPIC 33F or 24H, for example, can execute 400,000 instructions in that time.

Unless you are doing something unusual, you probably don't need hardware floating point. 400 k instruction is a lot, even if 100 or so at a time are used to perform individual floating point operations.

You probably don't really need what is traditionally cosidered "single precision". Note that "single precision" by itelf is a meaningless term in a absolute sense since it is machine and implementation dependent. Single is only meaningful relative to "double", with the only meaning that the latter has more precision and probably more range. Assuming you meant 24 bit mantissa, do you really need all that? As you say, measurements will be 12 bits, and the resulting outputs probably less than that. I often use a FP format with 16 mantissa bits in cases like this. That still leaves a few extra bits so that quantization errors from multiple operations stay below your original noise level, but generally maps better to available hardware and is therefore faster.

So instead of saying you need FP hardware, you should be saying what kind of operations you need to perform every 10 ms. There's a good chance to you don't need FP hardware to meet the spec. That leaves a much larger world of micros available to you, which can be useful for their other attributes, like a better PWM outputs to drive the motors, for example.

Related Topic