View unanswered posts | View active topics It is currently Tue Sep 02, 2014 5:25 pm






Reply to topic  [ 5 posts ] 
how to synch motors 
Author Message
Novice
User avatar

Joined: Mon Oct 22, 2012 2:14 pm
Posts: 51
Post how to synch motors
we are having trouble getting our motorsynch thing to work, please help
Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  motorA,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  motorB,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  motorC,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorTetrix, PIDControl, reversed)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorTetrix, PIDControl)
#pragma config(Servo,  srvo_S1_C2_1,    servo1,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_2,    servo2,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_3,    servo3,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_6,    servo6,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{

nSyncedMotors = synchDE;
nSyncedTurnRatio = -100;

motor[motorD] = 50
   wait1Msec(4000);
}


Wed Oct 24, 2012 1:39 pm
Profile
Novice

Joined: Sun Oct 21, 2012 10:01 pm
Posts: 76
Post Re: how to synch motors
The "synch" thing only works for Lego NXT motors. That's why the available ones are synchAB, synchBC, etc. For Tetrix motors, you'll have to write the code manually (telling one motor to target the encoder value of the other).

Also, you don't have a semicolon at the end of line 22 ("motor[motorD] = 50"), so that's giving a compiler error.

Hope that helped!


Wed Oct 24, 2012 5:02 pm
Profile
Novice
User avatar

Joined: Mon Oct 22, 2012 2:14 pm
Posts: 51
Post Re: how to synch motors
okay, then also i heard something about having to have somekind of part that attatches to the wheels and that itself is the encoder....?


Mon Nov 05, 2012 4:40 pm
Profile
Novice

Joined: Sun Oct 21, 2012 10:01 pm
Posts: 76
Post Re: how to synch motors
That's correct, there's an optical encoder that you can buy from Tetrix. It returns a value that indicates the rotation of the motor. You can write a fairly simple PID procedure that powers one motor to match the encoder readings of the other.


Wed Nov 07, 2012 4:50 am
Profile
Expert
User avatar

Joined: Fri Nov 02, 2012 12:07 am
Posts: 164
Location: California, USA
Post Re: how to synch motors
Keep up the good Questions!

_________________
string Robored = "Awesome"
~~Neil Balch~~


Fri Nov 16, 2012 11:50 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.