View unanswered posts | View active topics It is currently Thu Aug 06, 2020 3:05 am






Reply to topic  [ 3 posts ] 
setMotorSyncEncoder not turning on the spot 
Author Message
Rookie

Joined: Sat Jan 24, 2015 11:00 pm
Posts: 1
Post 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);

}


Sat Jan 24, 2015 11:10 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Jan 25, 2015 2:20 am
Profile WWW
Rookie

Joined: Mon Apr 06, 2015 4:25 am
Posts: 1
Post 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


Mon Apr 06, 2015 4:33 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.