Bug

Bug

Tuesday, October 4, 2011

More debugging

So its taken me longer than I thought to debug, I'm having to re-write large portions of the code. One of my problems is I referenced multiple sources for the basis of my code. This led to errors between the various parts. I am now using a single reference.
I'm finally getting real numbers out of my 3 PWM pins for the motor control. This has allowed me to run speed checks using an oscilloscope, the bad news is the total control loop takes 157 microseconds now, it needs to be somewhere around 50-70 microseconds. I discovered that sine/cosine calculations take a long time even on the ARM cpu, so I'm probably going to have to use a lookup table.
This should speed things up a lot and knock off around 100 microseconds from the code.