View unanswered posts | View active topics It is currently Sun May 27, 2018 7:46 pm

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Use Tetrix Encoders to Hold Positions?
Author Message
Rookie

Joined: Thu Feb 27, 2014 4:40 pm
Posts: 1
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
Rookie

Joined: Thu Feb 27, 2014 1:47 pm
Posts: 2
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
Rookie

Joined: Tue Nov 20, 2012 8:09 pm
Posts: 36
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
Guru

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
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 like1) Send in where you want the arm to go as a variable2) Know what the current position of the encoder is.3) Find the difference between these two values4) 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
Rookie

Joined: Thu Jul 17, 2014 8:04 am
Posts: 1
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
Display posts from previous:  Sort by
 Page 1 of 1 [ 5 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning