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

Negative Value on the Integrated Motor Encoders
http://www.robotc.net/forums/viewtopic.php?f=11&t=5594
Page 1 of 1

Author:  Asimov [ Fri Mar 08, 2013 2:17 pm ]
Post subject:  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 517 times

Author:  JohnWatson [ Mon Mar 11, 2013 4:26 pm ]
Post subject:  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;

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