London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #15 on: February 25, 2009, 02:42:40 am » |
I would have thought that the transistor and resistor would have been enough to invert the signal with the 2.5 volt pulses and drive the Arduino input. But no worries if you now have something that works.
|
|
|
|
« Last Edit: February 25, 2009, 02:43:24 am by mem »
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 592
|
 |
« Reply #16 on: March 11, 2009, 10:06:40 am » |
Hi, I have a suggestion for the code, instead of using "TCNT1 = 0;", why not remember the previous value of ICR1 and keep track of overflows, this way you can get an unlimited value for the pulse width, also it's more accurate since it takes a few clock cycles to clear TCNT1 http://code.google.com/p/circle-of-current/source/browse/vex_ppm_reader/main.cThe only thing that can go wrong is if the capture event happens when TCNT1 is 0 and the capture interrupt executes before the overflow interrupt
|
|
|
|
|
Logged
|
I'm an electrical engineering student. I designed the USnooBie (V-USB dev kit) which is sold at Seeed Studio 
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #17 on: March 11, 2009, 10:38:08 am » |
Hi Frank, resetting TCNT to 0 takes 250 nanoseconds on a 16Mhz Arduino. Because the timer is counting in 500 nanosecond ticks I don't think this delay makes any difference. Indeed I would be surprised to hear if any of the radio control equipment that would be used with this kind of application would notice differences in timing of less than a microsecond.
I am not clear if the ability to detect unlimited values for the pulse width are something one would would use in radio control or if you have another application for the code.
Many thanks for taking the time to share your comments, its always interesting to see the different ways people approach things.
|
|
|
|
« Last Edit: March 11, 2009, 10:40:58 am by mem »
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 592
|
 |
« Reply #18 on: March 11, 2009, 10:50:39 am » |
oh i totally agree that it's overkill, the RC radio would need a 16 bit ADC for the joystick if it wants to make the accuracy worthwhile, i'm not dividing my timer so i'm getting 0.05 microsecond resolution if i run my chip at 20 MHz
|
|
|
|
« Last Edit: March 11, 2009, 11:29:21 am by frank26080115 »
|
Logged
|
I'm an electrical engineering student. I designed the USnooBie (V-USB dev kit) which is sold at Seeed Studio 
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 52
Arduino rocks
|
 |
« Reply #19 on: March 23, 2009, 08:36:35 am » |
You connect the PPM stream to arduino pin 8. Hi all, mem.... could you tell me what would be the designation for the pin 8, i´m using an Arduino Duemilinove board with an atmega 328 and i think pin 8 is not the indicated one for this board . :  thanks in advance
|
|
|
|
« Last Edit: March 23, 2009, 08:37:38 am by gmv »
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #20 on: March 23, 2009, 08:45:59 am » |
All the pin assignments are the same for the 328 and the 168. have you tried it on pin 8?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 52
Arduino rocks
|
 |
« Reply #21 on: March 23, 2009, 11:19:42 am » |
Hi again, i think you mean pin 8 at the top board, i haven´t tried yet...i ment IC pin 8(atmega), so i understand now,...i´ve loaded the code and i could visualize the data stream on the arduino serial monitor. One more dumb question, what are the pin´s used for the outputs ?  regards
|
|
|
|
|
Logged
|
|
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 52
Arduino rocks
|
 |
« Reply #23 on: March 23, 2009, 05:08:51 pm » |
Thanks again mem .  gmv
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #24 on: March 23, 2009, 07:28:23 pm » |
I have the ServoDecode_pde sketch working with my chepo VEX transmitter. When I attach my scope probe to the ppm pin to view the pulses while it's going to the arduino it switches to Failsafe mode the moment I touch the pin.
Any ideas what would cause this? The scopes input impedance is 1M ohm. Not sure why this would effect anything. I can see the pulses fine on the scope but the arduino goes immediately into failsafe.
Edit: I just noticed that if I touch the pull-up resistor with my finger it also goes into failsafe mode.... I'm confused!
|
|
|
|
« Last Edit: March 23, 2009, 09:41:00 pm by ubuntucat »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #25 on: March 23, 2009, 07:30:46 pm » |
Also when I have the sticks centered the values displayed are ~1500. The pulses when viewed on the scope are ~1ms so I would have expected the values to be around 1000 instead of 1500. (or is it 2 ticks per us so then it would be 2000)
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #26 on: March 24, 2009, 12:24:25 am » |
Most transmitters send 1.5ms pulses with the stick centered. When was the last time you had your scope calibrated?  How are you connecting the signal to arduino – are you sure you need pull-ups?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #27 on: March 24, 2009, 08:37:55 am » |
thanks for the reply the details of the ppm signal from the vex are listed here http://www.allelectronics.com/mas_assets/spec/JS-6.pdf As you can see the total range for the pulses is 0.5ms - 1.5ms and 1ms is the center position. And yes you do need a pull up in order to see the pulses.
|
|
|
|
« Last Edit: March 24, 2009, 08:38:29 am by ubuntucat »
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #28 on: March 24, 2009, 08:54:10 am » |
You would need to change MIN_IN_PULSE_WIDTH and MAX_IN_PULSE_WIDTH constants to lower values to work with the vex. It looks like the space betwen pulses is the same as valid pulse width so some of the error checking wont work.
Does the vex support 12 channels?
I don't have a vex so may not be much help if you run into problems. I suggest you keep things simple at first and try to get it working with 6 channels.
|
|
|
|
« Last Edit: March 24, 2009, 08:55:17 am by mem »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 12
Arduino rocks
|
 |
« Reply #29 on: March 24, 2009, 10:03:30 am » |
Thanks mem will try that when I get home....I forgot about the min pulse widths.... The vex only supports 6 channels (4 analog, 2 digital)
Also it is the low portion of the pulse that changes not the high the high pulses are always 500us. Is this different than most transmitters?
|
|
|
|
|
Logged
|
|
|
|
|
|