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 / 1807
1806  |  1808
Subject: 
Re: time sampling under the rcx standard OS
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sat, 17 Sep 2005 13:57:43 GMT
Viewed: 
5749 times
  
On Sat, September 17, 2005 2:59 am, Francois Bardet wrote:
I heard that BrickOS might allow a more reliable time control, but I'd
appreciate a solution to keep me using the standard OS and NQC !

From what I've seen, the standard firmware takes about 3ms per command, and the same
program will run on BrickOS about 100 times faster.  I usually set up my BrickOS
programs so they use the internal timer, and only update the motor setting every 1
ms.

task main()
{
SetSensor(SENSOR_2,SENSOR_ROTATION);
SetPower(OUT_A,1);
while(true)
{
int actif=SENSOR_2;
int passif=10-actif;
OnFwd(OUT_A);
Wait(actif);
Off(OUT_A);
Wait(passif);
SetUserDisplay(actif,0);
}
}

I have to ask what kind of value you're expecting from SENSOR_2.  The sensor will
return a distance, not a velocity, so I don't think this program will do what you
may want.

If you want to install BrickOS, John Hansen has some prepackaged stuff on his
Bricxcc page: http://bricxcc.sourceforge.net/

And, here's a robot that uses PID-type stuff with BrickOS that a lot of people find
interesting: http://www.teamhassenplug.org/robots/legway/

Steve



Message has 1 Reply:
  Re: time sampling under the rcx standard OS
 
(...) Sorry, I didn't explain. This program only aims at checking the loop frequency capability of the rcx firmware, implementing a PWM. The rotation sensor is only used as a potentiometer knob, allowing me to determine by hand the PWM pulse as (...) (19 years ago, 19-Sep-05, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  time sampling under the rcx standard OS
 
Hi list, I'm trying to implement a position regulation (using a motor and a rotation sensor), using for instance a PID (Proportional-Integr...erivative) regulation. I tried to code it in NQC, using the standard OS, but it seems that the RCX loops at (...) (19 years ago, 17-Sep-05, to lugnet.robotics.rcx.nqc)

10 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