View unanswered posts | View active topics It is currently Thu Apr 24, 2014 12:47 pm






Reply to topic  [ 2 posts ] 
Negative Value on the Integrated Motor Encoders 
Author Message
Rookie

Joined: Fri Mar 08, 2013 1:53 pm
Posts: 1
Post Negative Value on the Integrated Motor Encoders
Hello to u all. Im new to RobotC and this forum. I have tried searching for the answer but I haven't found it. The problem that Im having is that after setting up my robot on the Motors and Sensors the left motor counts on the IME is in a negative value. The left motor on my program is reversed. I need them positive on both or a way to program it with absolute value. Thank u for your help.


Attachments:
Seeing the Difference ClawBot IMEs.c [1.74 KiB]
Downloaded 171 times
Fri Mar 08, 2013 2:17 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 537
Post Re: Negative Value on the Integrated Motor Encoders
The reason you are seeing this issue is because the IME's currently ignore the reverse flag- this is the current methodology used by ROBOTC. We may change this in the future, but we will not be able to for the next release because of the widespread impact that may occur with the change. As a workaround, you can use the abs() command to read the absolute value of the encoders to remove any mixed signs with the IME's:

Code:
SensorValue[leftIME] = 0;

while(abs(SensorValue[leftIME]) < 1800)
   {
      motor[leftMotor] = 50;
   }

motor[leftMotor] = 0;

_________________
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 11, 2013 4:26 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.