KAP & UAV Exposure Control Intervalometer Script - page 66 - Completed and Working Scripts - CHDK Forum

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 410914 Views
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #650 on: 06 / November / 2015, 13:06:48 »
Advertisements
The pixhawk setup that we discovered somewhat by trial and error generates pulses in the range of about 4 mSec to 20 mSec, which CHDK can discriminate if high precision USB timing is enabled.   The servo output of your RC radio generated pulses shorter than 2 mSec, too fast for CHDK to read.
Ok, so you modify the pixhawk settings to produce out of spec RC PWM values... Did anybody check with the Pixhawk developers if that could have any repercussions on the pixhawk hardware (physical damage, I suppose there is very low chance) or software (sofware crash midflight  :'()?

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #651 on: 06 / November / 2015, 15:22:54 »
Did anybody check with the Pixhawk developers if that could have any repercussions on the pixhawk hardware
No.

Although I did read through the source code - it's open source and available for anyone to download.  From what I could see, using the values we "discovered" should not cause any issues.

One of the kap_uav.lua users was trying unsuccessfully to engage in a dialog about the application with the pixhawk team.  If you have a contact there feel free to reach out to them?
« Last Edit: 06 / November / 2015, 19:16:32 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #652 on: 06 / November / 2015, 19:14:38 »
I have also an S110 and manual focus setting does not work very well.
And yet manual focus seems to work really well on my S100.   

Other people I have talked to who own several S100's report at MF works well on some but not others.   

Like I said earlier,  I believe it's something that is not well calibrated.  If you get lucky, then the MF value you specify sets the lens to the right position.  If you don't get lucky, it does not. 

It's possible that cameras in the more expensive G series are actually calibrated - or the lens mechanism does not need calibration.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #653 on: 06 / November / 2015, 20:42:04 »
Although I did read through the source code - it's open source and available for anyone to download.  From what I could see, using the values we "discovered" should not cause any issues.
I tried to follow the code but couldn't get past the HAL. I suppose the important code will be on the PX4 middleware.

ardupilot/libraries/AP_Camera/AP_Camera.cpp
Code: [Select]
/// Servo operated camera
void
AP_Camera::servo_pic()
{
RC_Channel_aux::set_radio(RC_Channel_aux::k_cam_trigger, _servo_on_pwm);

// leave a message that it should be active for this many loops (assumes 50hz loops)
_trigger_counter = constrain_int16(_trigger_duration*5,0,255);
}

ardupilot/libraries/RC_Channel/RC_Channel_aux.h
Code: [Select]
/*
  set radio_out for all channels matching the given function type
 */
void
RC_Channel_aux::set_radio(RC_Channel_aux::Aux_servo_function_t function, int16_t value)
{
    if (!function_assigned(function)) {
        return;
    }
    for (uint8_t i = 0; i < RC_AUX_MAX_CHANNELS; i++) {
        if (_aux_channels[i] && _aux_channels[i]->function.get() == function) {
_aux_channels[i]->radio_out = constrain_int16(value,_aux_channels[i]->radio_min,_aux_channels[i]->radio_max);
            _aux_channels[i]->output();
}
    }
}

ardupilot/libraries/RC_Channel/RC_Channel.cpp
Code: [Select]
void RC_Channel::output() const
{
    hal.rcout->write(_ch_out, radio_out);
}

ardupilot/libraries/AP_HAL/RCOutput.h
Code: [Select]
    /*
     * Output a single channel, possibly grouped with previous writes if
     * cork() has been called before.
     */
    virtual void     write(uint8_t ch, uint16_t period_us) = 0;

Quote from: waterwingz
One of the kap_uav.lua users was trying unsuccessfully to engage in a dialog about the application with the pixhawk team.  If you have a contact there feel free to reach out to them?
Unfortunately I don't have any contacts. I did find that Lucas De Marchi is currently working on almost all the relevant sections of the APM code, and will try to contact him.


*

Offline eponymous

  • *
  • 38
  • Canon A4000
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #654 on: 12 / November / 2015, 14:47:03 »
It's possible that cameras in the more expensive G series are actually calibrated - or the lens mechanism does not need calibration.

On this related note, is the G-series then the least expensive line in which you don't have to worry about this problem with "infinity" possibly not really working correctly?
John

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #655 on: 12 / November / 2015, 18:50:22 »
It's possible that cameras in the more expensive G series are actually calibrated - or the lens mechanism does not need calibration.
On this related note, is the G-series then the least expensive line in which you don't have to worry about this problem with "infinity" possibly not really working correctly?
I really have no idea.  The G-series is the most expensive line of P&S cameras that Canon sells.  So it seems likely that if any of their cameras have accurate calibration of manual focus setting it would be those ones.  But I have no data (or easy way to collect any data) to support the proposition.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #656 on: 19 / November / 2015, 13:16:48 »
It turns out that my S110 won't focus on infinity.  The lens calibration is off.  I tested two Canon S110 cameras with the exact same settings using KAP_UAV and the infinity button active.  One camera takes perfect photos and the other camera produces blurry photos.  Go figure...It wasn't the script.  It's the darn cameras.  Some are calibrated to work and some won't.

The KAP & UAV script and support is awesome!  Too bad I can't say that about the gear we use it in.

Thanks again for all you guys do.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #657 on: 19 / November / 2015, 21:02:23 »
It turns out that my S110 won't focus on infinity.  The lens calibration is off.  I tested two Canon S110 cameras with the exact same settings using KAP_UAV and the infinity button active.  One camera takes perfect photos and the other camera produces blurry photos.  Go figure...It wasn't the script.  It's the darn cameras.  Some are calibrated to work and some won't.
Thanks for reporting this.  It's very consistent with my theory that Canon P&S manual focus settings are often poorly calibrated - even on cameras that claim to offer MF capability.  And the reason you don't see this in autofocus mode is that the camera adjusts the lens position via a closed loop feedback system until it sees the sharpest image.  It has no concept or need for physical distance values.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 14082
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #658 on: 19 / November / 2015, 21:21:42 »
Just FWIW, prior to this http://chdk.setepontos.com/index.php?topic=12103.msg125325#msg125325 setting distances >64k on S100 through CHDK probably didn't work correctly. This would only affect CHDK overrides, it would not explain problems when setting the focus entirely through the Canon MF UI.

The Canon "focus at infinity" mode present in some Canon firmware is documented in the manuals as only being a suggestion.
Don't forget what the H stands for.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #659 on: 19 / November / 2015, 21:28:20 »
Just FWIW, prior to this http://chdk.setepontos.com/index.php?topic=12103.msg125325#msg125325 setting distances >64k on S100 through CHDK probably didn't work correctly.
I've struggled with this.   Given the depth of field of these little camera lenses, and the concept of hyperfocal distance,  it seems strange that values  < 64K like 50,000 or 30,000 do not appear to give sharp focus out to infinity.

Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics