ROBOTC.net forums
http://robotc.net/forums/

TETRIX Encoders
http://robotc.net/forums/viewtopic.php?f=1&t=12874
Page 1 of 1

Author:  techlane [ Thu Dec 17, 2015 11:19 am ]
Post subject:  TETRIX Encoders

Is it necessary to have encoders on both motors when using the TETRIX motors if you want to travel distance? I thought I could use one, but the code doesn't want to cooperate.

Thanks,

Author:  JohnWatson [ Mon Dec 21, 2015 11:11 am ]
Post subject:  Re: TETRIX Encoders

You can get away with using one encoder on the robot (and only track that encoder's movement), but there might be a bit of discrepancy between the right and left motors' movements (as only one side of the motors will be tracked at any given time). Would you be able to post your code using the [code] tags so that we may debug the issue further for you?

Author:  techlane [ Tue Jan 05, 2016 11:59 am ]
Post subject:  Re: TETRIX Encoders

Even if I am just asking it to move forward the encoder motor runs a great deal slower than the non encoder motor.

[#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorTetrix, PIDControl, encoder)
#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()
{
motor[motorD]= 10;
motor[motorE]= 10;
wait1Msec(5000);
}]

Author:  JohnWatson [ Wed Jan 06, 2016 8:57 am ]
Post subject:  Re: TETRIX Encoders

Quote:
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorTetrix, PIDControl, encoder)


My guess is that the PID control on the motor with the encoder is causing it to go the correct speed (slower) than the 'raw' speed value given to the motor without an encoder. Try turning off PID control to see if this is the case.

Author:  techlane [ Wed Jan 13, 2016 7:03 am ]
Post subject:  Re: TETRIX Encoders

Yes this worked. The only problem is that I can't sync the motors since I only have on encoder. Due to the cost, I could only get one per robot. I will have to figure out a way to get my hands on 10 more encoders.

Author:  techlane [ Wed Jan 13, 2016 7:03 am ]
Post subject:  Re: TETRIX Encoders

Thank you John!

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/