To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / *9975 (-20)
Subject: 
Re: Process Control with RCX
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 15 Mar 2017 16:43:06 GMT
Viewed: 
24613 times
  
Having to trouble shoot a Dell Inspiron 1100 not booting up cleanly. An alarm
goes off and it goes to safe boot mode. I am running the original Home version
of XP without updates and RoboLab 2.94. Keeping the 2007 working original
program until new application arm is working. Side arm needs to come in and heat
up surface where oil pastel dot is applied and move aside for the application
wheel to rotate to the color and move down to apply the dot. Thinking it will be
a side arm where the heating box flips down, moves into dot area for allotted
time then out. http://tomlohre.com/lego.htm


Subject: 
Re: Process Control with RCX
Newsgroups: 
lugnet.robotics.rcx
Date: 
Mon, 20 Feb 2017 16:15:09 GMT
Viewed: 
24685 times
  
Here is the twenty foot long process on the main RCX for the printer.
https://www.dropbox.com/s/ejpgar7sg9cw02c/BlockMainRCX.jpg?dl=0
I wanted to use sub routines and loop the process so the program could look
elegant but never got it to work. Here each color has it's own put and return.


Subject: 
Process Control with RCX
Newsgroups: 
lugnet.robotics.rcx
Date: 
Mon, 9 Jan 2017 04:25:54 GMT
Viewed: 
25450 times
  
I am back on the Lego wagon, making another painting machine. Looking forward to
creating the best practices program with your advising.


Subject: 
Re: Faster Firmware/Motor Control
Newsgroups: 
lugnet.robotics.rcx
Date: 
Thu, 19 Jul 2012 01:58:15 GMT
Viewed: 
25506 times
  
In lugnet.robotics.rcx, Iain Hendry wrote:

BrixCC doesn't recognize "wait1Msec", and when I try to download a program with
it, it just gives me an error.

That's kind of what I was getting at with the motor power stuff; I can tell the
RCX can handle more motor powers, but there doesn't appear to be a way to use
them in the program...

D'oh...

I'm posting this because I'm sure I'm not the only one who missed this:  I
didn't realize there's a drop-down when BricxCC starts up, to select "Swan"
instead of "RCX" when making the first handshake with the brick.

After doing that, it compiles no problem.  MotorSetPower128 doesn't seem to
work, though...

At any rate, WaitMS() is great!  Super-precision motor control, here I come!

http://www.youtube.com/watch?v=kZlBlbe2cu0

-Iain


Subject: 
Re: Faster Firmware/Motor Control
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 18 Jul 2012 10:37:47 GMT
Viewed: 
25489 times
  
In lugnet.robotics.rcx, Jetro de Chateau wrote:

I found this site:  http://www.elenafrancesco.org/old/lego/index.html

Thanks for the link!

(snip)

The documentation on this page
http://www.elenafrancesco.org/old/lego/Firmware%20Features.html mentions the
following:

"new wait1Msec opcode to perform program waits using one millisecond resolution"

Maybe that is what you are looking for.

BrixCC doesn't recognize "wait1Msec", and when I try to download a program with
it, it just gives me an error.

That's kind of what I was getting at with the motor power stuff; I can tell the
RCX can handle more motor powers, but there doesn't appear to be a way to use
them in the program...

-Iain


Subject: 
Re: Faster Firmware/Motor Control
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 18 Jul 2012 08:10:48 GMT
Viewed: 
25403 times
  
In lugnet.robotics.rcx, Iain Hendry wrote:

I found this site:  http://www.elenafrancesco.org/old/lego/index.html


Thanks for the link!

After downloading the 100x firmware, I can tell that it is a different firmware
(different clock, tone on button press is different, etc.) - however, it seems
like I just can't unlock this 1/1000 sec. timer issue.  Wait(1); still results
in a 1/100 second delay.

I found some reference to a "WaitMS" command in the NQC programming guide,
however, if I enter "WaitMS(1);" I get a "Error:  Undefined function 'WaitMS'"
whenever I try to compile.  BrixCC recognizes the WaitMS command (it turns blue
when I type it), so it must be valid...

I'm not a programmer.  I just want a 1/1000 wait :)

-Iain

The documentation on this page
http://www.elenafrancesco.org/old/lego/Firmware%20Features.html mentions the
following:

"new wait1Msec opcode to perform program waits using one millisecond resolution"

Maybe that is what you are looking for.


Subject: 
Re: Faster Firmware/Motor Control
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 18 Jul 2012 01:05:21 GMT
Viewed: 
25042 times
  
In lugnet.robotics.rcx, David Koudys wrote:

I have it and use it exclusively.  i'll mail you a copy when i get your e-mail
sddess

Hi Dave,

Thanks - I tried to send you a note, but your email bounced...

I found this site:  http://www.elenafrancesco.org/old/lego/index.html

After downloading the 100x firmware, I can tell that it is a different firmware
(different clock, tone on button press is different, etc.) - however, it seems
like I just can't unlock this 1/1000 sec. timer issue.  Wait(1); still results
in a 1/100 second delay.

I found some reference to a "WaitMS" command in the NQC programming guide,
however, if I enter "WaitMS(1);" I get a "Error:  Undefined function 'WaitMS'"
whenever I try to compile.  BrixCC recognizes the WaitMS command (it turns blue
when I type it), so it must be valid...

I'm not a programmer.  I just want a 1/1000 wait :)

-Iain


Subject: 
Re: Faster Firmware/Motor Control
Newsgroups: 
lugnet.robotics.rcx
Date: 
Tue, 17 Jul 2012 20:28:58 GMT
Viewed: 
24295 times
  
In lugnet.robotics.rcx, Iain Hendry wrote:
Hi all,

One of the common ways I like to control the speed of a gearmotor (in NQC) is by
introducing a loop, for example, like this:

while(true)
{
  OnFwd(motor);
  Wait(a);
  Off(motor);
  Wait(b);
}

I often do this as a motor approaches a setpoint (say an offset from a target
position as measured by a rotation sensor) or the like.  Variable a and b could
be defined somewhere else but usually are around 1/100 or 2/100 of a second.
Any more than that and the motion gets jittery.  I sometimes swap out Off for
Float, depending on the application (unloaded the motors tend to glide right
through the Float, however).

I seem to remember hearing someone (Dick Swan?) built some Firmware a while back
that ran much faster and allowed for 1/1000 second (millisecond) intervals for
the Wait command, instead of 1/100 (decisecond).  Any truth to that?

I have it and use it exclusively.  i'll mail you a copy when i get your e-mail
sddess


Take care,

Dave K


Obviously if I could cut down the time delay, the sawtooth of "On" to "Off" gets
a lot crisper and the whole thing would work a lot better.

Thanks in advance,

-Iain


Subject: 
Faster Firmware/Motor Control
Newsgroups: 
lugnet.robotics.rcx
Date: 
Tue, 17 Jul 2012 16:59:23 GMT
Viewed: 
24023 times
  
Hi all,

One of the common ways I like to control the speed of a gearmotor (in NQC) is by
introducing a loop, for example, like this:

while(true)
{
  OnFwd(motor);
  Wait(a);
  Off(motor);
  Wait(b);
}

I often do this as a motor approaches a setpoint (say an offset from a target
position as measured by a rotation sensor) or the like.  Variable a and b could
be defined somewhere else but usually are around 1/100 or 2/100 of a second.
Any more than that and the motion gets jittery.  I sometimes swap out Off for
Float, depending on the application (unloaded the motors tend to glide right
through the Float, however).

I seem to remember hearing someone (Dick Swan?) built some Firmware a while back
that ran much faster and allowed for 1/1000 second (millisecond) intervals for
the Wait command, instead of 1/100 (decisecond).  Any truth to that?

Obviously if I could cut down the time delay, the sawtooth of "On" to "Off" gets
a lot crisper and the whole thing would work a lot better.

Thanks in advance,

-Iain


Subject: 
Re: BrickOS Patches and Development
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 17 May 2012 21:36:46 GMT
Viewed: 
29320 times
  
Matthew Sheets wrote:
The Bibo Patch Rollup Collection posted to SourceForge at
http://sourceforge.net/tracker/?func=detail&aid=2773502&group_id=58151&atid=486699
has been updated.

Excellent, Matthew. Many thanks for keeping the project alive and moving
forward.

I've uploaded a little patch with the edge counting (which I needed once
upon a time when I tried to build a plotter without any rotation sensors)
re-implemented in a more sensible way. Here:
https://sourceforge.net/tracker/?func=detail&aid=3527703&group_id=58151&atid=486699

I'm currently working on figuring out all the little quirks of the power
functions protocol (such as what happens with the toggle bit state for
commands where the toggle bit is ignored). Once I have it fully working,
I'll release a patch with power functions control based on Bob Kojima's
code but updated to match the latest PF specification.

Cheers,
//Carl


Subject: 
Re: NQC and RCXCC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 1 Feb 2012 02:05:45 GMT
Viewed: 
26995 times
  
In lugnet.robotics.rcx.nqc, Ahui Herrera wrote:
<<snip>>
he,he,he...
I'm going to bring back a 12 year old thread.
I'm using Windows XP and cannot figure out how to set the NQC_OPTIONS=-Trcx2
option.  Any idea?

-Ahui

Hi Ahui,

You can set environment variables on XP by going to Control Panel / System,
click Advanced tab, and click "Environment Variables" near the bottom.

You can add it to either system variables (available to all users) or just for
the user you normally login with.

Add a new variable, name=NQC_OPTIONS, value=-Trcx2.

Hope this helps.

ROSCO

Thanks ROSCO

I did that and it does work when I am using the "command line" of NQC.
When I do either:

nqc -Trcx2 -d counter.nqc
or
nqc -d counter.nqc

However in BricxCC when I hit compile I get an error saying
Undefined function (SetUserDisplay)
???
-Ahui

Never mind I got it now!

It's a 2 step process.

1) Use the instructions you provided to set the "variable" in Windows XP.
!!!RESTART THE COMPUTER!!!! !!!RESTART THE COMPUTER!!!!

2) When you start BrixCC select RCX2 from the drop-down list.
DUH!!!!  =)
The simple things trip me up. ROFL!

Now off to dust the old mindstorm off as I found a non-LEGO use for it.
-AHui


Subject: 
Re: NQC and RCXCC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 1 Feb 2012 01:24:33 GMT
Viewed: 
27016 times
  
<<snip>>
he,he,he...
I'm going to bring back a 12 year old thread.
I'm using Windows XP and cannot figure out how to set the NQC_OPTIONS=-Trcx2
option.  Any idea?

-Ahui

Hi Ahui,

You can set environment variables on XP by going to Control Panel / System,
click Advanced tab, and click "Environment Variables" near the bottom.

You can add it to either system variables (available to all users) or just for
the user you normally login with.

Add a new variable, name=NQC_OPTIONS, value=-Trcx2.

Hope this helps.

ROSCO

Thanks ROSCO

I did that and it does work when I am using the "command line" of NQC.
When I do either:

nqc -Trcx2 -d counter.nqc
or
nqc -d counter.nqc

However in BricxCC when I hit compile I get an error saying
Undefined function (SetUserDisplay)
???
-Ahui


Subject: 
Re: NQC and RCXCC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 1 Feb 2012 01:18:07 GMT
Viewed: 
26976 times
  
In lugnet.robotics.rcx.nqc, Ahui Herrera wrote:
In lugnet.robotics.rcx.nqc, Bernd Frassek wrote:
Using NQC together with RCXCC (by Mark Overmars) is a fine combination that
fulfills my demands for writing software, debugging and testing. Unfortunately,
Mark Overmars, the author of RCXCC will not do any further development for
this product.

Meanwhile, I succeeded in "implementing" all the new features of the latest NQC
version into RCXCC. Here is what I did:

For writing programs, RCXCC functions just as a text editor with the aibility
to high-light and colorize special words. These words are arranged in lists
(keywords, functions, macros, templates) and stored in the Windows registry. I
put in all of the new features (e.g. access control, monitor, setuserdisplay,
etc.). I also added templates for all new NQC commands.

The new NQC file was copied into the RCXCC directory.

An Environment variable was defined (thanks again to Dave Baum who gave me the
hint and did foresee to check environment variables befor NQC is executed).
Since I am using Windows 95 I had to do this within the AUTOEXEC.BAT file (when
using higher versions of Windows or NT you can define this under File
Properties in a "nice" window):

Set NQC_OPTIONS=-Trcx2

The result of all this works perfectly.

If there is anyone who wants to work with the same NQC/RCXCC combination, I can
send the exported RCXCC registry key file via mail. All you will have to do is
to copy this key file file onto your desktop and afterwards double-click on it.
The registry will be updated immediately and you can use RCXCC with the new
features. Sometimes I am "overwhelmed" that things are so easy with Windows and
don't cause any problems ...   ;-)

Bernd

he,he,he...
I'm going to bring back a 12 year old thread.
I'm using Windows XP and cannot figure out how to set the NQC_OPTIONS=-Trcx2
option.  Any idea?

-Ahui

Hi Ahui,

You can set environment variables on XP by going to Control Panel / System,
click Advanced tab, and click "Environment Variables" near the bottom.

You can add it to either system variables (available to all users) or just for
the user you normally login with.

Add a new variable, name=NQC_OPTIONS, value=-Trcx2.

Hope this helps.

ROSCO


Subject: 
Re: SetUserDisplay?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 1 Feb 2012 01:12:12 GMT
Viewed: 
26926 times
  
In lugnet.robotics.rcx.nqc, Ross Crawford wrote:
In lugnet.robotics.rcx.nqc, Dave Baum wrote:
In article <I6DH4L.1zwI@lugnet.com>,
"Ross Crawford" <rosscraw@bigpond.net.au> wrote:

I can't seem to get SetUserDisplay to compile. When I compile my program, it
gets "Error: undefined function 'SetUserDisplay'".

I thought it might be the version of NQC (3.0a1) so I downloaded 2.5r3, but
same
error.

Seems strange because SelectDisplay works fine, but I want to display a
variable.

Any ideas?

ROSCO

My guess is that NQC hasn't been told to target the 2.0 api, so it is
defaulting to 1.0 which does not have SetUserDisplay().  See
http://bricxcc.sourceforge.net/nqc/doc/faq.html#-Trcx2 for a more
detailed explanation.

Thanks Dave. I didn't notice the RCX2 option in Bricxcc, works great now! Just
to clarify, the only difference between RCX 1 & 2 (from the compile target POV)
is the firmware it's running?

ROSCO

????
Still a bit confused on this?
I am running WinXP and not sure where to use the SET command?
Opening up a DOS windows via CMD does show that I have this:

NQC_OPTIONS=-Trcx2
along with a lot of other windows variables but when I go and compile I still
get the error the OP was getting.
=(

-AHui


Subject: 
Re: NQC and RCXCC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 1 Feb 2012 01:01:36 GMT
Viewed: 
27866 times
  
In lugnet.robotics.rcx.nqc, Bernd Frassek wrote:
Using NQC together with RCXCC (by Mark Overmars) is a fine combination that
fulfills my demands for writing software, debugging and testing. Unfortunately,
Mark Overmars, the author of RCXCC will not do any further development for
this product.

Meanwhile, I succeeded in "implementing" all the new features of the latest NQC
version into RCXCC. Here is what I did:

For writing programs, RCXCC functions just as a text editor with the aibility
to high-light and colorize special words. These words are arranged in lists
(keywords, functions, macros, templates) and stored in the Windows registry. I
put in all of the new features (e.g. access control, monitor, setuserdisplay,
etc.). I also added templates for all new NQC commands.

The new NQC file was copied into the RCXCC directory.

An Environment variable was defined (thanks again to Dave Baum who gave me the
hint and did foresee to check environment variables befor NQC is executed).
Since I am using Windows 95 I had to do this within the AUTOEXEC.BAT file (when
using higher versions of Windows or NT you can define this under File
Properties in a "nice" window):

Set NQC_OPTIONS=-Trcx2

The result of all this works perfectly.

If there is anyone who wants to work with the same NQC/RCXCC combination, I can
send the exported RCXCC registry key file via mail. All you will have to do is
to copy this key file file onto your desktop and afterwards double-click on it.
The registry will be updated immediately and you can use RCXCC with the new
features. Sometimes I am "overwhelmed" that things are so easy with Windows and
don't cause any problems ...   ;-)

Bernd

he,he,he...
I'm going to bring back a 12 year old thread.
I'm using Windows XP and cannot figure out how to set the NQC_OPTIONS=-Trcx2
option.  Any idea?

-Ahui


Subject: 
Re: Controlling an Electromagnet (LSM)
Newsgroups: 
lugnet.robotics.rcx
Followup-To: 
lugnet.robotics
Date: 
Sat, 31 Dec 2011 15:04:50 GMT
Viewed: 
25799 times
  
In lugnet.robotics.rcx, Kevin Karplus wrote:

How much power do you want for the electromagnets, and how rapidly do
you need to switch them on and off?
...
If you need faster switching (like for pulse-width modulation), your
best bet is to use power MOS transistors with Schottky protection
diodes.

Or... avoid both stock relays and chip-based switching.

For a linear motor you want to trigger each electromagnet in a series, you
ideally you might like a "push-pull" system, where you aren't just turning a
magnet on and off, but reversing the polarity (this is true for either the track
magnets or the magnets on the "car" under active control, but perhaps easier to
visualize for dynamically switched track magnets). Why not make a "mechanical
multi-relay", where a motor-driven slider slides two electrical bridges over a
series of contacts, each powering a different magnet in a different polarity.
After all, the order the magnets will "fire" in is fixed. The timing is not
(ideally the later magnets in the series should fire faster, as the car is
moving at higher velocity), which can be varied by changing either the speed the
electrical bridges slide along the sequencer, or by spacing out the contacts on
the sequencer itself.

Not only can you see that easily, but it's easy to tune (mechanically), and
perhaps best of all, it can be made completely electrically isolated from the
RCX or NXT (an important point given the inductive loads and currents that might
end up running around).

Railgun-style linear accelerators are far easier... if you have very low
voltage, ludicrously high current power systems. I've always wanted to make a
simple one of those with a rolling armature (instead of one you have to dump
enough current through to vaporize it), just to see it work.

--
Brian Davis


Subject: 
Re: Controlling an Electromagnet (LSM)
Newsgroups: 
lugnet.robotics.rcx
Date: 
Sat, 24 Dec 2011 20:49:51 GMT
Viewed: 
25716 times
  
Iain,

How much power do you want for the electromagnets, and how rapidly do
you need to switch them on and off?  Old-fashioned relays will give
you the least power loss, but can't be switched very quickly.  They
also have a limited life (between 10 and 100 million cycles, depending
on the manufacturer and what failure rate you consider acceptable).
The usual spec is MCBF (mean cycles between failure), and you will
start getting some failures at about 0.2 MCBF.

See
http://www.digikey.com/Web Export/Supplier Content/Coto_306/PDF/Coto_Testing_Reed_Reliability.pdf

You'll also want to make sure your relay contacts are rated formore
than your DC load, as switching inductors results in large spikes.
Schottky protection diodes are often used to provide a return path to
short out the spikes. (See http://www.azatrax.com/relay-contacts.html
for example).

If you need faster switching (like for pulse-width modulation), your
best bet is to use power MOS transistors with Schottky protection
diodes.  If you don't need much current (say 5 amps) but need to be
able to reverse the current through the electromagnets, you can buy
off-the-shelf H-bridge chips.  There are plenty of H-bridge circuits
on the web.


Subject: 
Controlling an Electromagnet (LSM)
Newsgroups: 
lugnet.robotics.rcx
Date: 
Sat, 24 Dec 2011 15:47:57 GMT
Viewed: 
25429 times
  
Hi all,

It's been a while!  A long while ago, while in elementary school, I used LEGO to
build a manually-operated Linear Synchronous Motor (LSM) for a science fair
project.  I want to revisit this as an adult and built a full test track with a
couple of vehicles operating at the same time.

To operate electromagnets from the outputs of the RCX, I don't think I can power
them directly from what I've read.  The current draw is too high.  I think I
need to use either a Relay (within my scope of experience) or a MOSFET (I've
never used one before).

http://www.techno-stuff.com/relay.htm

-Can anyone tell me why in this circuit there is a 22 ohm resistor inline with
the relays?

-Could I make a similar circuit using a MOSFET and have them turn the
electromagnets on and off?

Thanks in advance,

-Iain


Subject: 
Re: BrickOS Patches and Development
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 15 Nov 2011 02:10:38 GMT
Viewed: 
33184 times
  
The Bibo Patch Rollup Collection posted to SourceForge at
http://sourceforge.net/tracker/?func=detail&aid=2773502&group_id=58151&atid=486699
has been updated.

New for this update are patches 43 and 44

43: Per the report from SourceForge user bollinge, Cygwin no longer has a
problem building printf.c.  A Cygwin-specific conditional in
lib/c/Makefile.sub was removed.

44: Kernel size optimization - The values for BASE1 and BASE2 have been
declared as constants; however, calculating these values dynamically enables
greater ease of flexibility in handling changes to the kernel image size.
This is change is based on SourceForge tracker 1120793, but this
implementation is different from what was proposed in that tracker and does
not add a dependency on Perl like that tracker implementation would.  This
particular update closes the last currently outstanding patch (apart from
the "(Unofficial) Bibo Release" patch) listed in SourceForge, though I still
have note of a few various and sundry updates posted elsewhere.


Thanks,
Matthew


Subject: 
Re: MacNQC 4.05b, RCX 1.0 and OS X 10.4.6 can't program the brick
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Thu, 10 Mar 2011 13:37:46 GMT
Viewed: 
33439 times
  
In lugnet.robotics.rcx.nqc, Dennis Clark wrote:
Hello with a query from the past...


Funny I'm tripping over this just today...

   I used MacNQC for ages on other computers but I find now that I can't
write a program out to an RCX 1.0 brick using MacNQC 3.04 or 4.05b.  I
can send the firmware with no problem but when I try to download a
program I get a "communications error" type of message every time.  This

The most weird thing happened to me today on my iMac - I've only dug out the old
Mindstorms stuff last weekend and went through reviving cybermaster and
Spybotics - and guess what, the RCX and IR Tower failed me as well. I have
finally managed to download a simple program again after reloading the firmware
_twice_ to an old 1.0 RCX (it's the 2.0 firmware, though).

Comms seem to work now, but for sake of completeness I have just loaded a second
RCX.

Strikingly, both seemed to require a reload of the firmware first but still want
to be talked to as an RCX rather than RCX 2.

is with either the USB tower or a regular serial tower through a
USB/serial dongle.  I'm using a 1.33GHz G4 running Tiger 10.4.6.  Has
anyone else seen this and know what critical step that I'm missing?

Can't say really - one major problem with MacNQC seems to be that it is still a
Rosetta application - a UB build would be nice to come by but apparently not
much is happening about MacNQC anymore.

I've tried two USB towers and a serial w/ dongle now (it _had_ to work as
Spybotics and cybermaster talk just fine) - before firmware refresh -> no use.
After firmware refresh -> all fine.

I'll have an eye on it, the kids are keeping me busy to program their models
(I'll have to show them the ways anytime soon).

Regards,
Jerry



Next Page:  5 more | 10 more | 20 more

Redisplay Messages:  Brief | Compact

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