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

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 411109 Views
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #970 on: 12 / October / 2017, 10:25:10 »
Advertisements
Ok I see what you mean. My initial thought was bit-banging, but maybe a proper communication will be possible.
I'll update this topic when/if I make some progress.
Thanks again waterwingz and reyalp for your info.

*

Offline lanzo

  • *
  • 28
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #971 on: 26 / April / 2018, 18:41:57 »
Dear waterwings today I had a problem with this great script I am using from a lot of time with success.

Today I found a lot of pictures very dark and under exposed, then I look in the log and I found that KAP started to use the ND filter, you can see these two very similar pictures, one with and the other without ND:

Code: [Select]
2018Apr26 14:09:50.860 248) IMG_1205.JPG
2018Apr26 14:09:52     meter : Tv:1/1250 Av:7.1 Sv:80 1225:1225
2018Apr26 14:09:52     actual: Tv:1/2000 Av:4.0 Sv:200 Temp:43
2018Apr26 14:09:52             AvMin:2.0 NDF:NDin foc:infinity
2018Apr26 14:09:55.900 249) IMG_1206.JPG
2018Apr26 14:09:57     meter : Tv:1/1250 Av:2.6 Sv:80 1216:1216
2018Apr26 14:09:57     actual: Tv:1/2000 Av:8.0 Sv:100 Temp:43
2018Apr26 14:09:57             AvMin:2.0 NDF:NDout foc:infinity

KAP is v3.8

Tomorrow I will disable the option but my question is: the error of the script was triggering the ND filter or applying a wrong exposure after enabling the filter?

Thank you very much and thank you again for your great work.

P.S.
Are you able to write an APP or know who can do for SONY Alpha cameras? Because the Sony a5100 is a great camera for photogrammetry but has internal flash and no hot shoe, I hope an APP may output a signal for external tagging

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #972 on: 27 / April / 2018, 22:59:49 »
Dear waterwings today I had a problem with this great script I am using from a lot of time with success.
Please post the entire log file as an attachment here.  TIA.

Quote
Are you able to write an APP or know who can do for SONY Alpha cameras?
I have not heard of any method of hacking a SONY Alpha.  Sorry.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #973 on: 02 / May / 2018, 02:11:02 »
Waterwingz, i love this script. I've been tinkering with the code a little bit but I'm pretty green with Lua. Maybe if I can explain what I'm trying to do it will make a little more sense. I've been tinkering with the pixhawk code to try to get it to work through a relay output on my pixhawk. From what I understand (unless I'm not setting something up right) the chdk firmware can't natively read the pwm output from the pixhawk because the pulses are too short. So I'm trying to set up pulsed output from the relay using some of the logic switches on my taranis rx. It will not be fast acting because the logic switches from the rx can only be as short as 1ds, but could greatly expand controllability of the script in the air. So now that you have my backstory, here's what I'm trying to get it to do.

I'll be utilizing two 3 position switches and one momentary switch from the taranis. The momentary switch needs to trigger the shutter, regardless of anything else. It's set up now to switch high for 1ds, then off for 6ds.

The first switch will output single nonrepeating pulses of 6, 7, and 8ds to cause the script to enter one of three modes. The second switch will output either 2 or 3 1ds pulses high, then 6ds pulse low, repeating until the switch is off.

The first mode will be a zoom mode. Switch 2 will zoom in or out dependkng on switch position.

The second mode will be exposure correction, switch two will raise or lower the target ev.

The third mode will be a recording mode, switch two will set the framerate. In this mode the trigger should also cause it to begin recording.

I hate to add to your workload, so even if you could just set me up with a direction to move in, that would be great. But i also feel this would be a huge help to anyone using the pixhawk if we could get it right.


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #974 on: 02 / May / 2018, 14:28:16 »
From what I understand (unless I'm not setting something up right) the chdk firmware can't natively read the pwm output from the pixhawk because the pulses are too short.
IIRC standard servo PWM output pulse widths run over a range of 1 mSec to 2 mSec. Some time ago, I did some experimenting with the CHDK high precision timer feature in Lua and found that you can almost resolve 10 steps between 1 & 2 mSec.  But it's right on the hairy edge of what the camera can do and I would not recommend trying it with anything important.

Quote
So I'm trying to set up pulsed output from the relay using some of the logic switches on my taranis rx. It will not be fast acting because the logic switches from the rx can only be as short as 1ds, but could greatly expand controllability of the script in the air. So now that you have my backstory, here's what I'm trying to get it to do.
I don't know much about  taranis rx units. Do I understand that you are going to ignore your Pixhawk flight controller and hook your camera's CHDK controlled USB port directly to a single relay that is in turn attached to an output from your rx unit? And you want to vary the on/off pattern coming from the relay to create a protocal that triggers your CHDK script to do different things? And your rx unit can be programmed somehow to do all of this?

Quote
I'll be utilizing two 3 position switches and one momentary switch from the taranis.  < snip >
In this mode the trigger should also cause it to begin recording.
I'm not sure I would set things up exactly this way but there may be constraints on what you can do with your taranis rx unit that I am unaware of.  One concern that might make it tricky is making sure the 1d sec shutter trigger pulse does not get mistaken for the 2 or 3 1ds pulses used to switch modes.  It can be done but the code gets more complicated.

By the way, does 1ds mean 100 mIlliseconds?

In any case, you'll want to hack out all the code starting around line 420 where it says

====== PWM USB Pulse Controlled Functions ==========

and replace it with your own code.  If you are stuck, I could probably give you a quick and dirty version to try out - debugging would be up to you though.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #975 on: 02 / May / 2018, 15:31:53 »

Quote
IIRC standard servo PWM output pulse widths run over a range of 1 mSec to 2 mSec. Some time ago, I did some experimenting with the CHDK high precision timer feature in Lua and found that you can almost resolve 10 steps between 1 & 2 mSec.  But it's right on the hairy edge of what the camera can do and I would not recommend trying it with anything important.

Is the script already set up to do this using the included sample code for pixhawk? I was reading the timing as 5,10,15, and 20 ms. Am i misinterpretung those or maybe this is from an earlier version of the code?

Quote
I don't know much about  taranis rx units. Do I understand that you are going to ignore your Pixhawk flight controller and hook your camera's CHDK controlled USB port directly to a single relay that is in turn attached to an output from your rx unit?

Not exactly. The pixhawk can be set to use a servo output as a digital relay, the relay can then in turn be programmed to activate on a high pwm input from a channel. Also I misspoke, the Taranis is a handheld tx

Quote
And you want to vary the on/off pattern coming from the relay to create a protocal that triggers your CHDK script to do different things? And your rx unit can be programmed somehow to do all of this?

Exactly. The taranis has some pretty powerful logic circuitry, including timers and such. I was hoping to alter the code to utilize a combination of pulse counting and pulse widths to put as many functions in as short of time as possible. Of course, if im setting up the pixhawk wrong, a pwm input would be much easier to program and alter code on.

Quote
I'm not sure I would set things up exactly this way but there may be constraints on what you can do with your taranis rx unit that I am unaware of.  One concern that might make it tricky is making sure the 1d sec shutter trigger pulse does not get mistaken for the 2 or 3 1ds pulses used to switch modes.  It can be done but the code gets more complicated.

By the way, does 1ds mean 100 mIlliseconds?

In any case, you'll want to hack out all the code starting around line 420 where it says

====== PWM USB Pulse Controlled Functions ==========

and replace it with your own code.  If you are stuck, I could probably give you a quick and dirty version to try out - debugging would be up to you though.

Help with either getting the script to work with native pwms or the relay output ive been working on would be awesome. Your script is complicated and i know every piece has a purpose, so even if i knew what i was doing (and i dont) i feel like i would spend more time breaking it then getting it to do what i want.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #976 on: 02 / May / 2018, 21:43:28 »
Also yes, ds for decisecond, so 100ms

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #977 on: 02 / May / 2018, 21:49:44 »
Is the script already set up to do this using the included sample code for pixhawk? I was reading the timing as 5,10,15, and 20 ms. Am i misinterpretung those or maybe this is from an earlier version of the code?
The test I mentioned was just that - a test.  I never included the test code in the script.

Quote
The pixhawk can be set to use a servo output as a digital relay, the relay can then in turn be programmed to activate on a high pwm input from a channel. Also I misspoke, the Taranis is a handheld tx
Okay - that makes more sense now.

Quote
Help with either getting the script to work with native pwms or the relay output ive been working on would be awesome. Your script is complicated and i know every piece has a purpose, so even if i knew what i was doing (and i dont) i feel like i would spend more time breaking it then getting it to do what i want.
Might not be able to get to this for a couple of days but I will take a look.  I have an updated version of the script that uses the more recent style for user variables. I keep meaning to release it but it needs testing.  You can be the guinea pig to make sure I did the update correctly.   ;)

Quote
Also yes, ds for decisecond, so 100ms
Thanks
Ported :   A1200    SD940   G10    Powershot N    G16


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #978 on: 02 / May / 2018, 22:01:36 »
I'd love to test anything you come up with. I'm using an sx710 with 101a firmware, as I wanted something with a high zoom and 1080 video. It obviously isnt very highly tested, but everything chdk related seems to work so far. I think integrating with pixhawk would be an amazing step forward, as even gentwire is limited to 6 different pulses. When you get a chance, dump a copy of the update and let me know what you want me to test on it and I'll get to work. A little beta testing is the least I can do.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #979 on: 12 / May / 2018, 09:41:40 »
I'll be utilizing two 3 position switches and one momentary switch from the taranis. The momentary switch needs to trigger the shutter, regardless of anything else. It's set up now to switch high for 1ds, then off for 6ds.

The first switch will output single nonrepeating pulses of 6, 7, and 8ds to cause the script to enter one of three modes. The second switch will output either 2 or 3 1ds pulses high, then 6ds pulse low, repeating until the switch is off.

The first mode will be a zoom mode. Switch 2 will zoom in or out dependkng on switch position.

The second mode will be exposure correction, switch two will raise or lower the target ev.

The third mode will be a recording mode, switch two will set the framerate. In this mode the trigger should also cause it to begin recording.
I got a chance to do a bit of work on this.  Before I go any further, I'd like confirmation that you can actually configure your Tx unit to produce these pulse sequences.  They are pretty specific so I'd rather only code this once.

Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics