So I just recently built my 1st biped brat with the brat board II and basic atom pro. I have loaded up the BRAT Servo Offset Finder program to set the servos so that the brat stands properly, angles at 90 degrees, nice and straight, etc… Once I get all servos set, I go ahead and cycle completely through the program so that the settings are saved to the EEPROM. Once thats done, I load up the BRAT Autonomous Walk Code. As soon as the program loads and the brat goes into its initial 0,0 position, its no longer standing up straight like I had it configured to do with the BRAT Servo Offset Finder program. As the programs starts, the brat bends over backwards and does not walk very well AT ALL. Am I missing something, shouldnt the offset finder program save the servo configurations? What can I do to get my servos in a better starting position?
Not entirely sure what you did, but since you are using the SSC-32 and want to position the servos perfectly, did you consider the servo offset command? For example to offset the servo connected to pin #1 by 20us, you would send the command #1PO20.
You would do send this command in the setup / configuration part of the program. It needs to be sent each time.
I assume he is using the Brat offset finder program. For example if you look at your tutorial: lynxmotion.com/images/html/build155.htm at step 3 it talks about this program. I also am assuming that this Brat does not have an SSC-32.
It sounds like he went through the steps to cycle through all of the servos, which should then save away the offsets that it found that was needed to the EEPROM of the Basic Atom Pro 28…
But: note, this only helps if the program you are using to do the walking actually knows about this data and uses it…
For example the program abrat1.bas from the tutorial: lynxmotion.com/images/html/build130.htm
Appears to try to read this data in(ReadServoOffsets). Did not verify that they are using and computing the right checksums… It does have code in place to then use these offsets, as in:
hservo [lefthip\TOINT (-lefthippos*stepsperdegree) + aServoOffsets(3)\TOINT lhspeed, |
righthip\TOINT (righthippos*stepsperdegree) + aServoOffsets(0)\TOINT rhspeed, |
leftknee\TOINT (-leftkneepos*stepsperdegree) + aServoOffsets(4)\TOINT lkspeed, |
rightknee\TOINT (rightkneepos*stepsperdegree) + aServoOffsets(1)\TOINT rkspeed, |
leftankle\TOINT (-leftanklepos*stepsperdegree) + aServoOffsets(5)\TOINT laspeed, |
rightankle\TOINT (rightanklepos*stepsperdegree) + aServoOffsets(2)\TOINT raspeed]
If you are not using this program, you may want to verify that the program you are using does similar, where it adds on the offsets to the positions passed to hservo.
Hope the helps
Kurt
I am not using SSC-32, I have the brat board II and basic atom pro. I have made good progress, just don’t really like the way I had to do it. I would really like to figure out how to make my programs read in and apply servo offsets saved to the EEPROM.
Yes Kurt, the program I am using has the exact code your are referring to. It seems to me that it should work but does not. I am using the brat autonomous walk code: lynxmotion.com/images/html/build130.htm.
Basically what I did to work around this issue is to manually figure out my offsets for each servo and apply them to each server for every single action he takes. So for example, I figured out that in order to get my brat to stand up straight, I had to apply the following offsets:
;Note: arguments are Rightankle,Rightknee,Righthip,Leftankle,Leftknee,Lefthip,speed
gosub movement -5.0, -9.0, -12.0, 4.0, -4.0, 8.0, 0.0]
Then I had to apply those same offsets to each and every action such as right kick, long stride forward, walk, rest, etc…
It’s difficult to do that for each action so applying the offsets once at the beginning of the routine would be much easier. The code seems like it is designed to read in offsets from EEPROM:
aServoOffsets = rep 0\NUMSERVOS ; Use the rep so if size changes we should properly init
; try to retrieve the offsets from EEPROM:
; see how well my pointers work
gosub ReadServoOffsets
But the above code does not seem to work. The only thing I noticed that MAY be the issue is that the code says:
;Program written for Bot Board II, Basic Atom Pro 28, IDE Ver. 8.0.1.7
I do not have IDE Ver. 8.0.1.7, can’t seem to find it. I am using Basic Micro Studio 2.0.0.18. Could it be that BMS is not compiling correctly? Don’t know, just thinking out loud…
Thanks for any help in advance!
It looks like the code is properly set up to use the servo offsets in the movement function.
It has been awhile since I looked at this code…
But if it were me I would look in the ReadServoOffsets:
function and un-comment the serout instructions (remove and then program the brat again and use a terminal window and see what values are read in from the eeprom.
Kurt
Kurt, so I did as you said and I get the following:
RSO: cnt:7 CS in:55
Not sure what those mean but it appears that there are in fact values saved to my EEPROM. Not sure where to go from here. Seems like there should be values for each servo, am I right? IS RSO: cnt:7 a servo count (total servos)? If so, its off by 1, I only have 6 servos. No idea what 55 is.
OK, I think I am figuring this part of it out now. So I found in the offset finder program where you have to set the number of servos, so I changed from 7 to 6. I reset my offsets and saved to EEPROM. Now when I load up autonomous walk, it reads out the following:
RSO: cnt:6 CS in:73 -1875:FFFFF8AD -950:FFFFFC4A -375:FFFFFE89 -1100:FFFFFBB4 500:1F4 -650:FFFFFD76 CS Calc:73
My Brat now stands and walks correctly without me having to offset each and every move.
Thanks for all of the help, I think we got this one solved.