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

setMotorSyncEncoder not turning on the spot
http://robotc.net/forums/viewtopic.php?f=1&t=10351
Page 1 of 1

Author:  bklynch [ Sat Jan 24, 2015 11:10 pm ]
Post subject:  setMotorSyncEncoder not turning on the spot

I'm trying to use setMotorSyncEncoder to make the EV3 robot drive forward or turn on the spot 90 degrees left or right. Driving straight forward works correctly with a turn ratio of 0, however, turning on the spot does not. The web help states that a turn ratio of 100 will command the first motor to turn with positive power and the second motor to turn with negative power. Instead, the first wheel turns while the second wheel remains stationary -- this is what should be expected for a turn ratio of 50. I see the same thing in the opposite direction with a turn ratio of -100.

I have loaded the Linux kernel and updated the firmware as far as I can tell (it says V1.06X on the brick info page), and I am coding in RobotC 4.27. Here is the code:

#pragma config(Sensor, S1, , sensorEV3_Color, modeEV3Color_Color)
#pragma config(Motor, motorA, leftMotor, tmotorEV3_Large, PIDControl, driveLeft, encoder)
#pragma config(Motor, motorB, rightMotor, tmotorEV3_Large, PIDControl, driveRight, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//


// main program
task main()
{

float b = 118.5; // wheel base (mm)
float d = 43.2; // wheel diameter (mm)
float thetaTurn = 90; // robot turn angle
int turnTicks; // wheel encoder ticks during turn
turnTicks = (b/d)*thetaTurn;

// command motors using setMotorSyncEncoder with 100 turn ratio (left turn on the spot) and speed 30
setMotorSyncEncoder(leftMotor,rightMotor,100,turnTicks,30);
waitUntilMotorStop(leftMotor);

}

Author:  mightor [ Sun Jan 25, 2015 2:20 am ]
Post subject:  Re: setMotorSyncEncoder not turning on the spot

This was a bug fixed in 4.28
Quote:
EV3 – Fixed user reported bug in Synchronized Motor Movements commands.

Please update to 4.28, which you can download here: http://www.robotc.net/blog/2014/12/23/r ... 4-28-beta/

= Xander

Author:  heilo [ Mon Apr 06, 2015 4:33 am ]
Post subject:  Re: setMotorSyncEncoder not turning on the spot

Am I wrong?
1 . Robot should turn right
setMotorSyncEncoder(motorB, motorC, 50, 202, 40);
wait(5);

2 . Robot should turn left
setMotorSyncEncoder(motorC, motorB, 50, 202, 40);
wait(5);

Issue is that it turns right also with the second command. I am using EV3, ROBOTC 4.30, win 8.1
Motors are: C- right, B - left

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