View unanswered posts | View active topics It is currently Thu Oct 08, 2015 9:38 pm

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

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.

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

Joined: Thu May 24, 2012 12:15 pm
Posts: 713
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:

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 updated help documentation and the ROBOTC Forums.

Mon Mar 11, 2013 4:26 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: DRBandy 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.