NickReiser's Biped

It’s easy Nick, it a pointer like this------> :laughing:

Lol, such a help, Mike.
:wink:

The other Mike gave me a site that explains it:
codersource.net/cpp_tutorial … inter.html

But… I can’t make much out of it.

What I got from it was that it’s called a “this” pointer (I suppose it’d be called a “my” pointer in VBE).
And, I believe that it points to a class, instead of a variable.

But… I don’t even understand what I’ve just written.
-.-"

And, from what I can tell, VBE.NET doesn’t support pointers of any type.

Does anyone know a way around using “this” pointers?
Or, can anyone anyone explain what’s actually happening during a “this” pointer execution?

what is “this” pointer, you speak of exactly?

no, it’s not a this pointer. A this pointer would be like My in VisualBasic.

Unless you’re doing C/C++ you won’t need to know the details of this, just know that it behaves very much like a “.” in terms of accessing elements of an object. In the case of the PID paper, its accessing elements of a struct.

If you’re still interested, the difference is what sort of access you have to the struct. If you had the actual struct, you’d access its elements with “.” notation. Instead they have a pointer which they are passing around so the “->” notation means follow the pointer to find the struct that it points at and access the named element. Details such as this are abstracted in most modern languages and you’ll probably never have to deal with it. :slight_smile:

Ok… well I had to figure out what structures were, first (it only took three of my five books :stuck_out_tongue:).

But, now, what you said makes a lot more sense.

So, in essence, I can just cut right to the chase and use “.” instead of his arrows, so long as I construct an actual structure.

Any idea why he used something that isn’t very intuitive for a coding example?

Perhaps pointers are a faster way to do it?

well he used C for the example and it makes perfect sense to C programmers. I’ll port the example over to .net and post it sometime today.

public class PID
	{
		public double dState;      	// Last position input
		public double iState;      	// Integrator state
		public double iMax, iMin;  	// Maximum and minimum allowable integrator state
		public double iGain,    	// integral gain
						pGain,    	// proportional gain
						dGain;     	// derivative gain

		public double UpdatePID(double error, double position)
		{
			double pTerm, dTerm, iTerm;
			
			pTerm = this.pGain * error;   
			// calculate the proportional term
			// calculate the integral state with appropriate limiting
			this.iState += error;
			if (this.iState > this.iMax) this.iState = this.iMax;
			else if (this.iState < this.iMin) this.iState = this.iMin;
			iTerm = this.iGain * iState;  // calculate the integral term
			dTerm = this.dGain * (position - this.dState);
			this.dState = position;

			return pTerm + iTerm - dTerm;
		}
		public PID()
		{
			dState = iState = 0;
			iMax = 100; iMin = -100;
		}
	}

project file with test code

Hello Nick,

Are you still working on the pressure sensors for the foot? Have you tried creating a static walking gait with your humanoid like you did with the scout?

Yes and yes.

I was haveing trouble with the pressure sensors at first, but I later found that one of the feet had a severed wire, upstream, and the other had a bad connection on one of the sensor leads.

So, I fixed one of them, and have a decently working one, now.
The other one, I’ll be fixing today.

After that, I think I’ll glue a plate to the bottom of them, so that they’re “sandwiched”.
I’ve been noticing large differences in pressures, because they aren’t all exactly the same size.
I’m hoping that “sandwiching” will spread the pressures out more evenly.

Yes, I got a full gait going, finally, but he’s developped a list to the one side, due to my shifting the weight with a new battery placement.
So far, what works is:

Foreward (crookedly)
Turn Right (in place, not while walking)
Turn Left (same as above)
Get Up (battery shift screwed the last step of getting up)
Combo Punch
Long Punch
Female Dog Slap
Fighting Stance
Taunt

The “Female Dog Slap” is truly funny to watch.

When I made this walking gait, I had him in his “Fighting Stance” (bent knees, bent arms) the entire time.

When I finally finish most of the latest modifications and start redoing the walking gait, I’ll have him stand straight up to walk.
Having him bend his knees the entire time overtaxes those servos more than I’d like.

I’m thinking, though, that I’ll use the pressure sensors to build the next gate as levelly as possible.
That means that it’ll be a while until I undertake that.

I still have to get that WiPort working, too, so I can get rid of that serial-cable tether…
So much to do!

When you say “Glue” the plates, this might cause the plates not to compress causing the pressure sensors not to register properly.

It seems that the pressure sensor idea has cause quite a bit of problems. Have you considered a Memsic tilt sensor? I’m still a long ways from having my own biped, but I plan to create a stable static walking gate first. When I can get it to my satisfaction, I will add a Memsic tilt sensor and “push” the boundaries of the walking gate just out side its statically stable zone and see if I can get the tilt sensor to keep it stable.

I hope you get the wiport working, that should allow you do many things with the PC.

hope you can solve this battery shift problem and get the gait working properly, by the way, if the “female dog slap” is as funny as you say it is, then you need a video :smiley:

Chunga, you supply the video camera, and I’ll supply the laughs.
:stuck_out_tongue:

Mike, I had thought about it, and gave it up, since I wanted a slightly cheaper alternative.

Plus… variable resistors made a lot more sense to a total noob like me.
Accelerometers need breakout boards, a microcontroller to convert them, some ADC’s… etc…

Pressure sensors just seemed more intuitive, to me.

In the end, it won’t matter, because I’ll eventually be using accelerometers, too.

About the gluing…
I’m gluing the top of the sensors to the feet, and the bottom of the sensors to the plate.
The plates themselves won’t be glued together.

The only problem with this, is I need to be very careful to put the same amount of glue on each sensor, to keep them level.
However, it’s not difficult to do that with a gel Loctite (made for plastics!), which squeezes out nice and regularly.

About the WiPort… yea, the processing power will be nice, even though it’s limited to 11Mbs.
However, I don’t need to get the WiPort running for that.
A serial cable allows for exactly the same processing power.
Sure, tethers bite, but I’ll just have to deal with it until I get it running.
:confused:

Nick thinks that he found a way around only having one working serial port on the WiPort.

I think I can just Ad-Hoc to the working port, and talk to the SSC-32 with two of the GPIO pins.

Does that seem feesable?

Other microcontrollers can do TTL communication with any of their I/O pins (though some have dedicated serial pins), right?

Does anyone have a link that deals with creating a “serial port” out of basic I/O pins?

Thanks.

-Nick-

I confirmed with David, that this is doable, but he replied, “If you try and do it over a UDP connection the pins max out around 10,000 bits per second”.

Alternatively, I could rewrite the firmware to make the GPIO pins a priority, rather than a secondary tool, but I’m just not ready for that kind of undertaking, yet.

Dan Albert and I are going to meet this weekend at Robo Madness (an NJ robotics event) and see if we can fix the fried port, which would solve all of my problems.
He thinks that it’ll just be a fried RS232 converter chip, which will be easy enough to replace.

If that doesn’t pan out, David said that my best bet is to just “disconnect and re-connect the TCP connection. That can be done extremely fast.”

So during runtime, I’ll give the WiPort instructions, disable the TCP connection, and allow the WiPort to relay those instructions and then recieve the data back.
Then, after a set interval, I’ll reopen the TCP on my side, gather the return data, and send new instructions.

Well, the future is now looking hopefull, at least.
:slight_smile:

A couple notes on the WiPort (It’s spread out far enough and over enough different problems that it’s a bit hard to follow now) :

Most UARTs controlling serial ports can come anywhere even close to 11m. I’ve seen some that go as high as about 1m, but your PC probably can’t go higher than 115.2k. That’s ok though, because you can’t send data to the SSC32 any faster than 115.2k.

You might be able to get a revised firmware to “bit bang” serial over another two pins. Lantronix will send you there firmware kit for free if you sign an NDA. They call it the CPK. If you want to go this route and can’t find it (I remember it was a bit tricky) I can help out in finding the link again. My fear about this approach though is that depending on the speed on the clock in the micro inside the WiPort, you might have trouble bit banging serial very quickly.

As for the hope that replacing the level converter chip would fix things, what about the TTL port that’s already there? If that’s not working either, it’s unrelated to the level converter.

If you’ve sent the thing back to david, he checked it out and said it works, then start from scratch with everything else. Replace cables, jumpers. Try connecting it to a different PC. Double check your supply voltage. Redo everything you have since you first took the thing out of the box, questioning every step along the way.

Both the TTL and RS232 are fried on Serial Port 1.
David believes that it’s a fault within the main micro of the WiPort, itself.
Still, as before said, trying won’t hurt, and I want to go to the event, anyhow.
:stuck_out_tongue:

I’ve gone over your checklist (and more) about five or six times, with no changes.

It’s definitely a fault in the WiPort itself.

It’s been a while since I posted here, so a big update is in order.

I finally fixed my WiPort problems.
How, you ask?
I converted it into an expensive paperweight.

:laughing:

This time, I’ll K.I.S.S. and go with good old reliable (read: slow) bluetooth and leave WiFi to the big boys.

Yesterday, I sent the biped on its way to Dan’s house.
He’ll be installing a Bluetooth module and taking the biped to Cali on Tuesday for the RoboGames (at least, I think that was the event).

It’s not in any way completed (I didn’t finish programming him to get up after he’s fallen), so I doubt that he’d do decently in any of the Robo1 events (even if Dan has time to enter it, which depends).

However, exposure is all I’m after, anyhow.
Since I can’t get out to Cali and meet the hot gals – oops, I mean big robot guys – myself, I’m sending my biped in my stead.
Who knows, maybe some billionaire benefactor will see promise in what I’m “working” on…
:wink:

Meanwhile, my classes are coming to a close this week, and I’ll have a month free before they start up again.
I plan to use the time wisely to give my biped a total makeover (when he comes back home, that is).

I’d show you guys the plans, but they’re in an inaccessable file format.
This is because I’m using an AutoCAD program that I wrote myself.
I call the program “Pencil And Paper”.
:laughing:

Basically, he’s being converted from a humanoid into an “ape-oid”.
I want a biped that can dynamically and easily switch from bipedal motion into quadrepedal motion.
Thus, an ape’s “knuckle-walking” is perfect for me.

By reversing the slanted “C” brackets, the hands hang down longer.
I’m exchanging the current 4DOF non-gripping hands for 3DOF hands + a gripper (technically, it’s still 4DOF).

The LP waist rotate I’m removing and replacing with a huge 805BB.
I’ve had some problems with overheating the waist rotate with constant use (I really like using it to punch things hard), so I figure that a big-ass servo will do nicely there.
It’ll mean that I’ll have to make my own ASB-04-like bracket for the much bigger servo (hey, Jim, that’s something that we need), but that shouldn’t be too difficult.

I’m also sloping the “butt” upwards with another slanted “C” bracket, which will make his legs shorter.

In essence, I’m widening and lengthening the arms and shortening the legs.
This way, he won’t have to fall onto his hands when he wants a quadrepedal gate.
Instead, he can reach down and touch the floor easilly.
Oh, and I widened the arms so that the feet could go between them without hitting them, just like an ape’s do.

I can’t wait to see how this turns out.
I’m a pretty decent artist, so I’ve got a good idea, but the finished product is always so much better.
Especially when Jim makes it!

:smiley:

After that, I’ll start working on my controller board in earnest.

Oh, almost forgot.
I managed to finish a gait for him that should do nicely.
I have him taking mincing half-steps, which seem to be much more stable.
Because it takes small, quick steps, controlling his position is a lot easier.

When I get him back, I’ll take a video of him walking and (laboriously) upload it.

yayyyy, video!!!

When you get him back? Where is it now?