View unanswered posts | View active topics It is currently Sat Apr 19, 2014 1:52 am






Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3
nMotorEncoderTarget[] not working.. 
Author Message
Rookie

Joined: Fri Oct 21, 2011 11:14 pm
Posts: 9
Post Re: nMotorEncoderTarget[] not working..
I am still experiencing the same problems outlined above and I am on the updated RobotC 3.54 version.

I am using the nMotorEncoderTarget[] function with the while loop, but the robot just keeps going forward indefinitely( I used the debug stream also and I see that my encoder values are reading, and they keep going on past the targeted value).

Is anyone else having these problems/know the fix?


Sun Mar 17, 2013 12:44 pm
Profile
Rookie

Joined: Tue Nov 20, 2012 8:09 pm
Posts: 35
Post Re: nMotorEncoderTarget[] not working..
Same issue on RobotC 3.55.2 beta. (I know there's a new beta, we'll be updating soon)


Tue Mar 19, 2013 4:42 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 534
Post Re: nMotorEncoderTarget[] not working..
hongyeus wrote:
I am still experiencing the same problems outlined above and I am on the updated RobotC 3.54 version.

I am using the nMotorEncoderTarget[] function with the while loop, but the robot just keeps going forward indefinitely( I used the debug stream also and I see that my encoder values are reading, and they keep going on past the targeted value).

Is anyone else having these problems/know the fix?



SergeantFTC wrote:
Same issue on RobotC 3.55.2 beta. (I know there's a new beta, we'll be updating soon)


Would you be willing to post the simplest form of code that can replicate the problem (meaning, not a full competition program, just a program that can replicate the issue) using the [code] tags? This way we will be able to see if it is a coding issue or a different underlying issue.

Thank you in advance!

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon Mar 25, 2013 4:09 pm
Profile
Rookie

Joined: Tue Nov 20, 2012 8:09 pm
Posts: 35
Post Re: nMotorEncoderTarget[] not working..
We had PID disabled. Enabling it fixed the problem. I think. We've since moved on to a different solution not using nMotorEncoderTarget. Is it supposed to require PID?


Mon Mar 25, 2013 6:08 pm
Profile
Rookie

Joined: Sun Jan 19, 2014 9:40 pm
Posts: 1
Location: Ypsilanti, Michigan
Post Re: nMotorEncoderTarget[] not working..
The nMotorEncoderTarget[] command still does not work in version 3.62 for Matrix motors.
If we run it, the motor doesn't move. While it is running and you manually move the motor, it will fight you and return to its previous position when you let go. If we stop the program in the debugger and manually move the motor, and then restart the program, the motor will return to its previous position.
Code:
#pragma config(Hubs,  S1, MatrxRbtcs, none,     none,     none)
#pragma config(Hubs,  S2, MatrxRbtcs, none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Sensor, S2,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_Matrix_S1_1, motorD,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_2, motorE,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_3, motorF,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S1_4, motorG,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S2_1, motorH,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S2_2, motorI,        tmotorMatrix, openLoop)
#pragma config(Motor,  mtr_Matrix_S2_3, EncoderTestMotor, tmotorMatrix, PIDControl, encoder)
#pragma config(Motor,  mtr_Matrix_S2_4, motorK,        tmotorMatrix, openLoop)
#pragma config(Servo,  srvo_Matrix_S1_1, servo1,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_2, servo2,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_3, servo3,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S1_4, servo4,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S2_1, servo5,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S2_2, servo6,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S2_3, servo7,               tServoNone)
#pragma config(Servo,  srvo_Matrix_S2_4, servo8,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "joystickDriver.c"

task main()
{
nMotorEncoder[EncoderTestMotor] = 0;
nMotorEncoderTarget[EncoderTestMotor] = 720;
motor[EncoderTestMotor] = 75;
while(nMotorRunState[EncoderTestMotor] != runStateIdle)  // while Motor B is still running:
{
     //do not continue sequential execution
}
motor[EncoderTestMotor] = 0;
}


Sun Jan 19, 2014 9:50 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 35 posts ]  Go to page Previous  1, 2, 3

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.