View unanswered posts | View active topics It is currently Sun May 01, 2016 1:10 am

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Encoder Value for 1 rotation
Author Message
Rookie

Joined: Sun Nov 17, 2013 11:09 pm
Posts: 2
Encoder Value for 1 rotation
Hi I am with team 133 the Arrows,
Right now we are trying to use encoders on our motors. This is the first year we have tried to use these but we are having trouble getting our wheels to turn exactly one rotation. Here is an example of the code we tested.
while(nmotorencoder[motor1] < 360)
{
motor[motor1] = 50;
)
motor[motor1] = 0

this code works, but the wheel only rotates ~ 1/3 of a rotation

in all of the example code I've seen on cs2n.org 360 degrees is supposed to be one rotation of the motor shaft but this doesnt work on our robot.
I don't know whether we installed the encoder incorrectly or the value of on rotation is something different but i would like to know if anyone else has had this problem or knows a solution
thanks team 133 - the arrows

Sun Nov 17, 2013 11:15 pm
Rookie

Joined: Thu Nov 14, 2013 11:38 pm
Posts: 4
Location: Portland, OR
Re: Encoder Value for 1 rotation
Is this for a TETRIX DC Motor or a LEGO NXT Motor? For TETRIX DC Motor 1 revolution = 1440 encoder ticks. For a LEGO motor the logic you are using will work fine.

_________________
Team 4855 - Batteries In Black

Sun Nov 17, 2013 11:55 pm
Guru

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Re: Encoder Value for 1 rotation
 Team4855 wrote:For TETRIX DC Motor 1 revolution = 1440 encoder ticks.

Only if you use 360-line optical discs. There are 250-line discs. In that case, it would be 1000 encoder ticks. Quadrature encoders are always counting 4 times the number of lines.

Mon Nov 18, 2013 3:03 am
Rookie

Joined: Sun Nov 17, 2013 11:09 pm
Posts: 2
Re: Encoder Value for 1 rotation
Thanks for the replies we are using tetrix dc motors and I have tried 1440 and it goes over by a decent amount, the closest we have gotten to one rotation was with about 1020 degrees

Mon Nov 18, 2013 8:43 am
Guru

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Re: Encoder Value for 1 rotation
It sounds like you have a 250-line optical disc on your encoder. If so, you will have a COUNT_PER_REVOLUTION of 1000.
You can determine this by the following code:
 Code:task main(){    nMotorEncoder[motor1] = 0;    while (true)    {        nxtDisplayTextLine(2, "Enc=%d", nMotorEncoder[motor1]);        wait1Msec(100);    }}

Mark your wheel or end-effector with a piece of tape before starting the program, then run the program and hand rotate the wheel or end-effector approximately one revolution. Then look at the value on the display. Now be mindful if you have any gears between the motor and the wheel or end-effector. If so, the "counts per revolution" will also account for the gear ratio.

Mon Nov 18, 2013 4:48 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 5 posts ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

 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