Subject:
|
Re: BrickOS Threading...
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 12 Dec 2002 22:29:15 GMT
|
Viewed:
|
2844 times
|
| |
| |
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 code.
Maybe try something like:
MotorRunningValue = ((sys_time >> 1) & 7);
and see if this gets you more predictable behaviour.
Also, I assume you included the following
somewhere:
motor_a_speed(MAX_SPEED);
motor_c_speed(MAX_SPEED);
Other than that, like your subject line says, it could
be a threading issue - quite a bit of that has changed, too.
HTH,
Mark
"Steve Hassenplug" <hassenplug@mail.com> wrote in message
news:20021212193348.18990.qmail@verizonmail.com...
> 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:
Message is in Reply To:
| | BrickOS Threading...
|
| 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 (...) (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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|