No luck with auto correlation curves using Calibrate_All
I'm running the Calibrate_All with a home made BS2E robot and wheel encoders. I then used the Calibrate All Windows program to download and graph the data which you can see below.
The pulse widths versus velocity curves look great (except for a slight flattening around the origin for the left wheel). To me that says that both encoders are working, and that's been my experience with some other test programs I've run. But what is strange is the photo sensor and auto correlation curves. The curves don't look half bad, except the red and green curves are 180 degrees out of phase. I guess I'm wondering what's up with that? I read the source code to "Calibrate_All.bs2" and it samples the photocell once, wires a word, and then pulses both wheels. So I don't understand how this could happen. Here's a snippet of the code that does this.
The one thing that struck me as odd was the line Dist(RIGHT) = 1 - Dist(RIGHT). I guess I would have expected Dist(RIGHT) = 1 - Dist(LEFT).
Update: I made that change and it made no different. The data is still 180 degrees out of phase. Here's the raw correlation data.
The pulse widths versus velocity curves look great (except for a slight flattening around the origin for the left wheel). To me that says that both encoders are working, and that's been my experience with some other test programs I've run. But what is strange is the photo sensor and auto correlation curves. The curves don't look half bad, except the red and green curves are 180 degrees out of phase. I guess I'm wondering what's up with that? I read the source code to "Calibrate_All.bs2" and it samples the photocell once, wires a word, and then pulses both wheels. So I don't understand how this could happen. Here's a snippet of the code that does this.
CASE 3 PAUSE 5000 FOR i = 0 TO 512 STEP 2 HIGH Photo PAUSE 6 RCTIME Photo, 1, Value WRITE i + 64, Value.HIGHBYTE WRITE i + 65, Value.LOWBYTE Dist(LEFT) = i.BIT1 Dist(RIGHT) = 1 - Dist(RIGHT) Dir(LEFT) = FWD Dir(RIGHT) = BAK Veloc = 1 GOSUB DoMove NEXT END
The one thing that struck me as odd was the line Dist(RIGHT) = 1 - Dist(RIGHT). I guess I would have expected Dist(RIGHT) = 1 - Dist(LEFT).
Update: I made that change and it made no different. The data is still 180 degrees out of phase. Here's the raw correlation data.
Copy and paste these DATA statements into your BASIC Stamp programs: DATA @0, 6,15,23,28,33,38,43,47 DATA 52,57,62,68,74,80,86,92 DATA 10,17,21,28,34,39,44,50 DATA 55,61,66,72,78,84,89,95 DATA 16,19,23,28,32,37,41,46 DATA 51,55,60,66,72,77,83,89 DATA 18,20,25,31,36,40,45,51 DATA 57,62,68,75,81,87,93,100 Autocorrelation data for Calibrate_All.exe: 8,10,11,18,23,55,64,83 97,117,138,155,163,172,190,213 227,242,228,223,228,245,264,287 298,333,399,430,442,402,351,286 229,188,173,156,148,129,116,98 84,30,9,8,8,7,7,9 12,19,36,59,71,89,104,118 125,148,178,200,211,202,190,191 194,201,214,227,239,267,283,306 322,319,291,277,262,237,206,166 138,116,98,83,70,54,12,5 5,5,5,5,7,10,17,39 57,66,83,95,112,134,163,181 188,191,193,187,185,184,185,186 187,190,195,203,215,224,258,293 305,302,270,235,211,171,159,128 103,89,76,67,40,9,5,5 4,4,5,8,11,23,43,60 74,87,100,115,140,171,189,193 186,179,178,180,184,194,207,216 238,264,294,300,272,240,189,160 128,113,90,77,68,49,12,5 5,5,4,4,6,9,15,37 57,68,84,96,111,133,162,173 181,185,180,172,174,180,189,201 218,233,276,304,315,291,263,215 186,169,160,144,127,103,88,76 64,37,6,5,5,5,5,5 9,13,27,48,65,77,88,101 119,139,168,180,186,177,176,179 185,195,208,221,232,248,294,306 310,312,305,280,247,199,163,135 END
Comments
I'm not sure what I can do to improve my data.
What the program appears to be complaining about is the increasing period, not the shape of the curve. Are you doing the calibration on carpet by any chance? A hard surface works best.
-Phil