To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1683
1682  |  1684
Subject: 
Re: Straight moving with only one rotation sensor
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Fri, 11 Jun 2004 03:12:29 GMT
Viewed: 
4685 times
  
I did this in the past (since disassembled the bot) and found it to be
quite reliable; except on slippery surfaces and carpet.  :)

The trick that I employed was to gear-up the rotation sensor.  This
causes the rotation sensor to detect even a slight difference between
the motor outputs (although it generally increases the space needed)

Also, you should be able to get fairly reliable turns (45 degree, 90,
180, etc...)

I am interested in seeing pictures when you are done; and updates to the
program!

// Joe
http://www.calledtoconstruct.com

Nicolas Alvarez wrote:

Hi

I saw in the LEGO Mindstorms Web Page that many people made their robots with 2
motors go straight using one rotation sensor on each wheel and stopping the
correct motor until both sensors were equal.

I got Ultimate Accessory Set as a present some months ago and I wanted to make
robots go straight using only one rotation sensor. I made it using a
differential.

Here is the unfinished NQC program for it:

#pragma init myinit

void myinit()
{
  SetPower(OUT_A+OUT_B+OUT_C, 7);
  SetDirection(OUT_A+OUT_B+OUT_C, OUT_REV);
}

task main()
{
  SetSensorType(SENSOR_3, SENSOR_TYPE_ROTATION);
  SetSensorMode(SENSOR_3, SENSOR_MODE_ROTATION);
  int sensorval;
  while(true)
  {
    sensorval=SensorValue(2)/2;
    if(sensorval > 0)
    {
      On(OUT_A);
      Off(OUT_C);
    }
    else if(sensorval < 0)
    {
      Off(OUT_A);
      On(OUT_C);
    }
    else
    {
      On(OUT_A + OUT_C);
      Wait(10);
    }
  }
}

LMKWYT

--
- Nicolas Alvarez
nicoalvar0.no.spam@hotmail.com







Message is in Reply To:
  Straight moving with only one rotation sensor
 
Hi I saw in the LEGO Mindstorms Web Page that many people made their robots with 2 motors go straight using one rotation sensor on each wheel and stopping the correct motor until both sensors were equal. I got Ultimate Accessory Set as a present (...) (20 years ago, 10-Jun-04, to lugnet.robotics.rcx.nqc)

6 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR