View unanswered posts | View active topics It is currently Thu Sep 20, 2018 1:01 am






Reply to topic  [ 5 posts ] 
VEX IQ moveMotorTarget doesn"t complete at speeds over70 
Author Message
Rookie

Joined: Sun Oct 11, 2009 11:14 pm
Posts: 34
Post 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);
}
}


Tue Nov 24, 2015 6:49 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Jun 11, 2014 9:59 am
Posts: 115
Post 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


Tue Dec 08, 2015 10:35 am
Profile
Rookie

Joined: Sun Oct 11, 2009 11:14 pm
Posts: 34
Post 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


Tue Dec 08, 2015 8:48 pm
Profile
Rookie

Joined: Sun Oct 11, 2009 11:14 pm
Posts: 34
Post 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.


Tue Dec 08, 2015 9:18 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Jun 11, 2014 9:59 am
Posts: 115
Post 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


Wed Dec 09, 2015 1:43 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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.