Go to Post No, I've never done 3D programming before, but I'm young and naive, so I still think I can do it. ;) - Ryan M. [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 4.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-10-2011, 10:53
Alyssa Reiman Alyssa Reiman is offline
Registered User
FRC #1111
 
Join Date: Oct 2010
Location: Maryland
Posts: 7
Alyssa Reiman is an unknown quantity at this point
[FTC]: Motor Encoders

We are atempting to create a code for motor encoders, but we can not find a VI that does this or any place to tell us how to do this. Can anybody give us some directions or sample code?
Reply With Quote
  #2   Spotlight this post!  
Unread 15-10-2011, 12:57
jasonbrooks's Avatar
jasonbrooks jasonbrooks is offline
Team Captain
FTC #3540 (Roboboogie)
Team Role: Mechanical
 
Join Date: Sep 2011
Rookie Year: 2009
Location: New York
Posts: 71
jasonbrooks is an unknown quantity at this point
Re: [FTC]: Motor Encoders

Can this be in robotC or can it only be for labview?
Reply With Quote
  #3   Spotlight this post!  
Unread 15-10-2011, 16:05
kz2zx kz2zx is offline
Ruthlessly Insufficient
FTC #5246
Team Role: Coach
 
Join Date: Sep 2011
Rookie Year: 2011
Location: AZ
Posts: 14
kz2zx will become famous soon enough
Re: [FTC]: Motor Encoders

Alyssa,

I can't help with LabView, but in general, I'd say look for a variable/attribute in the motor block with 'Encoder' or 'Count' in the name.

Jason,

How are you trying to use them? Through the standard HiTechnic interface, you can access a variable in RobotC named 'nMotorEncoder[]'...

Find a file in your (this was RobotC 2.xx) distribution of sample programs:

C:\Program Files (x86)\Robotics Academy\ROBOTC for MINDSTORMS\Sample Programs\NXT\TETRIX Motors\TETRIX nMotorEncoders Example.c

and see this code:
Code:
task main()
{

  nMotorEncoder[motorE] = 0;  //clear the TETRIX encoders in motors D and E
  nMotorEncoder[motorD] = 0;

  while (nMotorEncoder[motorE] < 1440) //while the encoder wheel turns one revolution
  {
    motor[motorE] = 30; //turn both motors on at 30 percent power
    motor[motorD] = 30;
  }

  motor[motorE] = 0; //turn both motors off
  motor[motorD] = 0;

  wait1Msec(3000); // wait 3 seconds to see feedback from the debugger screens
                    // open the "NXT Devices" window to see the distance the encoder
                    //spins. The robot will coast a little bit.
}

Last edited by kz2zx : 15-10-2011 at 16:08.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-10-2011, 07:22
jasonbrooks's Avatar
jasonbrooks jasonbrooks is offline
Team Captain
FTC #3540 (Roboboogie)
Team Role: Mechanical
 
Join Date: Sep 2011
Rookie Year: 2009
Location: New York
Posts: 71
jasonbrooks is an unknown quantity at this point
Re: [FTC]: Motor Encoders

Hi,
Yes, that is what I was going to suggest for her to do - I actually was asking her if she would be allowed to use robotC and then was going to tell her that, I did already know how to do that

But you just made my life easier and told her. And yes, that is exactly what to do.

If you need help with labview, I can ask someone else on my team who uses it sometimes, and will try to get you an answer by tuesday
Reply With Quote
  #5   Spotlight this post!  
Unread 18-10-2011, 19:30
stem12bfalk stem12bfalk is offline
Registered User
FTC #5178
 
Join Date: Oct 2010
Rookie Year: 2009
Location: Maryland
Posts: 6
stem12bfalk is an unknown quantity at this point
Re: [FTC]: Motor Encoders

We use Labview.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-10-2011, 13:14
surly surly is offline
Registered User
no team
 
Join Date: Sep 2011
Location: austin
Posts: 4
surly is an unknown quantity at this point
Re: [FTC]: Motor Encoders

DC Motors with encoders can be used in LabVIEW through three VIs on the "NXT Robotics >> TETRIX" palette.

Move a Fixed Distance : Starts motors running at constant speed with a target encoder count. You can also specify timeout conditions.

Motor Status: Returns the current encoder count and whether the DC controller is in the middle of a move to position command.

Reset Encoders: this ones pretty simple.
Reply With Quote
  #7   Spotlight this post!  
Unread 16-11-2011, 12:11
blptrsen blptrsen is offline
Registered User
AKA: Bruce Petersen
FTC #0116 (Crazy Eights)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2010
Location: Lisle, IL
Posts: 2
blptrsen is an unknown quantity at this point
Re: [FTC]: Motor Encoders

Team #116 is using a torque-limiting clutch (FTC Robotics: Tips, Tricks, Strategies & Secrets, Teams #247 & 248) and would like to install an encoder after the clutch on a standard Tetrix 3/16" shaft. Can we use a US Digital E4P-360-188-D-H-D-2 encoder on a shaft instead of a standard Tetrix motor encoder? The only difference is the shaft size and mounting screws.
Reply With Quote
  #8   Spotlight this post!  
Unread 16-11-2011, 23:43
emmell's Avatar
emmell emmell is offline
Murphy was an Optimist!
AKA: Mannie Lowe
no team (Radbotics, RoboKnights, CircuitRunners, Oscar, and more...)
Team Role: Coach
 
Join Date: Dec 2005
Rookie Year: 2005
Location: Marietta, GA
Posts: 178
emmell is just really niceemmell is just really niceemmell is just really niceemmell is just really niceemmell is just really nice
Re: [FTC]: Motor Encoders

Quote:
Originally Posted by blptrsen View Post
Team #116 is using a torque-limiting clutch (FTC Robotics: Tips, Tricks, Strategies & Secrets, Teams #247 & 248) and would like to install an encoder after the clutch on a standard Tetrix 3/16" shaft. Can we use a US Digital E4P-360-188-D-H-D-2 encoder on a shaft instead of a standard Tetrix motor encoder? The only difference is the shaft size and mounting screws.
Better ask this question on the official game Q&A before you purchase anything.
__________________
Mannie Lowe
FIRST Program Manager - Center for Mathematics and Science Education - University of Mississippi
Mississippi FIRST Tech Challenge Affiliate Partner


Reply With Quote
  #9   Spotlight this post!  
Unread 17-11-2011, 00:12
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: Motor Encoders

Quote:
Originally Posted by surly View Post
DC Motors with encoders can be used in LabVIEW through three VIs on the "NXT Robotics >> TETRIX" palette.
Move a Fixed Distance :
Motor Status:
Reset Encoders:
It's also very easy to use the encoders to regulate the motor speed (vs the motor power)

eg: On the driving portion of the code, on the move motors VI, change the Polymorphic selector (small oprion box under the move motor VI) from Power to Speed.

Assuming you have the encoder and motors wired correctly, this will enable you to get MUCH finer control of the driving. eg: with constant power, it's hard to get a slow move. You always need to have a certain amount of power just to get the motors to overcome friction (eg 20%). However if you use Constant Speed, (with encoders) you can get the speed as low as you want (eg: 5%) and it ALWAYS runs at that speed, regardless of friction. It's great for slow turns etc.

If you try using encoders and you always seem to go at 100% speed, then you have a wiring problem... Could be your encoders and motors are switched, A-B and B-A or mayve your motors are wired in reverse (red -ve, black +ve)
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi