Updates:
Nathan mentioned in the prevous post , the reset problem is sort-of by design… That is, the code can not handle a timeout within an interrupt handler due to how he cleans up the stack when the timeout happens. There may be some hack ways around this. But this is experimental stuff anyway…
Been playing around with the trying to query with both QP and binary command and I am not getting consistent results, which I am now trying to figure out…
I have lots of stuff being printed out (nice to user Arc32 with HSERIAL for this!)
0 4 0:143(329,554=142)[1189 976=143]143(237,346=141)[1276 1173=141]
0 5 0:62(-607,-375=62)[2073 1853=62]143(237,346=141)[1276 1173=141]
0 6 0:143(212,229=141)[1299 1283=141]143(237,363=140)
WC: 0T: 345:260(1292,1217=141){1280,1240=143}<1321,1252=138>
The first couple of lines show the first two legs (I deleted the rest from this post). I am showing that in these three steps of the sequence the first leg is going to Y positions 143 to 62 back to 143 in tenths of CM. The numbers in the () in this line are the angles of the servos in 10s of degree, with the = showing my calculation for the FK from these angles. The numbers in the ] are the converted to pulses that is sent to the SSC-32 and again the = is my calculated y from these.
The WC line shows that I received WKP_0 interrupt. It also shows the time in ms after the command was issued : time of the command. the values in () are my guesstimate of expected values. Note: I should take into account that the time exceeded and should be the end value. The values in the {} are from the QP command,
serout cSSC_OUT, cSSC_BAUD, "QP", dec cFemurPin(_bWhichWKP), "QP", dec cTibiaPin(_bWhichWKP),13]
serin cSSC_IN, cSSC_BAUD, 10000, _HWKP_TO, [_wFEMFromSSC.lowbyte, _wTIBFromSSC.lowbyte]
_HWKP_TO:
_wFEMFromSSC = _wFEMFromSSC * 10
_wTIBFromSSC = _wTIBFromSSC * 10
These values don’t make any sense to me. I then added the binary query, whose values are shwon in <>
_lSSCMask = (1<<cFemurPin(_bWhichWKP))| (1 << cTibiaPin(_bWhichWKP)) ; generate the mask
serout cSSC_Out, cSSC_BAUD, [0xB0|(_lSSCMask & 0xf),(_lSSCMask>>4) & 0x7f, (_lSSCMask>>11) & 0x7f,(_lSSCMask>>18) & 0x7f,(_lSSCMask>>25) & 0x7f]
serin cSSC_In, cSSC_BAUD, 10000, _HWKP_TO2,[_wFEMFromSSC2.highbyte, _wFEMFromSSC2.lowbyte,_wTIBFromSSC2.highbyte, _wTIBFromSSC2.lowbyte];
_HWKP_TO2:
Note: earlier in the interrupt handler I sent a stop command (0xa2) to the SSC-32.
Still investigating. One question I wonder is if the values returned by these commands take into account the servo zero offset stored on the SSC-32
All for now
Kurt