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

KAP & UAV Exposure Control Intervalometer Script

  • 1068 Replies
  • 410852 Views
Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #870 on: 04 / July / 2016, 12:01:18 »
Advertisements
Your APM settings seem to be Ok. As I never used a gentwire cable before, let's try to diagnose what it's doing.

Please connect the gentwire directly to the RC receiver channels 3 (throttle) and 2 (pitch), without using the pixhawk. Download the GentWire test script from http://www.gentles.ltd.uk/gentwire/chdk_sdm/CHDK2Tester.zip, run the script and report back (instructions for the script are at http://www.gentles.ltd.uk/gentwire/chdk_sdm/index.htm). Does the camera report "channel 1 up" when you move the throttle all the way up, "channel 1 middle" when you move the throttle to the middle, "channel 1 down" when you move the throttle down? Do the same with the pitch stick. It should report the same, but with channel 2. Does the script report your actions correctly?
What happens when you connect only one cable to the channel  3 (throttle)? What does the test script report?

Next, modify the test script:
Replace lines 13 to 19 (all the lines that start with "if a  ....") with just a single line: "print a" (without the quote marks).
Save the script, and run it while testing every combination of the throttle & pitch positions (ie: throttle down & pitch down; next throttle down & pitch center; next throttle down & pitch up; then throttle middle & pitch down; etc). What does the script report for every combination? You could also test what the script reports when you only connect one cable to the throttle, and leave the other cable disconnected from the pitch.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #871 on: 04 / July / 2016, 12:15:05 »


I waded through each of the runs in your log.  They all make sense if you assume that the gentwire2 device only ever sends IDLE pulses (i.e. 200 mSec pulses). 

I wrote a much longer description of what happened at each log entry but the forum barfed when I posted and it got lost. >:(

In the end, what each case shows is the the script is only seeing idle pulses from the gentwire2 device.

It will be interesting to see what happens if you follow the testing method suggested by Naccio.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #872 on: 04 / July / 2016, 13:32:24 »
Thank you!  The instructions make sense, I'll be back there tomorrow morning and see what I come up with.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #873 on: 06 / July / 2016, 09:20:56 »
Thank you for the instsructions.  Most helpful.  After connecting the GUSB2 to the RX and running the test script it worked well.  Channel 1 and 2 both worked with the sticks.  One confusing thing was the 1 channel on the RX was the throttle and the 3 channel was the pitch.  It's a Dragonlink v2 basic Rx, but I'm guessing that has nothing to do with the camera triggering, so I ignored it.

After modifying the script, here are the stick and result combinations:
Throttle, Pitch, Result
down, middle, 6
down, down, 8
down, up, 3
middle, middle, 15
up, middle, 12  (keeping the pitch in the middle, as I move the throttle up and down I get values from 12 to 19)

Moving the throttle gives me values between 12 to 19 regardless of where the pitch is set
Same with the Pitch.  Leaving the throttle in one position (doesn't matter which), moving the pitch gives me values between 3 and 9.

I'll see what i get when it's going through the pixhawk.


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #874 on: 06 / July / 2016, 09:33:42 »
I'll see what i get when it's going through the pixhawk.
You could also connect the gentwire2 directly to the camera and validate that the kap_uav.lua script will work with it directly (it should).
Ported :   A1200    SD940   G10    Powershot N    G16

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #875 on: 06 / July / 2016, 11:14:11 »
Didn't have time to try different things today, but the modified test script showed a constant "6" when plugged into the Pixhawk.  I suppose I need to figure out how to get other values. 

One thing I haven't quite understood is the parameters necessary in Mission Planner to get the two channels working.  I haven't come across examples of this yet.  I'm assuming two AUX ports would be set to something, but it won't let me have two set to camera trigger.  Ah well, for tomorrow.

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #876 on: 06 / July / 2016, 11:16:33 »
After modifying the script, here are the stick and result combinations:
Throttle, Pitch, Result
down, middle, 6
down, down, 8
down, up, 3
middle, middle, 15
up, middle, 12  (keeping the pitch in the middle, as I move the throttle up and down I get values from 12 to 19)

Moving the throttle gives me values between 12 to 19 regardless of where the pitch is set
Same with the Pitch.  Leaving the throttle in one position (doesn't matter which), moving the pitch gives me values between 3 and 9.

Thank you! I think I understand how it works.
It seems you connected channel 1 to the pitch and channel 2 to the throttle.
It looks like the gentWire only registers the last change in any channel, and sends the corresponding pulse. Meaning: if you move the throttle up, and a second later move the pitch up, it will first send a 180mS pulse, then a second later it will send a 90mS pulse, and it will keep sending a 180mS pulse until you move a stick again.

Here are the gentWireUSB2 specifications:
Quote
Movement of the RC Transmitter stick from one extreme to the other will send a single trigger to the camera at either end and in the middle. The example scripts, or user generated scripts, can detect the following pulse lengths on the USB power with the get_usb_power function which counts with 10mS resolution:
Channel 1USB PulseChannel 2USB Pulse
Low position30mSLow position120mS
Mid position60mSMid position150mS
High Position90mSHigh Position180mS

In addition to the above, a 210mS pulse will be sent every 5 seconds if neither servo is connected to a RC receiver. If the RC receiver looses communication with the transmitter and the receiver stops sending pulses to the servos, then the USB output will go high continuously until communication is re-established.
[/t]

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #877 on: 06 / July / 2016, 11:25:56 »
Didn't have time to try different things today, but the modified test script showed a constant "6" when plugged into the Pixhawk.  I suppose I need to figure out how to get other values. 

One thing I haven't quite understood is the parameters necessary in Mission Planner to get the two channels working.  I haven't come across examples of this yet.  I'm assuming two AUX ports would be set to something, but it won't let me have two set to camera trigger.  Ah well, for tomorrow.
Try setting these APM params:
RC7_MIN --> 1100
RC7_TRIM --> 1100
RC7_MAX --> 1900
CAM_SERVO_OFF --> 1100
CAM_SERVO_ON --> 1900


Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #878 on: 06 / July / 2016, 11:54:25 »
Super!  It works flawlessly now.  Thank you for the suggestion.  Could you explain what the difference was?

Re: KAP & UAV Exposure Control Intervalometer Script
« Reply #879 on: 06 / July / 2016, 12:22:52 »
Super!  It works flawlessly now.  Thank you for the suggestion.  Could you explain what the difference was?
Glad I could help!  :)
I believe the param to look out for is RC7_TRIM. That param tells the pixhawk what PWM pulse width to send when idling. You had it set at 1500, equivalent to "channel 1 mid", now it's set at 1100, equivalent to "channel 1 low". WW's script expects "channel 1 low" while waiting for the next shot, and "channel 1 high" as the order to shoot when configured for your setup.

 

Related Topics