The arduinoscope is pretty cool. It's pretty slow, though. I might be able to look at servo pulses by switching it to digital mode only (hmm...I wonder if it has a trigger function...), but I don't think it'll do things like measuring microsecond-length pulses to time code execution. So I may have to write my own anyways...goals are:
- Auto-reset trigger function
- 6 channels with 10 us resolution, for servo signals
- 1 channel with 125 ns resolution, for code timing
- New data format to convey this to client
- Client function to measure and display pulse length
It'd be nice to be able to switch between the two operation modes without loading new code, but I'd settle for two different programs.
Next up: inline assembly for the Arduino. This page outlines the basics, here's some Arduino-specific examples, and here's someone who eventually got fed up with the Arduino bootloader and bought an AVR programmer. Let me just remind myself why I'm not doing that: (1) would need to get C compiler and programmer running, (2) would need to build the hardware. Hmm...I may have to do (2) anyways for the servo controller. And there must be a billion forums and tutorials on how to do (1). Aaargh...think simple. But Arduino workarounds aren't simple. Gah. We'll see.
And finally: interrupts. This is a pretty exhaustive tutorial that uses the ISR vectors, the Arduino folks recommend attachInterrupt(), which I'm skeptical about, and here's a great article on timing the Arduino interrupt overhead.
Some final thoughts: If I want to implement a Kalman filter in the AHRS, I'll need matrix inverses. Of somewhat large matrices. And I'll need to do it on an 8-bit processor running at 8 Mhz. I guess I can run simple linear filters at the ADC refresh rate and then run the estimator at 60 Hz. Anyways, looks like I'll have to brush up on numerical methods for fast matrix inverses. Also, write some highly-optimized matrix multiplication code.
Some final thoughts: If I want to implement a Kalman filter in the AHRS, I'll need matrix inverses. Of somewhat large matrices. And I'll need to do it on an 8-bit processor running at 8 Mhz. I guess I can run simple linear filters at the ADC refresh rate and then run the estimator at 60 Hz. Anyways, looks like I'll have to brush up on numerical methods for fast matrix inverses. Also, write some highly-optimized matrix multiplication code.
No comments:
Post a Comment