|
On Tue, December 27, 2005 4:49 pm, Daniel Carvalho wrote:
> A couple of years ago, i used brickOS. Then, i changed to Lejos...
>
> I have a moc where i use the RCX to control a train with a lego train
> motor. It is difficult to control the train with LejOS, because it only
> has 8 output levels. Two solve the problem, i need to implement loops
> that alternate two levels. But the result is not so smooth as i want. It
> is the same thing with NQC and the official lego programming system.
>
> I've heard that BrickOS is different, because it doesn't use the
> standard lego routines for output control. Do you thing i can get more
> precise control of the train, with BrickOS?
>
> thanks
>
> daniel
Daniel,
One problem you'll run into with most software is that it switches between power and
float to adjust the motor levels. It works much better to switch between power and
brake.
Using most software, the train will continue to speed up, even with the power set
low. (I've done this before, and it doesn't work well)
I used a scheme for my Legway robot, and it seemed to work very well. It stitches
the power level ever 1ms, and has 8 forward "settings", and 8 backward settings.
It's very simple, and works very well. Just set the variable MotorA, B or C to the
speed you want the motor to go (a number between 0 and 16).
Does this make sense?
---
int MotorSpeedArray[4] = {1,3,2,0};
// motor speed 0-7 = forward, 0 = fast, 7 = slow
// motor speed 8 = stop
// motor speed 9-16 = reverse, 9 = slow, 16 = full reverse
int MotorRunningValue;
[main loop]
{
...
MotorRunningValue = ((sys_time) & 7);
motor_a_dir(MotorA + MotorRunningValue) >> 3]);
motor_b_dir(MotorB + MotorRunningValue) >> 3]);
motor_c_dir(MotorC + MotorRunningValue) >> 3]);
}
---
Steve
|
|
Message has 1 Reply: | | Re: train precision
|
| (...) hi Steve, I think the problem is not exactly the same. The lego technic motors run always at the same speed so you need to use that kind of schema for speed control in robots. The train motors are different, they have a speed proportional to (...) (19 years ago, 29-Dec-05, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | train precision
|
| A couple of years ago, i used brickOS. Then, i changed to Lejos... I have a moc where i use the RCX to control a train with a lego train motor. It is difficult to control the train with LejOS, because it only has 8 output levels. Two solve the (...) (19 years ago, 27-Dec-05, to lugnet.robotics.rcx.legos)
|
8 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
|
|
|
|