Vous êtes sur la page 1sur 6

Hi tfriez,

The following program can reproduce the problem. We tried substituting


setServoTarget with setMotorTarget and the issue persisted. In addition, the
motors seemed to move slower when setMotorTarget was used, even if
speed was set at 100. I tested the following program on 4 different pairs of
brains, controllers, and motors. It was easier to reproduce the problem on
this year's hardware. The issue is more likely to occur when the robot
battery is low. Motor temperature didn't seem to be a factor, what I noticed
before was probably a low or cold battery.

Thanks

Jerry

/////////////////////////////////////////////////////////////////////////////////////////////

Hola tfriez,

El siguiente programa puede reproducir el problema. Tratamos


setServoTarget sustituyendo con setMotorTarget y el problema persista.
Adems, los motores parecan moverse ms lento cuando se utiliz
setMotorTarget, incluso si la velocidad se fij en 100. He probado el
siguiente programa de 4 pares diferentes de cerebros, controladores, y
motores. Era ms fcil para reproducir el problema en el hardware de este
ao. El asunto es ms probable que ocurra cuando la batera robot es baja.
La temperatura del motor no parece ser un factor, lo que not antes era
probablemente una batera baja o fra.

gracias

Jerry
#pragmaconfig(Motor,motor4,rightLiftMotor,tmotorVexIQ,
PIDControl,reversed,encoder)

#pragmaconfig(Motor,motor10,leftLiftMotor,tmotorVexIQ,
PIDControl,encoder)

#pragmaconfig(Motor,motor11,clawMotor,tmotorVexIQ,
PIDControl,encoder)

//*!!Codeautomaticallygeneratedby'ROBOTC'configurationwizard
!!*//

floatfSetClawPos=0;

floatfSetArmPos=0;

taskmain()

while(1)

if(getJoystickValue(BtnRDown))

fSetClawPos=0;//CloseClaw

if(getJoystickValue(BtnRUp))

fSetClawPos=450;//Open

if(getJoystickValue(BtnLDown))

fSetArmPos=0;//LowerClaw

if(getJoystickValue(BtnLUp))

fSetArmPos=250;//RaiseClaw

setServoTarget(clawMotor,fSetClawPos);

setServoTarget(leftLiftMotor,fSetArmPos);

setServoTarget(rightLiftMotor,fSetArmPos);

//displayTextLine(0,"Drvs=%dl=%dr=%d",0,
getServoEncoder(leftDriveMotor),getServoEncoder(rightDriveMotor));
displayTextLine(1,"Clws=%da=%d",fSetClawPos,
getServoEncoder(clawMotor));

displayTextLine(2,"RLfts=%dr=%d",fSetArmPos,
getServoEncoder(rightLiftMotor));

displayTextLine(3,"LLfts=%dl=%d",fSetArmPos,
getServoEncoder(leftLiftMotor));

//Waitthetiminginterval

wait1Msec(25);

}
Hey Jerry,

Yeah - I'm pretty stumped to why the motors would be cutting out. Luckily,
there's some status variables we can monitor with the motors using
ROBOTC. I've thrown together a test program that runs as a separate task
(so it won't interfere with your main code) and will output data to the global
variables debugger window.

Just add your program to "task main" and keep the "startTask" command at
the top. Then, while your program is running - keep an eye on the Global
Debugger window and see if any of the variables (Specifically current limit /
motor temp) switch to reporting as "true".

Code:

Hey Jerry,

S - Estoy bastante perplejo por qu los motores estaran recortando.


Afortunadamente, hay algunas variables de estado podemos controlar con
los motores que utilizan ROBOTC. He tirado juntos un programa de prueba
que se ejecuta como una tarea independiente (por lo que no va a interferir
con su cdigo principal) y entrega la informacin a la ventana de variables
globales depurador.

Slo tiene que aadir su programa "principal tarea" y mantener el orden


"startTask" en la parte superior. Entonces, mientras el programa est en
marcha - mantener un ojo en la ventana Global depurador y ver si alguna de
las variables (Especficamente actual lmite / de temperatura del motor)
cambie a la presentacin de informes como "verdadero".

Cdigo:
boolbMotorCurrentLimit[12];

boolbMotorTemp[12];

boolbMotorZeroPosition[12];

boolbMotorZeroVelocity[12];

taskmonitorMotors()

TVexIQDeviceTypesnDeviceType;

TDeviceStatusnDeviceStatus;

shortnDeviceVersion=0;

while(true)

for(tMotortheMotor=motor1;theMotor<=motor12;theMotor++)

getVexIqDeviceInfo(theMotor,nDeviceType,nDeviceStatus,
nDeviceVersion);

if(nDeviceType!=vexIQ_SensorMOTOR)

continue;

bMotorCurrentLimit[theMotor]=getMotorCurrentLimitFlag(theMotor);

bMotorTemp[theMotor]=getMotorOverTemp(theMotor);

bMotorZeroPosition[theMotor]=getMotorZeroPosition(theMotor);

bMotorZeroVelocity[theMotor]=getMotorZeroVelocity(theMotor);

sleep(5);

}
taskmain()

startTask(monitorMotors);

//Addyourcodehere.

Vous aimerez peut-être aussi