|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Hello, I know how to program basic tasks. such as sticks, pwms, pneumatics, relays, autonomous, etc. We are putting these Optical Encoders on our robot to make sure our robot goes straight, instead of veering to the left or the right. Can someone please help me, i have no idea how to program these or where to even start. I found some information on the actual encoder we have, but i need programming help. Any help would greatly be appreciated. Thank You.
http://usdigital.com/products/encode...l/modules/em1/ |
|
#2
|
||||||
|
||||||
|
Re: Help Programming Transmissive Optical Encoder Module from usdigital.com
Can you give more details about what you don't understand based on your last thread? http://www.chiefdelphi.com/forums/sh...ad.php?t=68102
Better yet, post your questions there, so others can see the history. |
|
#3
|
|||
|
|||
|
Re: Help Programming Transmissive Optical Encoder Module from usdigital.com
For programming, you should take a look at Kevin Watson's encoder code. (located http://kevin.org/frc/) The instructions in there should help you. If you need anything else feel free to ask.
|
|
#4
|
||||
|
||||
|
Re: Help Programming Transmissive Optical Encoder Module from usdigital.com
well from kevin.org/frc, i downloaded the encoder files, now what exactly do i do with them, theres a bunch of .c and .h files i believe. what exactly do i do with them?
|
|
#5
|
|||
|
|||
|
Re: Help Programming Transmissive Optical Encoder Module from usdigital.com
Quote:
I have included the relevant portions below, yes the copyright is relevant, read it. Quote:
|
|
#6
|
||||
|
||||
|
Re: Help Programming Transmissive Optical Encoder Module from usdigital.com
Thank Your very Much!
|
|
#7
|
||||
|
||||
|
Re: Help Programming Transmissive Optical Encoder Module from usdigital.com
Quote:
The theory of using encoders in this application, where you have a left-side driver motor and a right-side drive motor for your robot, is to mount one encoder per side. The "quadrature" encoders such as the EM1 output two digital pulse signals - Phase A signal, and Phase B signal - which are connected to two digital input ports on the robot controller. Of course you have two encoders (left and right side) so you will be using four digital input ports. Code such as Kevin Watson's watches the signals and counts them. When the motor is going in one direction the Phase A signals will be slightly earlier than the Phase B signals, and vice versa when the motor runs in the opposite direction, so the software can tell which way the motor is running, can counts the the number of pulses per time unit (in one second, say) to determine the rotational speed of the shaft, and the total number of counts can represent distance. To drive straight, you would compare the speed or even the total counts of the encoders on the left and right sides. Assuming the wheel diameters are the same - adjusting the motor speeds (by varying values sent to the Victor speed controllers) to keep the encoder counts identical results in the robot driving straight. How to best do THAT is your next challenge ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help Programming a Quadrature Encoder | programmr | Programming | 17 | 06-20-2008 10:40 AM |
| A nice and cheap optical encoder! (not a question) | windell747 | Electrical | 9 | 05-04-2008 02:13 PM |
| programing the vex optical shaft encoder | youngWilliam14 | Programming | 10 | 11-11-2007 04:16 PM |
| Rotary Encoder (optical etc.) | Gary C | Technical Discussion | 4 | 01-16-2005 06:23 PM |
| Programming Optical Encoders | GrahamS314 | Programming | 5 | 03-09-2003 08:16 AM |