Pages: [1]   Go Down
Author Topic: Smart Laptimer  (Read 1734 times)
0 Members and 1 Guest are viewing this topic.
Orange CA
Offline Offline
Newbie
*
Karma: 0
Posts: 9
life is like a box of lemons,.... to biter to last...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok i just need some advice on simplest way to go
the idea is a complete system for Tracking lap Times for as many as 15 cars on a R/C track car will be moving as speeds over 50mph with a peeks around 70mph.
avg lap time is 17sec
at time as many as 10 cars might pass the read point at the same time.

my ORG idea was to go RFID and Place tag's on the cars but i think it just way to slow.
so I'm think IR might be best for my price range
things i know i will need

1. transponders in the cars (i have built one with a ATtiny2313 about the size of a stamp)
2. some type of receiver system to send read to a computer (i'm lost on this and need ideas)
if anyone has done IR projects in the past please chime in this is my First IR project
and my 3rd Arduino project. (i have been a repair tech for years with X,000 of hours of SMD soldering and rework exp)
the cheaper this project the better. my Cancer Meds suck me dry of cash
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just noticed this post

http://arduino.cc/forum/index.php/topic,108189.0/topicseen.html

Duane's using IR for a similar project by the looks of it.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
   There are a few commercial RC Lap timing solutions that use IR. The two challenges for IR are

1) Sunlight - the sensor needs to be in a shade of some sort to prevent saturation by sunlight

2) Line of sight - there needs to be a clear path for the light between the transponder and the sensor

The solution is to point the sensors down at the ground (away from the sun), a string of downward facing sensors are placed on a sensor bridge across the track, pointing the sensors down and having lots of the overcomes both 1) and 2).

All you need to Arduino to do is act as a concentrator for reading the sensors and sending car ids and signals to a PC over serial.

Your challenges will be -

1) Defining a protocol to identify each car in the time you have available i.e. if your cars are passing at 20 meters per second, you only have a twentieth or less of a second to read the car id.

2) The Arduino takes a few millionths of a second to process an interrupt, as your signal is likely to be several bits (interrupts) long, there is a lot of work for the Arduino to do to in a short time, especially if there are 10 cars sending their ids at the the same time, you need to take the time it takes the Arduino to process multiple interrupts into the protocol design.

As IR parts are so cheap, you can easily work this out on the bench for a few dollars in parts. My design is for a self contained timing system for one car so I have not needed to address a multi car protocol but the commercial system our club uses manages upto eight cars using IR.

A final thought - if its off road racing where dust and mud will block the emitters and detectors, IR isn't going to work well.

Duane B

rcarduino.blogspot.com
Logged


Orange CA
Offline Offline
Newbie
*
Karma: 0
Posts: 9
life is like a box of lemons,.... to biter to last...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

anyone got ideas on a IR protocol
the idea is to send a something like this <1234567>
< = Start
####### = transponder
> = End
 and fire it off in loop as fast as possible in a 38khz range i got
and a clean fast way to receive it and send to PC.
i'm Thinking a Teensy or ARM cortex m3 might work best for this with the big boost of bandwidth it has with True USB.

Track info

IL = iLaps "rclapcounter.com" from now on..
Track is outdoor BUT covered it's Hard Pack when it's dry it can get dusty But the sensors will only be in Place on Sundays for Race events.
the Idea is to Replace the IL system we had a long time ago i still have a few IL transponders even a few AMB RFID units
the IL car Transponders use a very simple attiny2313 based layout with a 300ma smd IR led

they worked 95% of the time but using my output meter they put out a very week amount of light in a 35deg beam
this req the sensors to be no more then 10inches apart and not more then 18inches off the ground this is a problem with 1/8 scale racing as it's in the way
i have no problem having the system setup this way i'm just looking for about 32" of clearance

info /questions on IL
anyone know a way to dump the raw code from a attiny2313 the IL units have 6 contact points for ISP they are QFN chips i do have the equipment to remove one and mount on a breakout board.
each IL bridge sensor has a attiny2313 on it all talking to a master unknown chip using cat5 2 of the wires are gnd 2 are 5volt
i know that the cost to make this system is almost nothing.
I'm just guessing but i think they are using I²C across the sensors.

but IL charges 35~40$ per transponder and 40$+ per bridge sensor each one is good for about a foot of track width my track is 14 feet wide then toss in about 140$ for the master brain you need
for a track that is in my backyard, i don't charge to let people run on it and with the cost of my cancer meds, even getting a arduino uno was risky.
« Last Edit: June 02, 2012, 10:11:19 am by TechMasterJoe » Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

HI,

Your system sounds like its the same one that my club uses. As for what the code is on the Attinys it doesn't matter, you are more interested in what the signal looks like, this you can find out using an IR Detector and any of the many Arduino IR Libraries.

If i get time I will have a look what my transponder puts out tonight.

For the personal lap timer system I am using a single 5mm IR Led and can detect a lapping car across the width of a two lane road, so in principle IR is good for the range you want.

Small it isn't, effective it is.



More here -
http://rcarduino.blogspot.com/2012/03/punk-consoles-and-ir-transmitters-555.html

Duane B



Logged


nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can get the code from an AVR using avrdude although I haven't done it. You will only get a HEX files though, good enough to burn more chips with exactly the same code but no good if you want to make changes to the code. Those "6 contact points" are almost certainly an ISP connector, connect a programmer to them and run the appropriate avrdude command (I don't know what it is but I know it can be done).

As for the IR protocol, I would think there would be a lot of crosstalk and signals from multiple cars would essentially be ORd together at times, I guess it works but I don't know how.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Orange CA
Offline Offline
Newbie
*
Karma: 0
Posts: 9
life is like a box of lemons,.... to biter to last...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI,

Your system sounds like its the same one that my club uses. As for what the code is on the Attinys it doesn't matter, you are more interested in what the signal looks like, this you can find out using an IR Detector and any of the many Arduino IR Libraries.

If i get time I will have a look what my transponder puts out tonight.
For the personal lap timer system I am using a single 5mm IR Led and can detect a lapping car across the width of a two lane road, so in principle IR is good for the range you want.
Small it isn't, effective it is.

thanks for the reference
i have looked at the IR coming from it and i can't seam to find any pattern to it at all
i was thinking like this
get a bunch of time data
graph it and look for the pattern as it's got to be sending  that same thing  tons of times over and over right ?
but no mater how much or little i dug my eyes lie or i'm lost.
this is My 2nd real arduino project ever (first was my charger/dis-charger).
i have the IR deMod in front of me i can wire it up later to day.
and dump time data and post it if anyone likes.
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Post your code instead, if your not that familiar with Arduino, your code might be the problem. Are you using interrupts and are you protecting access to the shared variables ?

Thinking about this in the past, I always assumed that the 8 car limit was due to the difficulty of creating 8 robust identities that can be read in the short time available. By robust I mean that an identity can still be uniquely detected even if there is cross talk from another car.

Duane B

rcarduino.blogspot.com
Logged


Orange CA
Offline Offline
Newbie
*
Karma: 0
Posts: 9
life is like a box of lemons,.... to biter to last...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i used this at first
from https://github.com/adafruit/Raw-IR-decoder-for-Arduino

Code:
/* Raw IR decoder sketch!
 
 This sketch/program uses the Arduno and a PNA4602 to
 decode IR received. This can be used to make a IR receiver
 (by looking for a particular code)
 or transmitter (by pulsing an IR LED at ~38KHz for the
 durations detected
 
 Code is public domain, check out www.ladyada.net and adafruit.com
 for more tutorials!
 */

// We need to use the 'raw' pin reading methods
// because timing is very important here and the digitalRead()
// procedure is slower!
//uint8_t IRpin = 2;
// Digital pin #2 is the same as Pin D2 see
// http://arduino.cc/en/Hacking/PinMapping168 for the 'raw' pin mapping
#define IRpin_PIN      PIND
#define IRpin          2

// the maximum pulse we'll listen for - 65 milliseconds is a long time
#define MAXPULSE 65000

// what our timing resolution should be, larger is better
// as its more 'precise' - but too large and you wont get
// accurate timing
#define RESOLUTION 20

// we will store up to 100 pulse pairs (this is -a lot-)
uint16_t pulses[100][2];  // pair is high and low pulse
uint8_t currentpulse = 0; // index for pulses we're storing

void setup(void) {
  Serial.begin(9600);
  Serial.println("Ready to decode IR!");
}

void loop(void) {
  uint16_t highpulse, lowpulse;  // temporary storage timing
  highpulse = lowpulse = 0; // start out with no pulse length
 
 
//  while (digitalRead(IRpin)) { // this is too slow!
    while (IRpin_PIN & (1 << IRpin)) {
     // pin is still HIGH

     // count off another few microseconds
     highpulse++;
     delayMicroseconds(RESOLUTION);

     // If the pulse is too long, we 'timed out' - either nothing
     // was received or the code is finished, so print what
     // we've grabbed so far, and then reset
     if ((highpulse >= MAXPULSE) && (currentpulse != 0)) {
       printpulses();
       currentpulse=0;
       return;
     }
  }
  // we didn't time out so lets stash the reading
  pulses[currentpulse][0] = highpulse;
 
  // same as above
  while (! (IRpin_PIN & _BV(IRpin))) {
     // pin is still LOW
     lowpulse++;
     delayMicroseconds(RESOLUTION);
     if ((lowpulse >= MAXPULSE)  && (currentpulse != 0)) {
       printpulses();
       currentpulse=0;
       return;
     }
  }
  pulses[currentpulse][1] = lowpulse;

  // we read one high-low pulse successfully, continue!
  currentpulse++;
}

void printpulses(void) {
  Serial.println("\n\r\n\rReceived: \n\rOFF \tON");
  for (uint8_t i = 0; i < currentpulse; i++) {
    Serial.print(pulses[i][0] * RESOLUTION, DEC);
    Serial.print(" usec, ");
    Serial.print(pulses[i][1] * RESOLUTION, DEC);
    Serial.println(" usec");
  }
 
  // print it in a 'array' format
  Serial.println("int IRsignal[] = {");
  Serial.println("// ON, OFF (in 10's of microseconds)");
  for (uint8_t i = 0; i < currentpulse-1; i++) {
    Serial.print("\t"); // tab
    Serial.print(pulses[i][1] * RESOLUTION / 10, DEC);
    Serial.print(", ");
    Serial.print(pulses[i+1][0] * RESOLUTION / 10, DEC);
    Serial.println(",");
  }
  Serial.print("\t"); // tab
  Serial.print(pulses[currentpulse-1][1] * RESOLUTION / 10, DEC);
  Serial.print(", 0};");
}
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
   The problem with most IR Decoder code is that its designed to read TV Remote type signals. The ATTiny could be sending a much faster signal.

You could try reducing the RESOLUTION to 1 as a quick test to see if the data makes any more sense, otherwise its going to be a lot more work.

Duane B
Logged


Orange CA
Offline Offline
Newbie
*
Karma: 0
Posts: 9
life is like a box of lemons,.... to biter to last...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i will just probe the led on it when i get back from store with my pocket scope
and find the feq its running at might as well look for signal as well

Sent from tablet
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Let us know what you find

Duane B
Logged


Orange CA
Offline Offline
Newbie
*
Karma: 0
Posts: 9
life is like a box of lemons,.... to biter to last...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok it is in fact running at 38khz
i was think a bit about the demodulator i have and tossed it in the trash (from a old VCR)
got a new one from a dead xbox360 and i'm getting clean data now from my JVC remote
next step is testing the transponder (i let someone use it waiting for it's return tomorrow).

i do remember a pattern on my scope i forgot to save it   smiley-roll
best money ever spent my my DSO Quad i have fixed maybe 30+ xbox's other have failed to fix because of it and my reflow toaster over
Logged

Pages: [1]   Go Up
Jump to: