I’ve gotten myself an IRIS+ quadcopter and it is awesome!
It also offers limitless possibilities for creating add-ons – both software and hardware-based.
My first project is a 1W LED front light in order to help with orientation (and look cool).
The light will be mounted to the IRIS+’s front GoPro mount with a 3D printed mount. I’ll print the prototype myself and then order it on Shapeways as a higher quality SLS printed version (here it is).
Power will be supplied from the flight battery through a ZXLD1350 switching regulator-based circuit I designed a while back for another project.
Since the LED driver supports turning output on/off I though I could control the LED from one of the Pixhawk’s relay pins.
Small issue though: the ADJ pin on the ZXLD1350 interprets a voltage of 0 as off (which is fine) and 1.25 V as 100% on. Which is not entirely fine since the relay pins on the Pixhawk toggle between 0 and 3.3 V. So I’ll use a standard NPN transistor so the ADJ pin will toggle between 0 V and floating which will use the internal resistor as pull-up. The schematic looks like this:
And it works like this:
|Pixhawk relay||Pin voltage||ZXLD1350 ADJ pin voltage||result|
|on||3.3 V||0 V||LED off|
|off||0 V||internally pulled up to 1.25 V||LED on|
In other words, relay off means LED on and vice versa.
The transistor is a bog standard BC547 NPN. And since I can’t be bothered to modify the PCB for the LED driver and send off for fabrication and so on, I’ll just solder it on, glue it to the back of the PCB and shrinkwrap the entire mess. Not perfect, but good enough for jazz.
The control pin is attached to the Pixhawk’s AUX OUT 5 signal pin (physical pin no. 54) and power and ground is spliced into the power lead going to the gimbal.
Since the PCB is open to the environment on the backside of the mount and since the pins for VIN and GND are attached directly to the flight battery and are only 0.1" from each other, the entire PCB will be potted using either just hot glue or proper potting compound (e.g. QSil–216) so the battery will not get shorted by a stray drop of water.
In Config/tuning -> Standard parameters, the
First Relay Pin (RELAY_PIN) is set to
Pixhawk FMU AUX5 (this is default).
On the Extended Tuning page,
Ch8 Opt is set to
(If this option is not available, go to Full Parameter List and set
CH8_OPT to "28" for "Relay On/Off" (on APM:Copter 3.3.3; the value might be different on other versions))
This will allow the light to be turned on/off by toggling relay 0 in auto missions (
DO_SET_RELAY) and toggling channel 8 from the transmitter.
Since channel 8 is currently unassigned, I’ll use that to control the relay. I’m using a Taranis TX so setup is as easy as can be:
CH8 MAX Weight(-100%) Switch (!SG↑) R MAX Weight(+100%) Switch (SG↑)
In other words: for channel 8, set value to –100% when switch G is not in the up position. And set value to +100% when switch G is in the up position.
Remember that due to the transistor, relay on means LED off, so a channel 8 value of –100% will turn the LED on. So if switch G is in the up position, the LED is off; otherwise it is on.
For another project (that I have shamefully neglected to write about) I decided I needed to put it into some kind of enclosure. And I since I couldn't find any off-the-shelf enclosures that fit I decided to make my own.
A little bit of googling let me to Shapeways that lets you create 3D printed models from your own 3D files in several different materials.
The models themselves can be created in pretty much any 3D modeling application (including the free SketchUp or Blender). I used Luxology's modo.
Obviously, exact dimensions are important. So I got PCB dimensions and coordinates from Eagle and used a caliper to measure the size of the battery and plugs and so on. And I created dummy objects for the battery and the PCB to make sure that everything fit. This is what I came up with:
The stand-offs have 4.1 mm holes for threaded inserts to use with M3 machine screws (like these ones from RS).
And here with the dummy objects visible:
I exported the object to Wavefront OBJ format and uploaded it to Shapeways (I needed to rotate 90 degrees about the X-axis first in order for the preview image to render correctly on Shapeways) and specified the units as meters (since that's what modo uses by default).
The price came to €20.14 plus shipping (€8.38 for UPS shipping) for "white, strong, flexible" material. So now it's just wait and see how it turns out.
Bear in mind, that this is my first attempt at making a 3D printed object. I haven't even smoothed the edges or added support ribs or anything. Not to mention that I have only made the bottom part of the enclosure (it does however have a "lip" for mating with the top half).
For a much nicer custom enclosure, take a look at this one (also on Shapeways).