before making this video, I increased the sleep time before sampling to 200ms , hoping that could increase precision. - it did:
http://youtu.be/wqh4Fodx76g is made with this code:
--[[
@title USB Tester
@param m Mode
@default m 0
@values m State Width Pulses Count Key
--]]
function printf(...)
local tic = get_day_seconds()
print (string.format("%02d:%02d:%02d %s", tic/3600, tic%3600/60, tic%60, ...))
end
function StartStopVideo()
local rec, vid = get_mode()
local vid_button = get_video_button()
if rec == true and vid == true and vid_button == 0 then
press("shoot_full")
sleep(300)
release("shoot_full")
elseif rec == true and vid_button == 1 then
click("video")
end
end
function Shoot()
press("shoot_half")
repeat sleep(50) until get_shooting() == true
press("shoot_full")
sleep(500)
release("shoot_full")
repeat sleep(50) until get_shooting() == false
release("shoot_half")
end
mode = m
set_console_layout(1, 1, 44, 10) --console position x1,y1,x2,y2
last=2 -- 1=low 2=med 3=high
print("PWM remote")
set_config_value(121,1) -- make sure USB remote is enabled
scount=0
usb_state=-1
rkey=0
repeat
sleep(200)
x=get_usb_power(0)
--[[
if ( x == 0) --nothing new since last time
then
if (last==1)
then
printf("REPEAT, width ="..(x*10).." mSec")
--Shoot() --repeat until switch centered
sleep(50)
end
end
--]]
if ( x > 1 and x < 9 ) --looking for 20ms "low/shoot"
-- if ( x > 1 and x < 9 and last ~= 1) --looking for 20ms "low/shoot"
then
last=1
printf("shooting, "..(x*10).." mSec")
Shoot()
end
-- if ( x > 10 and x < 19 and last ~= 2) --looking for 70ms "neutral/center"
if ( x > 10 and x < 19 ) --looking for 70ms "neutral/center"
then
last=2
printf("center, "..(x*10).." mSec")
end
if ( x > 20 and x < 30 ) --looking for 50ms "high/mode"
-- if ( x > 20 and x < 30 and last ~= 3) --looking for 50ms "high/mode"
then
last=3
printf("mode, ="..(x*10).." mSec")
--StartStopVideo()
end
until is_pressed("menu")
set_config_value(121,0) -- make sure USB remote is disabled
fed with 20ms , 150ms , 250ms.
same thing, except one "minor" change:
I removed the pause before get_usb_power, things got worse.
repeat
--sleep(200)
x=get_usb_power(0)
at(logtime) 20:01:31 - it even trigged, I did not send the 20ms pulse.
150ms seems to be detected as ~110 (-40ms off) , 250ms seems to be 170ms (-80ms off)
after log 20:02:22 - I stopped feeding it pulses, to see if a pause helped.. no it did not.
http://youtu.be/6Fg7DAJLoQcrepeat
--sleep(200)
x=get_usb_power(0)
----
now S95 (x2)
S95 does not seem to have a bigger problem after picture. But it's less accurate before picture as well.
Running the script with no delay, produces the same, lower measurement phenomenon
http://youtu.be/4kp5FWsAZqsFirmware used was: s95-100k-1.2.0-3338-full_BETA and s100-102a-1.2.0-3338-full_BETA
Regarding workload, I disabled GPS, no change.
Update of the S100 research, there's no difference in 200ms delay, and 50ms delay both delays give at mostly an error of "only" 20ms , - except the big difference with no delay.
both 200ms and 50 ms results