View unanswered posts | View active topics It is currently Mon Sep 22, 2014 6:47 pm






Reply to topic  [ 5 posts ] 
Use Tetrix Encoders to Hold Positions? 
Author Message
Rookie

Joined: Thu Feb 27, 2014 4:40 pm
Posts: 1
Post Use Tetrix Encoders to Hold Positions?
Hello. I recently installed some encoders on our robot's arm in the hopes that I could press a button to allow the arm to go to a certain position regardless of the previous position the arm was at, essentially the same thing one would do with a servo. However, when I tried using Encoder Target Distances, it simply went in one direction for however many rotations instead of rotating back to the same position. Does anyone know of a way that I could accomplish this so the Tetrix motor acts like a servo and returns to a previously set position? Any help is greatly appreciated. Thanks.

JIT


Thu Feb 27, 2014 4:42 pm
Profile
Rookie

Joined: Thu Feb 27, 2014 1:47 pm
Posts: 2
Post Re: Use Tetrix Encoders to Hold Positions?
Hello,

I'm very new to this, but seems like an interesting problem.

I'm thinking you would need some type of equation to calculate how far your current encoder value is from your target. You would need to do something like


1) Send in where you want the arm to go as a variable

2) Know what the current position of the encoder is.

3) Find the difference between these two values

4) move that far.


The biggest problem I see is having a zero position from your motor. You would need to manually position the motor before starting the program to the same place every time, then make sure you initialize your encoders to 0 at the start of your program.


Fri Feb 28, 2014 12:41 pm
Profile
Rookie

Joined: Tue Nov 20, 2012 8:09 pm
Posts: 35
Post Re: Use Tetrix Encoders to Hold Positions?
See this thread for a couple of solutions: http://www.robotc.net/forums/viewtopic.php?f=52&t=5399


Wed Mar 05, 2014 5:06 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Use Tetrix Encoders to Hold Positions?
etlane wrote:
Hello,

I'm very new to this, but seems like an interesting problem.

I'm thinking you would need some type of equation to calculate how far your current encoder value is from your target. You would need to do something like


1) Send in where you want the arm to go as a variable

2) Know what the current position of the encoder is.

3) Find the difference between these two values

4) move that far.


The biggest problem I see is having a zero position from your motor. You would need to manually position the motor before starting the program to the same place every time, then make sure you initialize your encoders to 0 at the start of your program.

Our robotics library has a PID motor module that does that. The PID motor module supports a Tetrix motor with encoder. It provides a function call SetTarget that allow you to specify what position you want the motor to move to. The function has a lot of options such as if it should hold the position after it gets there. If you are controlling an arm that lift against gravity, you may need to actively hold the arm up even if you reach the target position. The library module is doing its own PID control, not using the nMotorEncoderTarget that's built-in to RobotC. We found that the RobotC built-in PID doesn't do what we need because it doesn't allow you to tune the PID constants which is crucial for maintaining the stability of the arm. Our PID motor module also supports upper and lower limit switches and a Zero calibration function. So at the beginning, you can call Zero calibration that moves the arm to the "home" position. Once it touches the limit switch, the zero position is reset. From there, you will be able to set the target position where you want it.


Wed Mar 05, 2014 8:45 pm
Profile
Rookie

Joined: Thu Jul 17, 2014 8:04 am
Posts: 1
Post Re: Use Tetrix Encoders to Hold Positions?
Hello. I recently installed some encoders on our robot's arm in the hopes that I could press a button to allow the arm to go to a certain position ...


Thu Jul 17, 2014 8:54 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.