To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 26958
26957  |  26959
Subject: 
Re: TachoSpeed.nqc
Newsgroups: 
lugnet.robotics
Date: 
Tue, 13 Mar 2007 19:06:35 GMT
Viewed: 
9234 times
  
> The main problem with your approach is that the motors do not stall when the
> robot hits an obstacle so it will be hard for you to distinguish between the
> motor speed slowing due to low battery levels, increased load (like going up an
> incline), or pushing a moveable obstacle out of the way.  Why not just use a
> touch sensor attached to a bumper mechanism?


I found again an old code I wrote for Cybermaster to do avoiding based on tacho
slowdown.

The trick is indeed to drive at a low power level, or the wheels simply sleep
and there is not enough slowdown to be reliable.

Philo

--------------------
task main ()
{
  Drive (-5, -5);
  Wait(50);
  Drive (-3, -3);

  while(true)
  {
    if(TachoSpeed(1) < 50 || TachoSpeed(2) < 50)
    {
      Drive (5, 5);
      Wait(50);
      Drive (5, -5);
      Wait(50);
      Drive (-5, -5);
      Wait(50);
      Drive (-3, -3);
    }
  }
}
--------------------------



Message has 1 Reply:
  Re: TachoSpeed.nqc
 
(...) I guess there is a define statement missing that goes something like #define Drive(l,r) SetPower(OUT_L, l); SetPower(OUT_R, r); On(OUT_L+OUT_R) although the Programmer's guide doesn't mention anything about negative values being a possibility (...) (20 years ago, 13-Mar-07, to lugnet.robotics)

Message is in Reply To:
  Re: TachoSpeed.nqc
 
(...) The question you need to answer for yourself is this: Do I want my robot to to potentially execute both if blocks in sequence or do I only want the second if block to execute if the first condition is known to be false? If you only want the (...) (20 years ago, 13-Mar-07, to lugnet.robotics)

13 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
    

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