To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3027
3026  |  3028
Subject: 
BrickOS Threading...
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 12 Dec 2002 19:33:43 GMT
Viewed: 
2711 times
  
I'm having a problem, and I hope someone can help me.  I've been running winLegOS,
and I've switched to the latest version of BrickOS.

I created a way to control the motors, which will reliably speed them up, and slow them down by using different power settings.  This code works fine with LegOS, but not with the newest BrickOS.

Here's part of the code.  I just need to set the variables MotorA and MotorC.

// motor speed 0-7 = forward, 0 = fast, 7 = slow
// motor speed 8 = stop
// motor speed 9-16 = reverse, 9 = slow, 16 = full
// 24 = float

int MotorSpeedArray[32] = {1,1,1,1,1,1,1,1,
3,3,3,3,3,3,3,3,
2,2,2,2,2,2,2,2,
0,0,0,0,0,0,0,0};

...
MotorRunningValue = (sys_time & 7);
motor_a_dir(MotorSpeedArray[MotorA + MotorRunningValue]);
motor_c_dir(MotorSpeedArray[MotorC + MotorRunningValue]);
...

With LegOS, if 'MotorA' is set to 3 or 4, the motor will run very smoothly, at less than full speed, but with BrickOS, the same setting will cause it to jump.  It's very jerkey.  I'm only running one thread, and this is in my main loop.

Can anyone offer suggestions on why this works fine with LegOS, but not the latest BrickOS?  Is there something I can turn off in BrickOS or the BrickOS kernal that could be taking up time slices?

Thanks
Steve
--
_______________________________________________
Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free!
http://www.net2phone.com/cgi-bin/link.cgi?143



Message has 1 Reply:
  Re: BrickOS Threading...
 
The motor handler is only called once ever 2ms in the latest version of BrickOS (as opposed to every 1ms in earlier versions). This is a fairly recent change and it could be causing a "granularity" type problem with certain speed settings in your (...) (22 years ago, 12-Dec-02, to lugnet.robotics.rcx.legos)

7 Messages in This Thread:

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

Custom Search

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