I think Marcham answered this pretty well. If you were using an SSC-32 to control the servos, there are ways to tell the SSC-32 what the servo offsets are for each servo. Although it is limited to I believe + or minus 100 (us) Which probably does not give you the 15 degrees.
If you look at the Phoenix code (for example the 2.1 beta stuff that was posted). I had code in place for the ARC32, which gave a way using the keyboard to enter into Servo Zero offset mode, which you use the debug terminal to find the proper offsets, which I store in the EEPROM of the ARC32. The code then reads these offsets in at init time into an array aServoOffsets, which I then use in all of the place I output stuff to the servos… For example in the function UpdateServoDriver, as well as my emulation of running sequences.
Actually they are the same idea, just pointed out a place where it was done
Although I must admit what I pointed to you is a bit more complex, in that what we passed to the function to output was in 10ths of a degree, so you also had to do the conversion to HSERVO units. Also the code does the work for timed moves, where all of the leg joints get to desired position at the same time…
It’s been ages since I’ve lasted posted anything, however, I have got the walking (to some extent) working so I’ll hopefully have a video of that soon but before I do that, I wanted to ask if there was a way to actually control the speed of a servo using the HSERVO command? For example:
hservo [p1\4500\5000]
;If I understand correctly, the third value (i.e. 5000) should control how long it takes for the servo to reach that position ... but say if I write another bit of code ...
hservo [p1\4500\250]
;The speed at which the servo reaches that position doesn't seem to change ...
So I was wondering if there was a way to actually set a speed because changing the values doesn’t really seem to do anything - if I could get it to slow down, the walking would look much better. ^___^
Yes you can use the third argument in the HSERVO is used to control the speed of how fast to get to the new position, but it is not as straight foreword to use as with SSC-32… You set this value to be how much the servo should change in each 20ms servo pulse cycle. There are examples of how I use it for the Phoenix up in the Arc32 phoenix code. My current stuff up on github…
In your example if you wish for servo 1 to go to 4500 and get there is a quarter second (250ms), you can accomplish this by:
In the above, it says find out out how far we are moving by first asking HSERVO the current position for our pin and subtracting where we are going to. Then we divide it by the number of 20ms cycles…
For now I am assuming you are using a recent version of Studio as there was an issue that if you set the Speed value on the first move, things did not work right, but that was fixed…
Hi everyone!
So after some work this afternoon/evening, I’ve gotten a first attempt for the walking sorted out - although I must warn you, it’s nothing impressive; more of a skating/sliding attempt than walking but movement forwards nonetheless! ^___^
Anyway, here’s the video - ENJOY!
AKdaBAOUS
P.S. I’ll be working on the code some more tonight so I might have a second video uploaded sooner than normal - it’s still a maybe though.
P.P.S. Pardon the cereal bowl and empty milk carton - I was having a snack. :mrgreen:
Great video! Not too clunky at all considering the stage you’re at. But I would like to see more.
Reminds me of the Cyclops, Polyphemus. Perhaps you could build a herd of quadrupeds (sheep) and a group of BRATs, (Odysseus’ men) and program them to escape from Polyphemus attached to the bellies of the quadupedes. What a great project in swarm robotics.
Thanks.
Yeah, I think I’ve gotten a better piece of code laid out - just need to write it up. It does feel good to be back working on the robot. :mrgreen:
Looking pretty good man. It was certainly moving forward.
On a side note: I totally thought the glasses you were wearing in your picture were photoshopped until I saw them in the video. Haha, those things are pretty sweet.
I’ve been working on a better version of the code; (this time after getting some sleep ^__^); and I can confidently say that it is better than the first attempt but clearly still needs improvement, however, since I now have a decent base to work upon, it should (hopefully) be easier since modifications only need to be made and no need for massive code restructuring.
Um … I think that’s pretty much it for the time being …
Oh, I’ll be busy this weekend doing some final revision for a quiz/mini-test thingy next week (it’s worth like 10% of the module mark or something so it’d be good if I passed it - hahaha!), so I will most likely not work on anything this weekend but next weekend should resume as usual.
I should hopefully be able to collect NEXUS from my school which will be good - I’ll then have my two robots to work on again - YES! :mrgreen:
Well then, that’s it for now but stay tuned for updates and stuff!
Oh yes, I almost forgot - Enjoy the video!