Syncing the NXT motors
Syncing the NXT motors
Hello everyone,
I help coach an FLL team and we're having problems with our motors. Some of them are faster/slower than others. I know that this is bound to happen, but I thought there was a way to re-sync them to each other. They're using NXT-G, so I can't use the OnFwdSync() from NXC.
Is there a way to re-sync two motors to each other?
jojoguy10
I help coach an FLL team and we're having problems with our motors. Some of them are faster/slower than others. I know that this is bound to happen, but I thought there was a way to re-sync them to each other. They're using NXT-G, so I can't use the OnFwdSync() from NXC.
Is there a way to re-sync two motors to each other?
jojoguy10
-
- Posts: 94
- Joined: 01 Apr 2011, 22:46
- Contact:
Re: Syncing the NXT motors
have you tried using move instead of motor blocks?
Themindstormman3141
Website admin of themindstormman3141.com
NXT FOR ALL
Website admin of themindstormman3141.com
NXT FOR ALL
Re: Syncing the NXT motors
One King to rule them all, One King to find them,
One King to bring them all and in the darkness bind them
On Earth where Shadows lie.
One King to bring them all and in the darkness bind them
On Earth where Shadows lie.
Re: Syncing the NXT motors
Thanks! This looks like a good idea!nxtreme wrote:http://www.techbrick.com/Lego/TechBrick ... /index.htm
Why would that work better?themindstormman wrote:have you tried using move instead of motor blocks?
jojoguy10
-
- Posts: 94
- Joined: 01 Apr 2011, 22:46
- Contact:
Re: Syncing the NXT motors
they automatically sink the 2 motors
Themindstormman3141
Website admin of themindstormman3141.com
NXT FOR ALL
Website admin of themindstormman3141.com
NXT FOR ALL
Re: Syncing the NXT motors
I don't think that the OP wants to turn his robot into the Titanic...themindstormman wrote:they automatically sink the 2 motors
Yes, the Move Block will handle all the syncing for you; you just need to set the direction/ratios of the two motors.
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: Syncing the NXT motors
OK, so maybe it's just misaligned tires or something. Thanks for all the quick replies!
jojoguy10
jojoguy10
Re: Syncing the NXT motors
It might be a good learning exercise to make a myblock to sync the motors. I know the myblock I have made with my FLL team to sync motors works better than the move bock. It also taught my FLL team a lot about how motor control really works.
Blog: 08milluz.wordpress.com
LMS Shuttle: facebook.com/lmsshuttle
LMS Shuttle: facebook.com/lmsshuttle
Re: Syncing the NXT motors
Do you think you can give me an overview of how you did that? Or is it like confidentialmilluzaj wrote:It might be a good learning exercise to make a myblock to sync the motors. I know the myblock I have made with my FLL team to sync motors works better than the move bock. It also taught my FLL team a lot about how motor control really works.
jojoguy10
Re: Syncing the NXT motors
Pseudo code:
You'll need to use data wires, and the motorBstart and motorCstart variables are necessary. The others can be done without variables, although if it were me, I'd make it easier on myself and use variables.
For Rotation_Count_of_B and Rotation_Count_of_C, use the degrees data wire output of the Motor Rotation Count/"Sensor" blocks.
Code: Select all
VARIABLES:
// Start values
Number motorBstart
Number motorCstart
// The distance you want the motors to travel in degrees
Number distB = 360
Number distC = 720
// The distance in degrees remaining to go for each motor
Number distLeftB
Number distLeftC
// Power (%) for each motor
Number powerB
Number powerC
Number BASE_POWER = 50
Code: Select all
PROGRAM:
motorBstart = Rotation_Count (or whatever) of Motor B
motorCstart = Rotation_Count (or whatever) of Motor C
LOOP BEGIN
distLeftB = distB - (Rotation_Count_of_B - motorBstart)
distLeftC = distC - (Rotation_Count_of_C - motorCstart)
// This part can vary with what you want exactly
// It can be as complicated as you can make it, and it'll never really be "perfect", IMHO
powerB = (100 * distLeftC / distC) - (100 * distLeftB / distB) + BASE_POWER
powerC = (100 * distLeftB / distB) - (100 * distLeftC / distC) + BASE_POWER
// NOTICE: Asking to move the motor differently while it's still moving will overwrite the previous commands;
// It'll stop listening to those, and re-correct its power/degrees to go forward by
Move Motor B Forward by distLeftB with the Power of powerB
Move Motor C Forward by distLeftC with the Power of powerC
LOOP END
For Rotation_Count_of_B and Rotation_Count_of_C, use the degrees data wire output of the Motor Rotation Count/"Sensor" blocks.
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Who is online
Users browsing this forum: No registered users and 12 guests