I'm confused and a bit frustrated, would appreciate any help as I'm not sure how to proceed.

Setup: I have a pixhawk autopilot running Arduplane 2.77, using Mission Planner 1.2.95

I've been following this guide to get my CHDK enabled camera working with my pixhawk. I'm interested in getting the camera triggering based on distance traveled.

Obviously the guide was written with APM in mind, so it needs to be adapted a bit for pixhawk; specifically the setting for RELAY_PIN. I've kept the rest of the settings the same as in the tutorial.

Pixhawk has 6 AUX ports according to the quick start guide, I am assuming that the numbers above the pins correspond to the AUX port numbering. When you mouse over the RELAY_PIN parameter, it says that pin 54 corresponds to Pixhawk FMU AUX1.

Tried setting RELAY_PIN to 54, no joy. Did a bit more looking, discovered in the release notes for 2.77: 

"Improved relay code
The relay and servo set code has had a major overhaul, with up to 4 relays now supported for MAVLink control and much better support for the DO_SET_SERVO, DO_SET_RELAY, DO_REPEAT_SERVO and DO_REPEAT_RELAY MAVLink commands. Along with these changes is a new parameter BRD_PWM_COUNT which allows you to specify how many auxillary PWM outputs to enable, with the remaining outputs being available as digital relays. This allows you to re-assign some of the aux servo outputs on Pixhawk for use as relays, by setting the RELAY_PIN, RELAY_PIN2, RELAY_PIN3 and RELAY_PIN4 parameters. The pin numbers for these pins start at 50 for the first aux servo pin, and go to 55 on Pixhawk."

Additionally,I found this github issue about this same problem that states that the Pixhawk can't trigger CHDK because its relay pins operate at 3.3V instead of 5V.

So i suppose my specific questions are:

1) Is AUX1 pin 50 or 54?

2) Can anyone confirm that the relays, when working properly, won't be able to trigger CHDK?

Views: 68068

Reply to This

Replies to This Discussion

Hi Jeremy,

Regarding the LOG_BITMASK, what I found out using Pixhawk firmware/board is:

* Default : Not record CAM info, but GPS info was recorded.

* 32768 or MASK_LOG_CAMERA : Record CAM info, but missing crucial info GPS see my post here so useless for geo ref images process.

* Nearly All : CAM and GPS info recorded but the file is huge..

Interested to know what type of data stored when you use: 33598 ?

Could you share log example here?

Thanks

Waladi 

Hi Waladi,

I'm at the very edge of my understanding here but I worked from a message by Bill Bonney on this discussion.

I think the loggable items are these:

Log

2 raised to…

#define MASK_LOG_ATTITUDE_FAST

0

#define MASK_LOG_ATTITUDE_MED

1

#define MASK_LOG_GPS

2

#define MASK_LOG_PM

3

#define MASK_LOG_CTUN

4

#define MASK_LOG_NTUN

5

#define MASK_LOG_RCIN

6

#define MASK_LOG_IMU

7

#define MASK_LOG_CMD

8

#define MASK_LOG_CURRENT

9

#define MASK_LOG_RCOUT

10

#define MASK_LOG_OPTFLOW

11

#define MASK_LOG_PID

12 deprecated

#define MASK_LOG_COMPASS

13

#define MASK_LOG_INAV

14 deprecated

#define MASK_LOG_CAMERA

15

#define MASK_LOG_WHEN_DISARMED

(1UL16)

#define MASK_LOG_RATE

 (1UL17)

#define MASK_LOG_MOT

(1UL18)

#define MASK_LOG_ANY

0xFFFF

The DEFAULT log consists of these:

    MASK_LOG_ATTITUDE_MED (1 in the table above)

    MASK_LOG_GPS (2 in the table above)

    MASK_LOG_PM (3, etc...

    MASK_LOG_CTUN

    MASK_LOG_NTUN

    MASK_LOG_CMD

    MASK_LOG_CURRENT (9 in the table above)

According to the notes in the Full Parameter table the value for the DEFAULT log is 830. This is derived by:

2^1 + 2^2 + 2^3 + 2^4 + 2^5 + 2^8 + 2^9 = 830

Since CAMERA in the table above is 15 I just added 2^15 to 830 and came up with 33598. 

The CAMERA messages include Lat and Lon as well as Alt, Roll Pitch Yaw and inject into JPEG OK using MP method as long as number of pictures exactly matches the number of trigger messages. I'm not sure how to share a log with you but happy to do so if it would help.

Cheers

Jeremy

Wow, Great tutorial Jeremy..

That make all sense.. Many thanks to share it.

About the log, you can share it using free online storage such as Dropbox.com as you will. 

Hi Waladi,

OK, I'm a bit slow, thanks. Here is an rlog from a flight with LOG_BITMASK set to 33598. Hope it does what I've claimed and what you need.

Jeremy

Hi Jeremy,

Thanks for the log file. It's include GPS and CAM info.. Great!!

Size comparison:

* Nearly All Log: 26.2 Mb size file for 22 minutes flight so ~ 1.9 Mb per Minutes

* 33598 log: 2.57 Mb size file for 6 minutes so ~ 0.42 Mb per Minutes

It's quite huge saving on the log size, even though Pixhawk equipped with external memory card and doesn't matter much for several Mb log files.

The complete log data from Nearly All setting give me more "peace in mind" that I have the data to be analyzed in case of weird situation occur.

Thanks Jeremy.

Reuben, I received your cable and finally had time to test it. I'm not having any luck getting it to trigger the camera. I have it attached to AUX 5 and a turnigy 5v bec attached to AUX 6 (see photo). My configuration settings in Mission Planner for testing are:

CAM_DURATION = 1

CAM-TRIG-DIST = 1

CAM-TRIG-TYPE = 1

RELAY_PIN = 54

I tested the camera with my APM 2.6 and a cable I made for it to make sure it wasn't a camera setting. It worked fine on the APM.

@Bill: which camera?

Reuben, i tried again your circuit with 220K resistor and BC547, here it doesn't work with A5000, but mine with the "5V" line work fine (but hang the camera when it doesn't shoot, a little bit bored).
Please can you share the changes you've made to your new circuit for Sony S2 multiport?

Canon PowerShot A2300

I've got a couple others I'll check them too.

I'm using ArdCopter V3.2.1

I tried my Canon PowerShot A590 and S95. Neither worked with Pixhawk. They both work with the APM. Same settings.

Have you tried marco or ruben's circuit as discussed above? I'm using a2300 as well with marco's circuit on pixhawk, it works pretty well.

I'm using a cable that Reuben made and mailed to me. See my initial post on page 21.

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service