Hello,
As a school project, we're working on desinging and building an ornithopter (robot bird). My job is to design a smart controller for the bird that tries to stabilise the flight a little bit (hopefully). The ornithopter will have one main brushless motor (with matching ESC) and has a rotation feedback on one of the gears in the form of a hall-sensor (this signal will be about 100-200Hz max). The tail will be controlled with two RC servos to move it up and down and from left to right.
The 'smart' controller will intercept and override the three PWM (servo) signals coming from the main RX as needed to keep a steady flight. It will also have a gyroscope and accelerometer sensor IC (something like the MPU-6050) to have a little feedback about the movements of the bird. I have a few questions:
I think the main MCU will be an ATMega2561, as I have several laying around, and it will be clocked at 16MHz (maximum the IC supports). For reading out the PWM signals, what would be the best (and the fastest) way? I think maybe having them hooked up to an interrupt pin which then measures the time between state changes.
Would this be sufficient? My main concern about this is using up precious time in the execution of the stabilisation algorithms. I also don't know the frequency of the RX signals (yet), as the RX has yet to be ordered...
My other question is, will a 8-bit MCU do the job? I don't expect to use a lot of floating point calculations, as I know this takes longer to process. Maybe I need to look at the 32-bit MCU's of Atmel? Would it make a big difference in the calculation speed?
As I'm mainly into programming these days, I think my C skills should be up to the job for this project...
Any feedback is greatly appreciated, and I'm going to try to keep this thread updated (and if I don't, feel free to PM me to do so).
DebboR