experimenting

i'm hardware realtime now baby

i've done realtime before. software realtime that is. hardware realtime is different. if your code is too slow it actually might crash things. certain things are expected to happen at certain times and if you are hogging all of the processing power it can't make those things happen. smash.

today i was doing some smoothing math while i was reading in values from the accelerometer. i wasn't even using floating point (ah.. fixed point, my old friend) and it still gave me wanky values. once i move it out of the read loop it was all dandy.

so i got those servos built together in a half-assed two-axis setup. i'm not sure if i screwed something up or if the 20 year old servo is just bad (no way man), but one of the servos jitters like a bitch as it gets close to it target position. so most of my testing today was just in one axis.




i think i am getting to the point where i'll have to start doing actual "electronics" work rather than just hodge-podging together a bunch of shit i bought off the inet. the shit 8bit a/d resolution on the accelerometer eval is just not going to cut it. 5 degrees in real-life is a lot. especially when my servos can hit 0.7 degrees.

i tried clamping maximum position deltas. i tried smoothing. it still works like shit, but in exactly the way you'd expect with 5 degress accuracy. the movement is quantized. which would not be so bad, but the servo has inertia and all that stopping and starting just wiggles thing around worse.

which brings me to the second thing i need to myself.. the servo controller has no concept of velocity. i can't even extract it because the servo controller doesn't really know where the servo is at, it just tells it where to go and instantly thinks it is there. i need the velocity to help get rid of a lot of that stopping and starting. instead of seeking on an absolute position, i need to match velocities too. making 5 stops on your way somewhere because you had 5 samples along the way is just not going to cut it. no wonder all the servo robots look so damn "robotic". haha. i think just having access to the servo pots will be enough to extract the velocities, but if i am going that far, i might as well do all the servo control inside the uC too.

hmm. that all sounds like a lot of work. maybe i'll first set up the rigging system that helps mr biped stand up on his own. i guess i could make him do some lame chucky cheese animatronic action.

btw. when i first put the 2-axis thing together i just aimed the servos at where the accelerometer said they should be. it was awesome. the system would keep feeding back on itself until it just got completely unstable and went nuts. haha. good thing i didn't have the servo horn screws in so it could come apart nicely.