Page 1 of 1

balancing and position control

Posted: 17 Jan 2011, 20:54
by hergipotter
Hi guys (and gals?)

I'm new to Mindstorms but recently managed to build a robot that is balancing on two wheels (you might call it a nxtway).


I'm quite satisfied so far :)

Now i want to have it drive forwards or backwards, i.e. controlling the position. But i don't really know how to do that.
For balancing, I control the light value from the sensors by adjusting the motorpower with a PID controller.
How do i control the position? Another PID controller controlling the position (i.e. the value of degrees that the motors rotated) by using the motorpower, too?
I guess the controllers would kind of work against each other.

But how could you do it? Any ideas or advices for me?

Re: balancing and position control

Posted: 17 Jan 2011, 21:05
by stryker001
I have no idea what your program is but it would appear that you (1) take a reading, (2) store it as the calibrated reading, (3) check all readings from then on against the first one.

If that's so, you could increase/decrease the stored value and it would think it was leaning forward/backward (respectively) and thus attempt to 'fix' itself.

Just an idea.

Re: balancing and position control

Posted: 17 Jan 2011, 21:11
by hassenplug
hergipotter wrote:Hi guys (and gals?)
Now i want to have it drive forwards or backwards, i.e. controlling the position. But i don't really know how to do that.
Generally, you just want it to lean forward, or backward, and continue to stay balanced. If the robot is leaning forward, it must drive forward to stay balanced.

One way to make it lean forward, is to drive the wheels backwards a small amount. This will cause it to tilt forward, then roll forward to balance.

Another way is to tell it that the "balance point" is just a bit ahead of where it really is.

Steve

Re: balancing and position control

Posted: 17 Jan 2011, 21:18
by hergipotter
Thx for your two answers!

I think the idea of altering the stored balance point is a good start, i will try that first!