Thursday, April 15, 2010

Arduino tools!

I got the arduinoscope up and running. It took some doing...if you want to run the source code (which I needed b/c the default COM port was wrong), then you need to get Processing and put all the code in the "libraries" folder of the . You'll also need the library controlP5. Also don't forget to install the Arduino FTDI driver.

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:
  1. Auto-reset trigger function
  2. 6 channels with 10 us resolution, for servo signals
  3. 1 channel with 125 ns resolution, for code timing
  4. New data format to convey this to client
  5. 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.

No comments:

Post a Comment