View unanswered posts | View active topics It is currently Sat Sep 20, 2014 8:57 pm






Reply to topic  [ 3 posts ] 
motor inaccuracy 
Author Message
Rookie

Joined: Tue Jul 03, 2012 5:16 am
Posts: 43
Post motor inaccuracy
I am experiencing some difficulty getting precision accuracy with the NXT motors. After using nMotorEncoderTarget for around 40 times, the motor error build upt to around 30 degrees inaccuracy. Aftering looking at the motorEncoder values during the program, I realised that they did not reset the motors. But then why does this large error occur?

Is there a better method of moving motors to a certain angle?

Would "while(nMotorEncoder[motorA] < angle){ motor[motorA] = 20; }" work as well?
Code:
void liftUp(){
   nMotorEncoderTarget[motorA]=90;
   motor[motorA]=20;
   while(nMotorRunState[motorA] != runStateIdle){}
   motor[motorA]=0;   
}
void liftDown(){
   nMotorEncoderTarget[motorA]=-90;
   motor[motorA]=-20;
   while(nMotorRunState[motorA] != runStateIdle){}
   motor[motorA]=0;   
}


I used the functions above dozens of times in the program.


Tue Sep 25, 2012 8:27 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: motor inaccuracy
When using sensors in the real world, unless the sensor is an absolute sensor (GPS or compass), you will have cumulative error. It may be due to mechanical slipperage or other factors. That's why we need to build in a calibration process. For example, an inkjet printer (or 3D printer) when printing a large image that takes a long time may need to go back to "home position" once in a while to recalibrate zero position. In your case, it looks like you have some sort of arm. You may want to put a touch sensor at 0 degree. Once in a while, you may want to move the arm back to zero position and clear the encoder value.


Tue Sep 25, 2012 8:50 pm
Profile
Rookie

Joined: Tue Jul 03, 2012 5:16 am
Posts: 43
Post Re: motor inaccuracy
I will do that. Thanks.


Thu Sep 27, 2012 5:07 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.