wasp09

  • *
  • 5
Hi there,

I want to use the cheap camera fom JJRC H11D or Lidi L6F on a BL quad running librepilot, at least temporarily.  The cameras besides sending in 5.8G can also take a pircture or recprd a video locally in responding to a low signal on the camera control lead.  Hence I'll need an on/off output instead of PWM from the FC.   The duration of the low level pulse would be in the order of tenth of seconds and seconds, long enough to be handled on the TX side.

I'll be using a DSM2 sat connecting to a CC3D, leaving a lot of pins on the main port.   We could code a ATtiny to convert a PWM into an on off or 3 way signal, but if librepilot can do it, we would save the extra piece.     The H11D camera has a two way motor inside, it would be nice to be able to have a 3 level output to drive a MOSFET bridge.  Anyway since we can use a 3 level output for on/off and use 2 on/off outputs to implement an 3 level output, having either one should be good enough. 

Any suggestions or hints would be appreprated.

Thanks.


f5soh

  • *****
  • 4572
    • LibrePilot
You can connect a PWM switch to one output.
http://www.hobbyking.com/hobbyking/store/__46040__Turnigy_Receiver_Controlled_Switch.html

This can be made using a servo pcb for simple On/Off

wasp09

  • *
  • 5
But there's what I tried to avoid.   It shouldn't be too hard to modify the librepiilot code and save the $8 and the weight.  I am surprised that we don't have that piece of code already. 

 I probably would use a servo board in driving the motor of the H11D camera, since we need a transitor or FET bridge anyway and a servo has that bridge.

Thanks.

f5soh

  • *****
  • 4572
    • LibrePilot
You can add the code by yourself to fit your needs.
Fork the repo, code and submit a PR.
https://bitbucket.org/librepilot/librepilot

And finally a Wiki page how to setup software and hardware.

Thanks
« Last Edit: June 06, 2016, 10:17:14 am by f5soh »

wasp09

  • *
  • 5
The functional code should be very simple if I just hack one servo type for my own use.  Someone has implemented a ws2811 LED output.  I'll follow the implementation.  Somehow that LED implementation seems STM32F4 only.  What would my poor little CC3D and CC3D "revo" with 2 extra Sat ports be called in the code/XML? They only have a F103.  We don't need any high precision stuff for a simple on/off output, they should still be good enough. 

Regards.

hwh

  • *
  • 1018
The lack of support for features on the STM32F103 boards has nothing to do with precision, the cc3d is almost out of memory with the existing features. Adding anything but the simplest features to the cc3d makes them run out of memory.

Every "cc3d revo" I've heard of has a STM32F405 processor on it.  If your's has a STM32F103 on it then it isn't a revo, it's just a cc3d.  If it has extra sat ports it's probably what they call a "cc3d evo".

You should refer to the boards with whatever name GCS recognizes them as, the rest are just confusing marketing names.

edit:  If you hack a servo you shouldn't need to change anything in the firmware.
« Last Edit: June 07, 2016, 01:37:31 am by hwh »

wasp09

  • *
  • 5
That one is really called "evo".  Thanks for the correcting me.  The 2 Satellite ports are just Main and Flex ports wired to 3.3V on 3 pin sockets.  It is just an CC3D.

It is sad to hear CC3D is running out of space, same thing happened to my devo 7e.   CC3D is so affordable, the next jump costs several times more.    Just paid double to get a devo 10 for the future.  :(

I have added an OnOff option to the output configuration as enum 5, the GCS works.  Looking at actuator.c which I think I supposed to add something there to create the bin for the FW, I noticed some LED types there.  Wonder if they are still PWM.   

BTW, inside flight/pios/ there are directories for osx, postix and win32.  What are they used for?

Thanks.

hwh

  • *
  • 1018
...It is sad to hear CC3D is running out of space...
The original designers discontinued manufacturing years ago and replaced it with the revo board, only the Chinese cloners still make it.  It's still very popular with people who don't need GPS/Autonomous flight modes.  And as you say, they're really inexpensive.  :)

...actuator.c...I noticed some LED types there.  Wonder if they are still PWM... 
I wasn't aware that was in there.  Looking at it I think it's intended to play tones on a PWM buzzer for arming state and alarms.

...flight/pios/ there are directories for osx, postix and win32.  What are they used for?...
There's a "board" called simposix in /flight/targets/boards that's essentially a software simulation of a board.  It still compiles and runs on Linux, I've heard that it doesn't compile on Windows and OS-X.  It was used to drive flight simulators like FlightGear and X-Plane to test autonomous flight code without crashing or losing real aircraft.  If you search for SITL (Software In The Loop) and HITL (Hardware In The Loop) you'll probably find more about it.  There's an old video showing it https://forum.librepilot.org/index.php?topic=1287.msg12443#msg12443  It still works, I've played around with HITL a few times with X-Plane10.

« Last Edit: June 07, 2016, 07:30:12 pm by hwh »

wasp09

  • *
  • 5
Thanks for the info. 

I'll be on the road for a few days and was busy with deviation stuff last few days.  I am trying to bring my daughter's old netbook with me and clone librepilot onto it so that I can put it together if I have some spare time on the road.

However it fails installing qt in make all_sdk_install with error 3.   That ubuntu distribution does not seem having an uptodate qt either.  :(