Subject:
|
Re: Balancing robots
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 20 Jan 2004 23:10:19 GMT
|
Viewed:
|
3449 times
|
| |
| |
Hello PeterBalch,
Tuesday, January 20, 2004, 9:19:20 PM, you wrote:
P> How does a balancing robot like Legway balance on a patterned floor? Or can
P> it?
P> I've got some of the way there.
P> My understanding from reading the web descriptions of various projects is
P> that you _ought_ to measure
P> - angle of tilt
P> - rate of change of tilt
P> - position of wheel
P> - rate of change of wheel
P> If you have only IR sensors then you can measure the rate of change of tilt
P> on a plain floor. If you assume that when the robot is turned on, the IR
P> measurement is "upright" then you can estimate absolute tilt. If you
P> integrate the motor commands over a few seconds and you're mostly heading
P> "forwards" then you adjust the "upright" estimate.
P> But the Legway (for instance) can't measure the position of wheel or the
P> wheel velocity. You can pretend that the motor commands correspond to the
P> wheel velocity and smooth or integrate those numbers. That helps with
P> balance but the results (in my simulation) are never as good as a robot
P> that has wheel encoders. Is it possible to measure wheel velocity by
P> measuring the motor back-emf?
P> On a patterened floor, maybe you can have several IR sensors and discard
P> the measurements with the bigest changes on the assumption that they
P> represent a change in the pattern.
P> Has anyone tried it?
P> Peter
|P> How does a balancing robot like Legway balance on a patterned floor? Or can
|P> it?
|
|P> I've got some of the way there.
|
|P> My understanding from reading the web descriptions of various projects is
|P> that you _ought_ to measure
|P> - angle of tilt
|P> - rate of change of tilt
|P> - position of wheel
|P> - rate of change of wheel
|
|P> If you have only IR sensors then you can measure the rate of change of tilt
|P> on a plain floor. If you assume that when the robot is turned on, the IR
|P> measurement is "upright" then you can estimate absolute tilt. If you
|P> integrate the motor commands over a few seconds and you're mostly heading
|P> "forwards" then you adjust the "upright" estimate.
|
|P> But the Legway (for instance) can't measure the position of wheel or the
|P> wheel velocity. You can pretend that the motor commands correspond to the
|P> wheel velocity and smooth or integrate those numbers. That helps with
|P> balance but the results (in my simulation) are never as good as a robot
|P> that has wheel encoders. Is it possible to measure wheel velocity by
|P> measuring the motor back-emf?
|
|P> On a patterened floor, maybe you can have several IR sensors and discard
|P> the measurements with the bigest changes on the assumption that they
|P> represent a change in the pattern.
|
|P> Has anyone tried it?
P> Peter
I built a Legway clone using two standard lego light sensors, both pointing
down, one on the front one on the back. Control was via a PID type
algorithm. The actual
control wasn't that robust and only worked well in a darkened room but
it did balance and I could get it to spin on the spot. I don't have the
code to hand at the moment but this is a basic pseudo listing.
offset = light_sensor_front - light sensor back;
/*light sensors don't produce an equall reading so need to be matched using an offset.
This is achieved by holding the bot vertically while it takes a
reading*/
while(1)
{
error = light_sensor_front - light sensor back + offset;
error_rate = (error - error_old)/2;
error_int = (error + error_old)/2 + error_int;
error_old = error;
/*PID*/
error_total = (KP * error) + (KI * error_int) + (KD *
error_rate);
if (error_total >= 1)
{
motor direction = forward;
}
else
{
motor direction = reverse;
error_total = -error_total;
}
motor_PWM = error_total
wait 20ms;
}
Think that's it, probably mistakes. That code will just do basic
balance, if you want to move forward alter offset. If you want to
spin use one of the above code blocks for each wheel.
Probably not the best code and no where near as god as Steve's but it
does the job, sort of.
I'm currently messing with a homemade accelerometer circuit. (ADXL105)
and a fe gyroscopes. I've sucessfully interfaced these to the RCX. The
fun is just starting!
Good luck
Allen
--
Best regards,
Allen mailto:Kaptain.korolev@ntlworld.com
|
|
Message has 1 Reply: | | Re: Balancing robots
|
| (...) Hi Allen, Could you post the actual code and perhaps a photograph of your robot, I want to try that for a while and it would eliminate some fiddling! TIA, Philo (21 years ago, 21-Jan-04, to lugnet.robotics)
|
Message is in Reply To:
| | Balancing robots
|
| How does a balancing robot like Legway balance on a patterned floor? Or can it? I've got some of the way there. My understanding from reading the web descriptions of various projects is that you _ought_ to measure - angle of tilt - rate of change (...) (21 years ago, 20-Jan-04, to lugnet.robotics)
|
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|