Hybrid Terrain adaption

Hi Kurt,

I’m my previous post I described how the balance calculations are involved in this process. Since the body moves with the leg that is going down it is not possible to only stop the single leg. We have to stop all servos at all time. To demonstrate this you could try the single leg control on your hex with balance mode on. You will see that if the leg goes down the body will follow as well.

My idea is to use the binary stop all command. Then use the binary query command to only query the needed bytes for the 24 servos. All @115200 offcourse.

I did some tests with the stop command to test the overshoot created by the mechanical sensor and delay in software. I created a small program which lowered the leg until the sensor was hit. Then it send the stop command. The overshoot was there, but not that big. Off course it got bigger once the speed went up but It’s a good thing to repeat this test once the T-Hex is in. I also hooked up the logic analyzer but I can’t remember the values. I really should start writing more down. :confused:

Good question. I was planning on going into further detail later but lets talk about this now.

Let’s say we start with the most TA compatible gait.

If leg A is moving down from position 2 to position 3. At the same time a leg (say B) is moving from position 4 to 5. If leg A hits the ground at half hight all servos stop. This will also mean that leg B is half way. But let B is on the ground and that position is static at that time. Then we calculate so we know where all legs are. (I get back on that) Once all legs are on a known position again we can finish the rest of the move horizontal. This way ONLY the vertical movement stopped and the horizontal movement will be finished.

When you study the gait you will see that ALL gaits will have the same pattern that we can use as reference. In each gait the hex will have 3 legs on the ground that form a triangle. This triangle is always formed by left front, left rear and middle right OR right front, right rear or left middle. Since the legs are always on the ground we can calculate from the static tars to the body. From the body we can calculate to the unknown leg positions. I’m planning an detailed post on this including the needed Math.

I agree, this sure has some potential. I’m not throwing this idea from the table we just have to see what the best method would be. I really have to think about his one a bit more.

I do not agree on this part. In #2 we stop the servos and query the servo angles. We need to do FK to determain the position for each joint relatively to the origin. In method #3 we can do a approximation to the new position which lies somewhere in the path between point P1 and P2. This approximation should directly give us a position. So there is no need to do FK.

I’ve made a flow diagram that shows where to do what in the code. I think it should work for our first test setup. This is also the flowchart of the last program I’ve send to you kurt. But it isn’t bug free :wink:

img40.imageshack.us/img40/8287/softwareflowdiagram.jpg
The red part shows the newly added parts. It would be great if you could study it and see if I forgot something.

Note: I used a masked byte for the flag. This makes it possible to have more legs which are going down at once. I suggest we only use a simple gait that only has one leg going down at the time but with the masked byte we could get this to work with a tripodgait in the future.

About the ARC vs SSC/BAP: the ARC has a big plus on his side that we don’t have to send commands down and forward the serial connection which spares us time. But with the send/receive part already done it is fine by me to go with either setups. The time it takes to send/receive the data only takes a bit more time that we could improve once we’ve got a working prototype.

That’s all for now.

Xan

Hi Xan,

Looks like you have a good handle on this stuff! Can not wait to get my hands on to it and see how well it is working. I will wait until then to comment much on the code flow until then.

It will be good to retry this type of code out again and see the different results. This will also help me to optimize the interrupt handlers and try out different approaches. As you mentioned we will should try to document this.

You are probably correct, that you would not need to do the FK. That is my initial thought as well. That is if we are moving from point (X,Y,Z) of lets say (100, 100, 100) to (500, 500, 500) in 100 units of time and we know we made contact in 50 units of time. We can guess that contact was made at (X, Y, Z) of (300, 300, 300). Likewise I would expect that the servo pulse widths for the Tars, Tibia, and coxa servos would each have 50% of their delta from the starting to ending pulse widths.

What I was wondering is that if I did a IK for the position (300, 300, 300), would the IK choose the same servo angles(pulse widths) of where we stopped, or might it choose a different solution. If so does that matter?

My initial thoughts on this was, yeah it might choose a different solution, but it will probably correct this when it issues a new move…
So I am hoping that this will be a non-issue. Not sure if I am making any sense here.

That is all for now.
Kurt

Has anybody tested sending the stop command in series to three servos that are moving to check the response time? I would think that due to the flex in the legs that undershoot might be the issue. Below is the simple aluminum foil/paper clip test I did ~2 years ago checking the position every 20ms at 9600bps. If you can shorten this time then better response would be expected. As to the balancing, a simple approach of averaging the positions of the legs on a side and comparing that value to a desired median position band would be a simple place to start. If the the average is outside the band, then add/subtract the difference from the center position of the median band and increase/decrease the positions of all the legs on that side the amount of the difference to reparallel that side with the assumed ground surface. And once again for those on a budget or those that don’t want to wait for the ground switches, the critical testing can be done using aluminum foil.

youtube.com/watch?v=3zQalB0bfNE

in my test
viewtopic.php?p=70612#p70612
using WKPINT it overshoot by apx. 1mm, but the error will be more if speed of HSERVO is more than servospeed

How maxed out is the AtomPro in processing?

As for the terrain adaption have you ever thought about using a Gyro mounted flat on the bot and working some code around that?
I had picked up a Gyro at sparkfun and wired it up to an LM315 I think it was made a nice little package that plugs into the botboard. I have some ideas for simple gyro code as I had written some to figure out exactly how a gyro worked electronically, so it appears to me you just sample data and run it though constant loops and monitor changes… so with that said, it seems like a cpu/io intensive task… I’m all ears if I’m wrong.

It would be cool if you could use the AtomPro with the DynaMixle servos since they are all serial and provide feedback, the phoenix would probably be 4x more money but HEY you could have it carry your groceries!

Looking cool so far guys.

–Aaron

Could probably implement PID loops to keep the body in the horizontal plane? Corrections would attempt to keep body level.

Alan KM6VV

Yeah from the diagrams above it looks like having the body level is the incorrect method, but then again I guess it depends on what your trying to accomplish… Haha I bet Zenta would make another A pod with a coaster on its back and walk over books while keeping the can of soda level on its back :stuck_out_tongue:

terrain adaptive quadruped robot. very cool. 8)

Note that it appears to move, set, and adapt one leg at a time. Hmmm…, that seems familiar. 8)

Very very good work !

How would one go about wiring up three gyros to the phoenix heaped using the ABB2 and SSC32? Also Im very curious to know about the type of output gyros give out and how this is programmed?

I’d think you’d have to use some sort of IMU, and read the values in order to use the data. I don’t think directly connecting gyros to R/C servos would help in the case of the Phoenix. Is that what you’re thinking about?

I want to play with the Razor 9DOF IMU.

Alan KM6VV

well my thoughts are that if connecting gyro’s to the ABB as input device’s then can this signal be used to interface the bodys XYZ axis?

An RC gyro has a servo pulse input and the servo connects to the output. I mentioned this because you mentioned connecting three gyros to the walker, not a 3 axis gyro. I believe a 3 axis gyro has simple 0-5vdc outputs.

Yes, that’s my understanding.

Read the three gyros and accelerometers, translate accelerations into earth plane, then apply as error signals to summation in three servo loops to correct roll, pitch and yaw. Three mag sensors could also be read to give you a corrected compass (by virtue of having the three planes to correct for the plane of the “compass”.

All that might be quite a bit of computation, so an IMU with on-board uP can be useful.

For an “R/C Gyro”, you’d have to give it a normal input, and then read the output to get it’s offset (correction). It would be easier to use an IMU output.

bear in mind that I’m still studying all of this!

Alan KM6VV

Thanks for the info Jim, very useful.

3 Axis Flybarless Gyro GY080

Specification
Operating voltage: DC 3.5V-9V
Operating current drain: 60mA
Operating temperature: -15 ~65
Maximal angular velocity: 800 degrees/sec
Tail servo compatibility: 1.52ms analog, 1.52ms digital, 760us digital, 960us digital
Swash plate servo compatibility: 1.52ms analog servo, 1.52ms digital servo
Radio compatibility: PPM, PCM, 2.4G
Supporting firmware upgrade
Supporting Multi-Blade Rotor Head
Dimensions: 37.2 x 25.2 x 13mm
Weight: 20g

Thanks Alan, your info is always informative, even if you are still learning it for your self. :wink:

Those who can’t (won’t) learn anymore will slowly die.

Alan KM6VV

New to this so… been playing ‘cathch-up’ on the posts.

I have probably ready about 50 published papers on this topic from PhD’s in robotics. All of the sucessful ones use neural networks to control gait- which I believe is the major issue. That is, the remaining 5 legs continue on their merry way when things need to change- like stepping up on an obstacle. I DO NOT believe it is possible to incorporate a neural network on a controller of this size (i.e ARC32).

I DO belive that some degree of automation for adapive terrrain can be accomplished by:
1- Use the hex body as the origin in all calculations- the ‘balance routine’- the body attitude must be a result of the foot height of all legs
2- Setting a limit of the leg lift height and joint rotations
3- Keeping the gait type to tripod only (sad)
4-Use a separate routine for lowering the leg incrementally, as it checks for foot contact
5-Use a separate routine for the swing stage of the front legs that checks for contact
6-Use a range sensor to flag when ‘not possible’ movements would be attempted

I am in the process of building the above, and I am still struggling with the code, as well as waiting on parts to be laser cut(REAL sad), but I am making progress…

Look for papers on Hannibal that was sucessful in doing what is attempted here:
Like: users.aber.ac.uk/dpb/ieee_98.pdf

And very interesting:
web.media.mit.edu/~cynthiab/Papers/Breazeal-AutoRo95.pdf- Because it demostrates the problems encounterd with using a reflexive gait vs. pattered gait (i.e. Xan/Phoenix type) controller

Any news on working failsafe “foot-conacts” ?

does anyone know why this link isn’t visible on the forum and why it only shows up on the index?
I cannot access it using C/P either?

if anyone can access the image let me know please.
[font=Helvetica Neue, Helvetica, Arial, sans-serif][size=4][highlight=#ffffff]http://img40.imageshack.us/img40/8287/softwareflowdiagram.jpg [/highlight][/size][/font]

preview.ibb.co/dEbFsb/Capture.jpg
preview.ibb.co/ghk8Cb/t4gr.jpg