To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.org.ca.rtltorontoOpen lugnet.org.ca.rtltoronto in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Organizations / Canada / rtlToronto / 14947
14946  |  14948
Subject: 
Re: RCX and train motors...
Newsgroups: 
lugnet.org.ca.rtltoronto
Date: 
Fri, 14 Oct 2005 16:22:41 GMT
Viewed: 
1250 times
  
In lugnet.org.ca.rtltoronto, Chris Magno wrote:

David Koudys wrote:
I saw the videos of the GBC--that's what inspired
me, btw

   Cool to know.

the train has to go around and back up into the
sidings.  Hard to control on such a small section
of track--it's too fast when it hits the touch
sensor at the ends of the sidings.

   Then you need another bank of sensors, perhaps, to tell you when a train is
coming "near" the siding, for instance. Cruise speed until near a siding, then
slow speed to approach siding, and finally "creeping" speed to position on the
siding.

I was going to go with the light sensors, as I
think the GBC does...

   Actually the GBC trains use NC touch sensors, although you could design NO
touch sensors as well, and those would be easily stackable. Each GBC hopper car
had a 2x2 cylinder mounted below the train baseplate that stuck out 1 stud
beyond the 6-wide limit, enough to hit an arm that tripped the touch sensor.
Visually these were not distracting (most people had to have them pointed out),
and worked well.
   Light sensors would work, but aren't stackable, and are harder to interprete.
Since your application is a raised track, a touch sensor assembly could be
nicely hidden below the track, activated by the wheel bogies (or, perhaps
better, the flat bottom of the train motor bogie) - six wide, and hidden.
   I *like* the idea of an "automated" layout moving materials around, BTW.
Maybe standards could be set up so others could unload what your set-up loads
and "ships" to othe parts of the layout.

If it doesn't work, then it's LDCC IR'ed to an NQC'd RCX

   How "big" is LDCC? I'm *not* a coder, but it seems to me some enterprizing
soul could make a LDCC add-on for BrickOS, for instance, or the Swan firmware.
that way you could have LDCC as an "output format" on an RCX that otherwise is
just running "normal" RCX programs. Fully programmable, autonomous LDCC.

Chris wrote:

have you tried making your own PWM speed setting in NQC?

5  X = ??  Y = ??
10 ? CLR
20 motor A ON
30 wait x
40 motor A OFF
50 wait Y
60 goto 20

Man I wish NQC was that easy.

   It is. But instead of Wait(var), you have to watch a timer. And it turns out,
not only is Wait() too slow, but it's not very accurate for short times. Another
way of doing it (in NQC) is this:

task engineer()
{
   while(true)
   {
      while(power != 0 )
      {
         On(OUT_A);
         if(power==1) Off(OUT_A);
         if(power==2) Off(OUT_A);
         if(power==3) Off(OUT_A);
         <etc.>
      }
      Off(OUT_A);
   }
}

Now just have the main task run the train by changing the value of the global
variable "power". If you need all the power levels to be slightly higher (more
time spent "on"), add some sort of effective "nop" right after the On(OUT_A)
command, but *not* Wait(1) - it sucks for this. Need an overall slightly lower
power? Add "nop"s right after the Off(OUT_A) command.

--
Brian Davis



Message has 2 Replies:
  Re: RCX and train motors...
 
(...) sorry Brian, I stand by my original statement, I WISH "C" was as easy to grok as BASIC. My understanding from Dave, was that he was just looking for a way to slow an unloaded car down. Either way, software exists to "roll your own" PWM. as to (...) (19 years ago, 14-Oct-05, to lugnet.org.ca.rtltoronto)
  Re: RCX and train motors...
 
(...) No need to write it, it already exists! Find it here: (URL) never got around to actually posting this code in a public place as I've just emailed it directly to interested individuals. Anyways, there's a patch to BrickOS, the DCC routines (...) (19 years ago, 19-Oct-05, to lugnet.org.ca.rtltoronto)

Message is in Reply To:
  Re: RCX and train motors...
 
(...) have you tried making your own PWM speed setting in NQC? 5 X = ?? Y = ?? 10 ? CLR 20 motor A ON 30 wait x 40 motor A OFF 50 wait Y 60 goto 20 Man I wish NQC was that easy. either way you get the idea. you can PWM the RCX yourself and control (...) (19 years ago, 14-Oct-05, to lugnet.org.ca.rtltoronto)

15 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
    

Custom Search

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