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 / 1695
1694  |  1696
Subject: 
Re: bad motor output because of bad lego firmware?!
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Thu, 28 Oct 2004 17:36:15 GMT
Viewed: 
10224 times
  
In lugnet.robotics.rcx.nqc, Gunther Lemm wrote:
> Hi there,
> 
> I've spent the last two days trying to write a function in NQC that transfers
> data to the Lepomux I/O-extender. The data transfer is normally done by
> connecting the Lepomux to one of the motor ports. Each transition from one motor
> state to another indicates the start of a new bit on the lepomux side. This
> includes transitions from forward to backward or vice versa.
> When I do something like this
> 
> On(OUT_B);
> SetPower(OUT_B, OUT_FULL);
> while (1)
>  {
>  SetDirection(OUT_B, OUT_TOGGLE);
>  }
> 
> nothing happens at all.
> 
> Something like this toggles between forward and backward:
> 
> On(OUT_B);
> SetPower(OUT_B, OUT_FULL);
> while (1)
>  {
>  SetOutput(OUT_B, OUT_ON);
>  SetDirection(OUT_B, OUT_FWD);
>  SetOutput(OUT_B, OUT_ON);
>  SetDirection(OUT_B, OUT_REV);
>  }
> 
> But the output waveform looks like this:
> 
> FWD   ____                ____
>           |              |    |
> OFF       |____      ____|    |____
>                |    |
> REV            |____|
> 
> There is a gap of at least 3ms between the fwd->off and the off->rev edge. This
> makes it impossible for the Lepomux to recognize it as one edge.
> The reason for this behaviour seems to be that the bytecode interpreter (or even
> the ROM routines) don't directly access the motor output register in the RCX
> (two bit per motor for off,fwd,rev,brk).

The firmware (at least version 0328) intentionally prevents you going directly
from forward to reverse (or vice versa).  I guess the designers felt this would
be too rough on the motors.  Try inserting a Wait(50) in your first loop.  It'll
work then, but there is a dead time between the forward and reverse states.

> Does anyone know a workaround or do I really have to patch the Lego firmware
> image?

I'm guessing a patch will be necessary.

Mark



Message is in Reply To:
  bad motor output because of bad lego firmware?!
 
Hi there, I've spent the last two days trying to write a function in NQC that transfers data to the Lepomux I/O-extender. The data transfer is normally done by connecting the Lepomux to one of the motor ports. Each transition from one motor state to (...) (22 years ago, 28-Oct-04, to lugnet.robotics.rcx.nqc)

4 Messages in This Thread:


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

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