That N&V article is really a very good write up on the subject and how these sensors actually work. The circuit itself is one I really like and should work out real well. I like being able to use IR verse daylight. The chronograph I pictured is about 20 years old now and still works real well. Today's systems are cool because many offer the ability to change the sensors for IR or daylight and IR is useful indoors. Today's units also allow in the better ones the ability to interface with a laptop.reloadron I am have ordered the part to try and replicate the IR screens in the nut and volts article, hopefully should be with me soon.
"We choose to go to the moon. We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win, and the others, too." - JFK
Banks and G**gle don't pay squit - etc etc OT really
Unfortunately for us poor bastards that have been left to pay for it all while they find more ways to dump our family's unearned income into space and beyond.
I can see your logic Oracle and admire your tenacity in seeking the solution to this.
I would go down the simple route, a tube that fits the end of the muzzle, 2 'gates' an exact know distance apart, 1st gate starts a timer, the 2nd stops it, this gives you the muzzle velocity. The 'target' is a known distance fron the muzzle, simple math should give you the delay for the flash to fire, this is all that needs to be triggered as I am presuming the camera will have the shutter open ready to catch the action? This will allow for any variation in C02 pressure, differing pellet weights, temperature, air pressure etc etc. As long as the distance from muzzle to target is known this would work IMO.
this is something I may do in the future and may trigger the system from a switch on the trigger.Hello oracacle!
Do you want to photograph those pictures?
the projectile leaves the barrel straight from an old air rifle.
I am not sure I understand how this would get to the time taken to an object.
puls var w1 'pulse time in picaxe
target var w2 'puls
distance equ f1 'constant of 0.04 - loaded by picaxe
timing equ f2 'holds to time between gates - loaded by picaxe
speed equ f3 'calculated speed
dist equ f4 'distance to object, loaded by picaxe
dura equ f5 'duration to target in seconds
paus equ f6 'pause duration modified for picaxe *8000 at 64mhz
thou equ f7 'multiplier for duartion to paus - loaded by picaxe
umfpu equ f8 'duration taken for sums to be complete - loaded by picaxe
getspeed func 1 'function to calculate speed
getduration func % 'function to calulate duration to target.
timing = puls
#function getspeed
timing = timing * 0.000000625 'multiply number of units by second per unit
speed = distance / timing
#function getduration
dura = dist / speed
paus = (dura - umfpu) * thou 'remove calculation time and work out puase duration
if paus < 0 then 'now check for less than 0 and set to zero if less than 0
paus = 0
endif
#end
@getspeed
@getduration
target = paus
[color=Black]init:
[/color][color=Blue]hi2csetup i2cmaster[/color][color=Black], fpu, [/color][color=Blue]i2cslow[/color][color=Black], [/color][color=Blue]i2cbyte [/color][color=Green]'set as master and FPU as slave
[/color][color=Blue]gosub [/color][color=Black]fpu_reset [/color][color=Green]'reset FPU sub procedure
[/color][color=Blue]if [/color][color=Black]status [/color][color=DarkCyan]= [/color][color=Black]SYNC_CHAR [/color][color=Blue]then [/color][color=Black]main0 [/color][color=Green]'if FPU is present then goto main program
'If FPU is missing then run following
[/color][color=Blue]sertxd ([/color][color=Navy]13[/color][color=Black], [/color][color=Navy]10[/color][color=Black], [/color][color=Red]"uM-FPU not detected."[/color][color=Blue])[/color]
[color=Black]main0:
[/color][color=Blue]gosub [/color][color=Black]print_version [/color][color=Green]'display the uM-FPU version number
'now load constant - these may vary in final verion, the user may need to vary them also
[/color][color=Blue]hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]selecta, distance, atof, [/color][color=Red]"0.04"[/color][color=Black], [/color][color=Navy]0[/color][color=Black], fset0[/color][color=Blue]) [/color][color=Green]'distance between gates
[/color][color=Blue]hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]selecta, dist, atof, [/color][color=Red]"2.5"[/color][color=Black], [/color][color=Navy]0[/color][color=Black], fset0[/color][color=Blue]) [/color][color=Green]'test distance to object
[/color][color=Blue]hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]selecta, thou, atof, [/color][color=Red]"8000"[/color][color=Black], [/color][color=Navy]0[/color][color=Black], fset0[/color][color=Blue]) [/color][color=Green]'tempory constant for deriving ms from s - 8000 for pause at 64mhz
[/color][color=Blue]hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]selecta, umfpu, atof,[/color][color=Red]"0.0083"[/color][color=Black], [/color][color=Navy]0[/color][color=Black], fset0[/color][color=Blue]) [/color][color=Green]'calulation time, will need number for each setup, this time if for getspeed and get duration functions[/color]
[color=Black]main:
[/color][color=Blue]do [/color][color=Green]'hold here until input recieved
[/color][color=Blue]pulsin a.0[/color][color=Black],[/color][color=Navy]1[/color][color=Black],puls
[/color][color=Blue]if [/color][color=Black]puls [/color][color=DarkCyan]> [/color][color=Navy]0 [/color][color=Blue]then exit [/color][color=Green]'PCB scobe activated, channel 1
[/color][color=Blue]loop
[/color][color=Green]'========================
'===timing starts here===
[/color][color=Blue]high b.6 [/color][color=Green]'send pin high from timing - PCb scope channel 2
[/color][color=Blue]writei2c [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]SELECTA, timing, LOADWORD, [/color][color=Purple]B3[/color][color=Black], [/color][color=Purple]B2[/color][color=Black], FSET0[/color][color=Blue]) [/color][color=Green]'load time between gates
' @getspeed
[/color][color=Blue]writei2c [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]FCALL, getspeed[/color][color=Blue]) [/color][color=Green]'run get speed function
' @getduration
[/color][color=Blue]writei2c [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]FCALL, getduration[/color][color=Blue]) [/color][color=Green]'run get duration function
[/color][color=Blue]hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]SELECTA, [/color][color=Navy]0[/color][color=Black], FSET, paus, FIXR[/color][color=Blue]) [/color][color=Green]'prepare to read pause value
[/color][color=Blue]gosub [/color][color=Black]fpu_wait [/color][color=Green]'wait for FPu to be ready
[/color][color=Blue]writei2c [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]LREADWORD[/color][color=Blue])
hi2cin [/color][color=Navy]0[/color][color=Black],[/color][color=Blue]([/color][color=Purple]b5[/color][color=Black], [/color][color=Purple]b4[/color][color=Blue]) [/color][color=Green]'read duration of fligh into target
[/color][color=Blue]low b.6 [/color][color=Green]'stop timing
'===timing stop here===
'======================
[/color][color=Blue]sertxd ([/color][color=Black]#puls,com,#target, ret,lfeed[/color][color=Blue]) [/color][color=Green]'read info onto display
[/color][color=Blue]sertxd ([/color][color=Red]"Speed: "[/color][color=Blue])
hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]selecta, speed[/color][color=Blue])
gosub [/color][color=Black]print_float
[/color][color=Blue]sertxd ([/color][color=Red]"time: "[/color][color=Blue])
hi2cout [/color][color=Navy]0[/color][color=Black], [/color][color=Blue]([/color][color=Black]selecta, dura[/color][color=Blue])
gosub [/color][color=Black]print_float
[/color][color=Blue]let [/color][color=Black]puls [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]goto [/color][color=Black]main
[/color][color=Blue]end[/color]
[color=Navy]#terminal 9600
[/color][color=Blue]pause [/color][color=Navy]1000[/color]
[color=Black]init:
[/color][color=Blue]let [/color][color=Purple]adcsetup [/color][color=DarkCyan]= [/color][color=Navy]%0000000000000010
[/color][color=Blue]compsetup [/color][color=Navy]%0001010011[/color][color=Black], [/color][color=Navy]%10000110
[/color][color=Blue]setintflags [/color][color=Navy]%00010000[/color][color=Black], [/color][color=Navy]%000100000[/color]
[color=Black]main:
[/color][color=Blue]sertxd ([/color][color=Red]"Count start"[/color][color=Black],[/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
count a.0[/color][color=Black], [/color][color=Navy]2000[/color][color=Black], [/color][color=Purple]w0
[/color][color=Blue]sertxd ([/color][color=Red]"Count done"[/color][color=Black],[/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
goto [/color][color=Black]main
[/color]
[color=Blue]interrupt:
setintflags off
sertxd ([/color][color=Black]#[/color][color=Purple]w0[/color][color=Black],[/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
[/color][color=Purple]flags [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Green]'pause 1000
[/color][color=Blue]setintflags [/color][color=Navy]%00010000[/color][color=Black], [/color][color=Navy]%00010000
[/color][color=Blue]return[/color]
That is correct, pushing the button simply closes the electrical path to allow clock pulses in to the internal counter.I have been looking at hippys timer code, and have run it on hardware, however I can not see how the picaxe detects the button push, my current assumption is reading data on the SFR (feeding back to the to pin 2/serial) and checking against previous reading
The button is in series between clock source and counter input. That could be replaced by a logic AND gate which passes the clock pulses or doesn't. You could possibly use an opto-isolator but not sure how you were planning on doing that.if so I could replace the button with a simple opto-isolator.
I can't see any reason why it wouldn't.one last question - will the timer function on a 28x2 with changes to thing like em_64 instead of m_64.
Timer 1 is what I believe you need to use and Timer 3 and 5 might also be usable. Timer 2 ( 4 and 6 ) can only take their clock source from the internal oscillator, are only 8-bit counters, don't allow any hardware controlled gating so are not usable in the same way.OK I have found why it doesn't work on the 28x2, TMR1 on the PIC18Fxx2 Chips is an oscillator, I will have a look at moving over to TMR2 tomorrow as I have to get some sleep. it should just be case of changing the symbols to reference tmr2 instead of tmr1.
Any thought on this?
I have been testing with hippys' timer, attempting to see if it will work on a 28x2 so that can integrated directly with the current flash controller (ie add the timer unit and FPU and write some new code for the system).Sorry, I've lost track on your current setup.