Beta Test of New Vorpal Code

59 views
Skip to first unread message

Steve Pendergrast

unread,
Jun 23, 2018, 12:14:39 PM6/23/18
to Vorpal Robotics Forum
Hello,

I have posted a fairly large revision of the vorpal hexapod code. It's in the BETA-TEST-RELEASE folder on the shared files here:


On github this is all in a branch called Scratch-Improvements.

As the branch name implies, this new version has numerous improvements, mostly to the Scratch functions.  

To try the new scratch functions, you should:
1. Load the new gamepad and robot code on their respective nanos.
2. download the JS file in the beta test folder onto your computer
3. Go to the scratchx extension url: http://scratchx.org/#scratch
4. Use SHIFT+"LOAD EXPERIMENTAL EXTENSION" then browse to the local JS file instead of using the url based scratch method documented in the wiki. Note: sometimes holding shift while pressing "load experimental extension" doesn't actually work ... sometimes I have to do it a few times, not sure why.

These new scratch features include:

1) The "Record" function in scratch now works far better and appears to be stable. You can program a long click on any W, D, or F button combination to run your own scratch leg motions. This feature was available in the past but it became unstable if you tried to program more than a couple of buttons. During testing I was able to redefine 20 button combinations and call them up with no problems in the new version.

2) Another fix to the recording system is that previously you could not use the gamepad's RECORD button to record a long-click button that was playing a scratch recording... in other words you could not mix and match the two different kinds of recordings. This was due to errors in the internal state machines. This edge case is now fully supported. You can program your own leg motions using scratch, then later mix and match default leg motions (short click on W, D, F buttons) and custom motions (long click on W, D, F motions) into a gamepad recording.

3) There are three new scratch blocks:

3A) ERASE RECORDINGS:  This is a convenient way to wipe out all recordings on the gamepad SD card without using a computer with SD reader.

3B) POSE.  This block allows you to set all 12 leg servos in a single command. It makes it easy, for example, to create a new "no buttons pushed" resting pose for a custom recorded button. It has many other uses as well.

3C) GAIT:    This block allows you to get at the low level GAIT system on the robot. It allows you to define your own custom walking gait. For example, the gamepad has a "high step" tripod gait. But what if you want a gait where the legs go even higher, or maybe not quite as high but moving faster? You can do that with the gait command very easily. Effectively, you can set how far the hips and knees swing back and forth, you can set the timer that controls how fast the gait progresses, and you can even create a forward or backward lean while walking (think about how convenient that is for custom joust modes).  You can also get at an internal ripple gait that's not even available on the gamepad default buttons. Ripple gait is good when you need a highly stable gait, as when moving over very difficult terrain. It moves only one leg at a time so prioritizes stability over speed.

NOTE: These blocks are not yet documented on the wiki, but the above descriptions should be enough to let you experiment.

Other improvements not having to do with scratch:

1) The chirp that occurs in record/play mode is now more frequent, once per second. This makes it easier to tell when you're recording or playing.

2) When long clicking to invoke scratch motions, there is now a high pitch chirp to indicate that you have held the button long enough to have triggered the long click.  So, you'll hear one lower pitched chirp as soon as you press the button (for example W3) but then a higher pitched chirp half a second later confirms you are successfully in long click mode and thus your custom scratch commands will be available on the DPAD.

3) The code that detects when the servo controller browns out now suppresses "scamper" mode for 10 seconds after a brown out. If this happens, attempts to scamper (W4) will result in a normal walk (W1) for 10 seconds following a brownout. This gives the UBEC and servos time to cool down.  We did this because we found little kids will often stay in "scamper" mode continuously for over a minute, which it was not designed to do.  We explain that "the robot gets tired if you make it run too long".  Generally speaking you should be using scamper for short bursts, but asking the robot to remain in a high stress mode for long periods can overheat the motors and the ubec.  We love scamper mode so didn't want to remove it. This is a compromise that allows the software to override user commands that are too demanding.

Note that when batteries get very low, even a normal walk may start causing a brown out ... in that case it's time to charge your batteries! We can only do so much in software ;)

4) If you attempt to use the SD card functions when the SD card is actually not present in the robot (or has been corrupted and is not open-able) then there will be a long low buzzing sound for several seconds.  If you hear that when trying to record/play or execute a scratch recording, it means your SD card is having issues. If it's inserted properly but not working, you may need to stick it into an SD reader on your computer and do a "fix" from your computer operating system. unfortunately, the arduino SD libraries are unable to detect or correct such things.

Why might this happen?  Well, removing the SD card while it's recording or playing is likely to cause an SD corruption (fixable by using a real computer with sd card reader).  In fact, we strongly recommend powering down the gamepad before removing or inserting an SD card.  Also, don't power down the gamepad while you're in RECORD mode on the gamepad, or while you're recording from scratch.  That can leave files in a bad internal state which will temporarily make it unusable by arduino (again, sticking it into your computer will likely cause the operating system to offer to automatically fix it, so this is easy to recover from).

I will be recording a short video to kind of go over these new blocks this coming week. If this is all confusing you, you might want to wait for that demo video.

Well, that's a lot of info.  We are continuing to test but if anyone out there wants to give it a try, please give us feedback.  I would like to make this the main line code within the next few weeks if possible. But it was such a large change we decided to do more testing and ask the community to give it a try.

Thanks in advance!

-Steve P.

Dave Leiner

unread,
Jun 26, 2018, 5:38:31 PM6/26/18
to Vorpal Robotics Forum
I haven't done exhaustive testing but I tried most of the new functions and everything seems to work as expected. Congrats on a major achievement! I know lots of hard work (and fun) went into it. Thanks!

--Dave

vorpalrobotics

unread,
Jun 26, 2018, 6:18:36 PM6/26/18
to Vorpal Robotics Forum
Dave, thanks for testing and also for being a long time supporter of this project!
Reply all
Reply to author
Forward
0 new messages