|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Gear Tooth Sensor
Hello
I need help programming the gear tooth sensors. I searched chiefdelphi but didnt find any thing that helped me. im looking for the program for the sensors. I came upon some posts but i couldnt get any thing for the sensors. Also on the sensors there is j1 and j2 you have to wire them both. like one pwm cable for j1 and one for j2. from reading the manual i think the pwm cables go to rc_dig , right? Thank you |
|
#2
|
||||
|
||||
|
Re: Gear Tooth Sensor
First off, download and read Kevin Watsons encoder code and encoder FAQ
http://www.kevin.org/frc/encoder/ http://www.kevin.org/frc/frc_encoder.zip To make his code work with the gear tooth sensors you need to remove the "Phase B" logic from it. Second you wire them to digital I/O 1 and digital I/O 2 with a pwm cable. You also need to power them on a 12volt power supply as well. See the 2007 Sensor Manual for more information. |
|
#3
|
||||
|
||||
|
Re: Gear Tooth Sensor
"Phase B" dont understand this?
"12volt power supply" for teh this do you mean like connecting a wire for the battery to the sensors. thx |
|
#4
|
|||
|
|||
|
Re: Gear Tooth Sensor
1. "Phase B" refers to the code that determines which way the encoder is spinning. Since you are using a tooth sensor and not an encoder, this code will just cause problems.
2. to power on a 12volt supply, run a wire from one of your breaker panels. |
|
#5
|
||||
|
||||
|
Re: Gear Tooth Sensor
12 Volt Power with using a victor or just straight from there. What kind of a fuse should we use 40 AMP?
Also PHASE B logic, its located inside encoder.c file however I do not know which part to uncomment directly. You guys have been a tremendous help so far. |
|
#6
|
|||
|
|||
|
Re: Gear Tooth Sensor
Go directly from the fuse panel, not from a victor. I am not quite sure but i think you should use a 20 or maybe 30 amp fuse. the 40 amp fuses are for the motors.
The phase b pins are used in if statements so that it adds to the counter if it is moving forward and subtracts when moving backward. You basically have to replace it with code that will just add to the counter whenever an interrupt is fired off. Something like this should work: Code:
void Encoder_3_Int_Handler(unsigned char state)
{
if(state == 1)
{
Encoder_3_Count += ENCODER_3_TICK_DELTA;
}
}
|
|
#7
|
||||
|
||||
|
Re: Gear Tooth Sensor
for the 12 volts on the board it says 12 and underneath it there is the letter w meanning the white cable goes there from the pwm cable. so we have to connect that whit cable to the fues to get 12volts.
Also the Encoder Handler's are differnet from 1 and 2. like everything above 2 are differnet. is tehre something special about them? thx for all the help. |
|
#8
|
|||
|
|||
|
Re: Gear Tooth Sensor
The descriptions for the different encoder handlers are in the encoder_readme.txt file included with the code.
I am not sure exactly how to wire up the sensor since i have not yet wired it up myself and have not yet done the research on how to do so. |
|
#9
|
||||
|
||||
|
Re: Gear Tooth Sensor
To wire the sensor...
Take one end of a pwm cable, and solder it to J2, the black wire to GB (ground-black) the red wire to 5R (+5 volts-red) the white wire to SW (signal white). Connect the other end of this pwm to digital I/O 1. Take a 2nd pwm cable and solder it to J1, the black wire to GB, the white wired to (12W), the red wire is unused. Connect the other end to a 20amp circut on one of your atc breaker panels. Mount the sensor from .5 to 2.75 mm away from the gear to be measured. Repeat this for the second one except connect it to digital I/O 2. As for the code... Use encoder 1 and encoder 2, disable the others. Then remove the "Phase B" logic in the interrupt handler for encoder 1 and encoder 2. If you need more help PM me and I will try to clarify it better Last edited by Phalanx : 14-01-2007 at 22:43. |
|
#10
|
||||
|
||||
|
Re: Gear Tooth Sensor
Thx alot. il try to wire the senor.
|
|
#11
|
|||
|
|||
|
Re: Gear Tooth Sensor
Our code looks something like this for Encoder 1 and 2
void Encoder_1_Int_Handler(void) { // Encoder 1's phase a signal just transitioned from zero to one, causing // this interrupt service routine to be called. We know that the encoder // just rotated one count or "tick" so now check the logical state of the // phase b signal to determine which way the the encoder shaft rotated. if(ENCODER_1_PHASE_B_PIN == 0) { Encoder_1_Count += ENCODER_1_TICK_DELTA; } } #endif #ifdef ENABLE_ENCODER_2 Would this work or not? P.S. If I take away the #ifdef ENABLE_ENCODER_3 from the correct intrrupt would that correctly disable ENCODERS 3 -6. If not was would be the correct way for doing this. Last edited by Ultima : 16-01-2007 at 15:34. Reason: Clarification |
|
#12
|
||||
|
||||
|
quadrature
Reading these posts seems to confirm my thoughts that this sensor doesn't provide rotation direction information. CW or CCW This of course does not render this a useless sensor as one is often powering the motor from which sensor data is being generated. Meaning you already know its rotation and just need rotational speed for closed-loop feedback.
|
|
#13
|
|||
|
|||
|
Re: Gear Tooth Sensor
Well the sensor is quiet more usuful than that if we can get it to work.
It will provide us with a tooth count with which we can cross reference the speed of the motors and figure out what kind of a distance we traveled. That is if we can get it to work =\ |
|
#14
|
|||||
|
|||||
|
Re: quadrature
It took us a few tries last year to find and correct a small problem with this idea. When turning a small amount, the output from the direction PID can sometimes be too small to get out of the Victor deadband on one side of the 'bot but still drive the other side. What happens is that the entire robot moves forward, while the feedback routine is assuming it's turning in place. We had to ensure that we always applied a high enough control value to the Victors to actually make the motors move in the desired direction.
|
|
#15
|
|||
|
|||
|
Re: quadrature
Quote:
Robinson |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gear Tooth Sensor | nukem | Programming | 9 | 04-02-2006 20:21 |
| Gear Tooth Sensor | Talha | Electrical | 1 | 23-01-2006 21:29 |
| Gear Tooth Sensor | AMIRAM | Electrical | 2 | 22-01-2006 04:09 |
| Gear Tooth Sensor Question | (InsrtNameHere) | Electrical | 2 | 20-01-2006 02:19 |
| Gear tooth sensor issues | Nine9cracker | Electrical | 2 | 17-01-2006 02:37 |