![]() |
Random GTS output
We have coded the gear tooth sensor correctly (at least according to what everything says). They are wired correctly too but we get inaccurate and random readings from them.
We have the sensors placed correctly, approx. 1mm away, and it senses to gear but it seems to be random. No pattern has been found to how it reads the pulses so we can't even work around that. Has anybody else had this issue or are we just doing something wrong? |
Re: Random GTS output
well, we are encountering the similiar problem, We also connected everything right, and connected the snsor in Digital INput 1,also the code is fine.but when you run the code, The terminal window gives 0 values from E1 to E6.But cant find the problem
Thanx a lot. Bilal Shahid Team 1219. |
Re: Random GTS output
Do you have a good backup battery plugged in when you are doing these tests? The GTS use both the 12 VDC from the main battery and the 5 VDC from the digital input. We made this mistake last weekend and found that one GTS seemed to work fine with no backup battery while the second would not.
Charlie |
Re: Random GTS output
Quote:
Can you observe the GTS output directly using an oscilloscope? Doing that could either point to or rule out hardware problems. |
Re: Random GTS output
Our Team is using the IFI Default Code and have the counter in user_routines_fast.c. We have the Gear Tooth Sensor plugged into rc_dig_in01 and are using the interrupt code that comes with the user_routines_fast.c default code.
Code:
#pragma codeCode:
if (rc_dig_in01 >0) { |
Re: Random GTS output
Quote:
Note that the default interrupt handler doesn't do anything except clear the interrupt when your GTS sends its pulse: Code:
if (INTCON3bits.INT2IF && INTCON3bits.INT2IE) /* The INT2 pin is RB2/DIG I/O 1. */Quote:
Look at Kevin Watson's encoder support files ( http://www.kevin.org/frc ) to see an example of how to initialize the interrupt, update the counter value, and read the value while protecting it from being changed in the middle of being read. |
Re: Random GTS output
What part of kevin's code do I actually need? It looks to me that I need everything in encoder.c, the interrupts in ifi_frc.c, and ADC.c from kevin's files, which I don't even understand why I need that one. We're trying to use IFI's default code and want to make the encoder code as simple as possible. could anyone please give us some code that works with IFI's Default Code
|
Re: Random GTS output
If you want to use the Gear Tooth Sensor with the IFI default code, it will probably be easiest to follow the detailed directions from Kevin Watson's encoder support code. To start with, select an unused digital input for the Phase B signal. Later, once you've verified that it works, you can investigate changing the interrupt service routine to remove the Phase B test entirely.
|
| All times are GMT -5. The time now is 12:44. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi