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

VEX IQ moveMotorTarget doesn"t complete at speeds over70
http://www.robotc.net/forums/viewtopic.php?f=55&t=12597
Page 1 of 1

Author:  rwood359 [ Tue Nov 24, 2015 6:49 pm ]
Post subject:  VEX IQ moveMotorTarget doesn"t complete at speeds over70

The simple program below will not complete with speeds of over about 70.
Only the one motor is defined. All other motors and sensors have been deleted.
setServoTarget has the same problem.
The debugstream shows values in the 42x to 44x range.
A real motor does not exhibit the problem.
Is this the expected performance?

#pragma config(Motor, motor10, armMotor, tmotorVexIQ, openLoop, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
moveMotorTarget(armMotor, 450, 100);
sleep(100);
while (getMotorZeroPosition(armMotor)==false)
{
writeDebugStreamLine("%d", getMotorEncoder(armMotor));
sleep (100);
}
}

Author:  lcarrozza [ Tue Dec 08, 2015 10:35 am ]
Post subject:  Re: VEX IQ moveMotorTarget doesn"t complete at speeds over70

rwood359,

Correct me if I am wrong, you are saying that on a real robot you will get the debug value of ~450, however, when you convert this to virtual, you will get a debug value ~420 - ~430. This should be expected with your code. The command moveMotorTarget() is working the same for both. The reason you are getting different values is because your loop is based on time. There are not a lot of differences between physical and virtual, but some little things like friction and other outside forces could cause a difference in the time for a motor to reach its target. The physical motor may increment a little slower (fractions of a second) than the virtual. Try using my modified version of your code. You will be able to see that it is actually reaching your target. You can also see this on the motors with PID debug screen.


#pragma config(Motor, motor10, armMotor, tmotorVexIQ, openLoop, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
moveMotorTarget(armMotor, 450, 100);
sleep(100);
while (getMotorZeroPosition(armMotor)==false)
{
writeDebugStreamLine("%d", getMotorEncoder(armMotor));
sleep (100);
}
sleep(1000);
writeDebugStreamLine("Final Target: %d", getMotorEncoder(armMotor));
sleep(1000);
}

If I am not understanding your concern, please let me know the following.
-What Version of ROBOTC are you using?
-Which Robot Virtual World are you using?
-What version of the world are you using?
-What robot are you using?
-What exactly is your robot doing when you run your code?



Thanks, Lee

Author:  rwood359 [ Tue Dec 08, 2015 8:48 pm ]
Post subject:  Re: VEX IQ moveMotorTarget doesn"t complete at speeds over70

Hi Lee,
I'm using
RobotC 4.50
VW VEXIQ Bank Shot 1.0.2
VW Challenge Pack for VEXIQ 1.5.0
VEX Launchbot IQ
The arm moves up then the code hangs waiting getMotorZeroPosition to go TRUE. The motor never reached the target.

My programmer was trying to use the getMotorZeroPosition and/or getMotorZeroVelocity functions to determine when a moveMotorTarget operation completes.
The program would hang with the move never completing when he increased the speed. We reduced the motors/sensors and program to the minimum operations.
When we run the posted code, the getMotorZeroPosition loop never completes. The debug stream and motor with PID screen show the power locked at 100 and the encoder position running in the 420 to 440 range for the entire 60 second run. If we reduce the speed to 65, the program will complete normally.

We just noticed that if the speed in set to 127 the robot will rotate about 15 degrees clockwise (as view from the top) during the 60 seconds. No drive motors are defined. Is there some movement caused by vibrations of the arm motor?
Thanks for the response, Randy

Author:  rwood359 [ Tue Dec 08, 2015 9:18 pm ]
Post subject:  Re: VEX IQ moveMotorTarget doesn"t complete at speeds over70

Just noticed a difference between VW and physical.
In the physical world, the moveMotorTarget limits the speed shown in the Motor with PIDs window to 100.
In the VW, the speed variable is a signed byte that wraps around from 127 to -128 being output in the Motor with PIDs window when the input goes from 127 to 128.

Author:  lcarrozza [ Wed Dec 09, 2015 1:43 pm ]
Post subject:  Re: VEX IQ moveMotorTarget doesn"t complete at speeds over70

Thank you for getting back to me with more information. I now can see what you are experiencing. The Launchbot IQ is not behaving correctly. If you use the other clawbot, you will be able to see that the issue does not lie in your code, but rather in the robot itself. Our team will look into fixing this bug for our next release.

Thank you again for your time and feedback.

Lee

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