Subject:
|
Re: Help with rotation sensors
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Mon, 24 Jan 2000 02:43:32 GMT
|
Viewed:
|
1994 times
|
| |
| |
In lugnet.robotics.rcx.nqc, Steven Heide writes:
> Is it possible to break this loop when a certain distance is reached? I don't
> want to use another rotation sensor.
You could probably change the first line to
while (SENSOR_1 < target_distance)
and it should work fine. Since you want to keep the two rotation sensor
values (and hence the two wheel distances) equal, each sensor will
individually measure the approximate distance travelled (plus or minus an
angle increment).
One optional bit of advice: If you check the rotation values against each
other directly, the robot might tend to "jiggle" from side to side as it tries
to keep the differences equal. You might be able to get away with setting a
threshold of a few increments, say 3:
...
if (SENSOR_1 > SENSOR_3 + 3)
{
Float(OUT_A);
}
else if (SENSOR_3 > SENSOR_1 + 3)
{
Float(OUT_C);
}
else
...
This way, the robot won't need to adjust turning until the wheels really get
out of sync. As I said, though, this is optional: your use of Float rather
than Off is a good solution because it minimizes jerkiness introduced
by "brake" mode.
> I'm new to programing so this may seem like a silly question.
And as the cliché goes, there are no stupid questions, only stupid answers.
Just because many people in this list talk about high-tech concepts doesn't
mean they mind answering newbie questions too. In fact, often people stumble
over each other in attempt to reply first!
Anyway, hope this helped.
-- Ian
|
|
Message is in Reply To:
| | Help with rotation sensors
|
| Hi all, I'm new to programing so this may seem like a silly question. I'm using two rotation sensors with the program below to eliminate drift caused by different motor speeds. Is it possible to break this loop when a certain distance is reached? I (...) (25 years ago, 23-Jan-00, to lugnet.robotics.rcx.nqc)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|