torsdag den 27. august 2015

DJI s900 with 3DR Pixhawk - wiring main components

Hey there!

It is time to perform the next steps in the build of a DJI s900 Spreading Wings hexacopter with a 3DR Pixhawk as flight controller.
First there were some hints for building up the frame itself. Second I showed you all my solution for mounting the Pixhawk with vibration dampening. In this part of my build log I want to show you what else I have mounted to my new hexacopter and how I wired it all up.

Here is an overview of the components I added to my setup prior to the first flight:


Quite a bit of equipment and for sure not everything teh copter will have to carry in the future.

Let us start with the first part I added to the setup: 180A AttoPilot current and voltage sensor.
Why do I use this part instead of the 3DR Power Module that is already shipped with the Pixhawk? There are two advantages (or better two compelling reasons) and one disadvantage in using an AttoPilot. The disadvantage in using AttopPilot instead of the Power Module is that you don't have the integrated BEC of the PM (Power Module) for directly supplying the Pixhawk. That is also the reason why there are two dedicated BECs in the list above. But more on that later. The two compelling reasons why I have to use the AttoPilot are:
  1. I am using 6S Lipos as battery for the copter and the 3DR PM is not able to handle the high voltage.
  2. The s900 can theoretically draw 6 times 40A of current in peak (6 ESCs with 40A rating). That summs up to a wopping 240 Amps at 25V  (resulting in theorectical 6 KiloWatt max power comsumption! Thats like running 3 hairdryers in full power in parallel. Some really massive power) 
So in the end the 3DR power module would be fried two times with overvoltage and overcurrent (can only handle 60A with a Pixhawk).

The AttoPilot needs to be mounted in the current path of the battery to the power distribution of the s900 (built into the lower plate of the main frame assembly). A description for soldering the board to the battery cables is already on the wiki of Arducopter. The result of this work looks like the following at my copter:


As the AttoPilot sensor range has no built in BEC there comes the first BEC into the setup to combine both at the Pixhawk's PowerModule connector.
There are several information pages on the web were you can gather the wiring information, but for simplicity here is a complete wiring diagram with pinouts:



For this schematic I used the wrong BEC picture. Instead of the shown Hobbywing I used the BECBoy, because 3A is more than enough and 5A of the Hobbywing are better used for servos and so on on the Pixhwak's backward connectors rail.
So I hope this rough schematic makes it a bit easier to setup the battery sensing and the first part of a redundant power supply for the Pixhawk.
Speaking of redundat power supply for the Pixhawk lets have a look at the second BEC out of the above component list. The second BEC is connected in parallel to the same upper XT60 power port of the s900 lower center plate as the first (XT60 in center of picture).


The difference is that the "Hobbywing" BEC (forground of upper picture) is not connected to the Pixhawk's power module connector. Instead it is plugged to the input/output-connectors at the backside of the Pixhawk case (the one for connecting the ESCs of s900 frame). Pixhawk is intelligent enough to include an automatic internal failover when one of the power supplying BECs is failing. Impressive feature in my opinion!
Some more pictures for documentation of BEC mounting:



To finalize the redundant power setup of the copter there is an additional safety feature adviced by 3DR. They say there is a Zener diode required when you power the Pixhawk via the ESC/Servo-Rail. I added another personal touch to the Zener diode. A 1 Microfarad "elko" (tantalum capacitor) and a 22 Picofarad ceramic capacitor in parallel to the diode. The reasons are:
  1. 1 uF Elko: buffering some current for bridging massive power consumptions on the ESC/Servo-connectors
  2. 22 pF ceramic: filtering high frequency noise introduced by bad EMC of connected components. 
The schematic for my "protection, filtering and buffering"-plug is as follows:

The resulting, with heat shrinking tube covered and into a servo plug built, circuit looks like follows:


Output 1 to 6 are s900's ESCs; output 7 is occupied by Zener-Circuit; output 8 is used for 5A 5V Hobbywing BEC power connector.

So with the power circuitry finished, there is still the RC-receiver and the GPS left. The FRSKY X8R is mounted with "doubled sided sticky silicone tape" and some cable ties in upward position to the frame.

-----   Interjection  -----
I really really really love this sticky silicone tape. Have discovered it at the shop when buying the BECBoy supply. You should definetly try that stuff. Best double sided sticky tape for RC I have used. And silicone dampening! Definetly recommending!
-----   Interjection  -----

The two antennas are mounted in a 90 degree angle to the bottom of one carbon fiber tube and one of the aluminium plates of the frame. I know it is not the best decision to mount antennas to conduting (and so shielding) parts, but they are facng downwards and are only shielded in direction of the open sky were no signal is coming from. So I think it is going to be OK.




The 90 degree antenna mounting is for better signal reception and highly recommendet. And as my transmitter antenna als always in a horizontal position, both receiver antennas should also be in a (mostly) horizontal position.
Additionally you can see the Pixhawk safety switch on the last upper picture. I'm not really satisfied with the ziptied switch, but for now it will do. Couldn't drill such a big hole into integrity vital parts of the carbon fiber plates. If someone has a nice solution I'm thankful for hints.

The last component from my list is the GPS. I ordered a dedicated, additional mast from the great bay for mounting, because I do not like the DJI system. The DJI solution has to be glued together (what a nasty solution for a copter like this). And DJI also only includes the bottom folding part of the mount in the delivery. The mast and top mount are missing. So here is a picture of my mount:


Not perfect yet (mounting screws too long), but also OK. And if I have to buy additional parts for GPS I buy and mount the stuff I like. Last hint for GPS: I used countersunk screws and also countersunk my drill holes. So the screws nearly vanish in the top middle carbon plate and there is enough room left for Pixhawk and Pixhawk's top connectors. 

One last thing for wiring which is not on my upper list:
The order for connecting the six ESCs to the Pixhawk's outputs is as follows:


Pixhawk Motor-Out
S900 ESC
1
M6
2
M3
3
M2
4
M5
5
M1
6
M4

I used 4 servo connector wires already delivered with the s900 and adapted the signal wire order. I also adapted the order of the ground wires according to the above list. Not neccessary because all grounds are the same at Pixhawk side. Was in the mood for it :)
The resulting wires look like this:




My final comment on this blog entry:
Maybe you all have noticed that I often use mesh tubing for organizing many of my cables. In fact I always use mesh tubing at my s900 when I have to run two or more singla cables in parallel. This is for a nicer, more professional and organized look. But also for protecting my cables from possible wear out (rubbing). And a professional copter for such a pile of money has deserved that bit of detail.




  

So again we have finished another part of my build log. Hope you all liked it.

Next up will be the basic software setup of the Pixhawk and some words on "special twists" of the flight controller and frame combination. 
Maybe also some words about my initial PID tunings and the maiden flight ;)

Stay tuned and happy flying!

søndag den 23. august 2015

DJI s900 with 3DR PixHawk - Mounting the Pixhawk


So Sebastian here again with the second part of my build log for a DJI s900 with a 3DR Pixhawk as flight controller. In the first part I gave some tips for building the standalone frame of the Spreading Wings multirotor. This time I want to show you all my solution for mounting the flight controller to the frame with added anti vibration silicone mounts.

But before we come to the hard work, I want to answer the question why I chose 3DR components instead of DJI's?
(Of course you can skip the next passages if you don't want to hear religious jibber jabber about different system architectures again and again ;) )
As you may have already found out, DJI is selling some capable and astonishingly expensive flight controllers for this frame. The Wookong series (maybe a little bit outdated?), the Naza flavored controllers (ment for smaller crafts as far as I learned) and last the state of the art, professional A2 flight controllers. I definitely did not want to start with Wookong or Naza controllers for several reasons. The only possible choice from DJI would have been the A2. It seems to be very capable and all the DJI add-on equipment seems very thought through. Cables with already fitted connectors and meassured lengths. Prepared mount locations for everything. Available tuning values for PID stabilization algorithm. And many things more. The only thing you have to do is buy, mount and fly.
Buy a lot. Buy expensive. Buy the golden Apple-style bird cage.
No open documentation about protocols and hardware. No open software for flight controller. DJI in control about where you fly if they want. And so on.
For my taste, I do not appreciate dongled systems. I do not like somebody to tell me what I can or can not do with the stuff I bought from my hard earned money. As mechatronics/electronics engineer I like to know what parts of my systems do things how they do them. How they communicate. How they work. And DJI does simply not offer this kind of information and openness. So not my cup of tea. And definitely not my cup of tea when the flight controller plus GPS is as expensive as the main frame itself. If components were competitively priced to similar parts or even if DJI would be more open minded, I would be tempted to buy DJI. But with all the negative points I was nagging about, 3DR and their (or better ETH Zürich's flight controller), the PixHawk, seems a lot more sexy for a tinkering guy like me.

So let's start discussing about mounting the controller to the frame.

First decision: vibration damping or not?
I don't know if one can get away with plain double sided sticky tape or anything like that for vibration damping with this copter. The propulsion systems are prebalanced in factory, so there should be less vibration from the start on, compared to a complete DIY copter. But with a 1300€ frame ment to carry the same money in camera systems some day, you should not rely on a exhausted factory worker having balanced your frame/motors/props after a 10 hour shift. So additional dampening is a must have. But what dampening system is the one to choose? Well that depends on where you want to mount your controller to.

So the really first decision: where to mount the Pixhawk to the frame?
DJI is mounting their A2 in an upward position with the upper case side facing in forward flight direction to an easy to reach plate at the front left of the frame. Quite special. But there is a second DJI-box called the "IMU". It is responsible for meassureing acceleration and rotation rates. But even this box is not mounted to any point near the center of the frame. Not in the center of gravity nor near the turning axis of roll, pitch or yaw. If it works for DJI then so be it. But in general not the most advisable positions for a Pixhawk, as far as I know. Although I think it would be possible to follow DJI's solution for a mounting position (Pixhawk supports 26 plus mounting directions).
I chose a more common position which also shelters the flight controller a little better. The flat plastic dome mounted on the lower frame plate, which is isolating and housing the power connectors.
Sadly I have no good picture to show you the virgin state of my mounting position, but you can see it in this assembly video from DJI.

Benefits of this mounting position:
  • It is nearly in center of all turning axis. 
  • Nearer to the center of gravity. 
  • In the event of a crash, which will of course never happen, the controller is located at the safest position there is. So you can at least rescue the Pixhawk and the logs to investigate why there was (of course not) a crash.
Disadvantages:
  • not much space above the Pixhawk where a lot of connectors and cables must be (and that gets even worse if you plan vibration damping). 
  • Not very accessible. 
  • Quite some work to fit Pixhawk in there.
So how to mount the Pixhawk in this location?
This question leads us back to "mounting with vibration protection?" discussion. And I think I have made it clear enough that you should never mount a flight controller without at least a little bit of dampening.
So what option to use with Pixhawk and s900 frame? Well if you buy a genuine flight controller from 3DR there are some double sided sticky foam pads included in the package. They are ment to be mounted at the four corners on the bottom of the flight controller. The only problem is: they are way to fat.
Second option: I had bought one of the anti vibration mounts for APM and Pixhawk controllers. The ones with the two carbon fiber plates and four silicone vibration cylinders connecting the plates in the corners (quite similar to these ones). Problem: the mount is also way to high for the limited space within the s900 frame.

 
Third solution: using one of the O-Ring-style or ear-plug vibration mounts. Problem: I don't want to trust some thin silicone rings only secured in a small slot between a screw and some spacing standoffs. Or some plates with ear-plugs. So just some plates with holes and memory foam. Too much money flying around with this specific build.
Fourth solution: after searching the web and looking for some finished product, I came to the conclusion that there is no "ready to use" solution for mounting a pixhawk to a s900. So I thought: "if there is none, just build one".
Mounting the anti vibration mount from option two completly into the frame was no option as already stated. But as it was already bought and available, I wanted to use at least the silicone dampeners and maybe the carbon fiber boards. After some thinking and even asking my wife for ideas, I settled for a mix of solutions from my (our) brain storming sessions:


This design offers some advantages in my opinion:
  • dampening via the silicone cyclinders
  • very flat setup because pixhawk is sitting low between the dampeners (height is even adjustable via washers/screws)
  • Steal screws, washers and nuts give a bit more mass for better dampening (what does a mechanical engineer do if there are too many vibrations? -> Adding more mass)
I started the construction of the mount with "machining" the small carbon fiber arms connecting the silicone dampeners with steal screws. For this I repurpesed the upper (smaller) plate of the not usable APM mount. I cut off the edge arms of the smaller plate and grinded them to the same shape with my Proxxon drill tool. It turned out that it was a good idea to fasten two of the cut mounting pieces with a 3mm screw and a nut together for grinding. So at the end you get two identical shaped pieces for the front and two identical pieces for the back of the mount:


Afterwards I drilled some 3mm holes for the connecting screws between mount pieces and bigger CF plate of the former APM mount.
With the mounting arms finished, they could be connected to the bigger, lower CF plate via the screws and washers to form the inner part of the new dampening mount.
Next step was drilling the mounting holes for the silicone dampeners into the s900's dome cover. For this I added some millimeters in direction to the outer rims of the dome so the silicone dampeners have a bit of pretension in all directions. I used a 3,2mm drill from a Proxxon drill set I bought some time ago. But I think a standard 3mm drill will also finish the job.
The silicone dampeneres are a bit tricky to install at the end, but with a small screw driver or flattened tooth pick and a bit of caution you can stuff them in there.

The final result looks like this:



And in the end there is enough space between the Pixhawk and the s900's top carbon fiber plate left for connecting all the cables.


I can't offer any meassurements for the dampening characteristics of the mount, yet. But I will extend the blog post as soon as I have some graphs and results from flying.

Please be aware I have mounted the Pixhawk facing in backwards direction so the outputs for ESCs and servos are facing in forward direction of the frame. With this it is much more easier to connect the ESCs (6 servo cables) and you can use the servo cables already delivered with the s900 package. These are very decent quality and very soft.
For mounting the Pixhawk facing backwards you will have to adjust the mounting parameters within the parameters list of the flight controller to 'YAW = 180°' (using Mission Planner or whatever configuration tool you like). The correct parameter setting is:

AHRS_ORIENTATION = '4'

What I also did to improve the charateristics of my Pixhawk regarding the barometer: add some more foam material to the inner housing of the Pixhawk.
When you open the case and unscrew the Pixhawk PCB you will find a small mounting compartment for foam in the lower case. This is directly underneath the barometer chip. With adding an additional chunk of foam prior to mounting the flight controller into the frame you can make sure to block gusts of air from the props reaching the barometer. My additional chunk was about 2cm thick. Normal barometric changes due to rise or fall of the copter during flight should have no trouble reaching the barometer. Even through you now have a much denser packed foam compartment.


A last tip for reducing possible vibrations because of the thin plastic of the s900's dome cover:
The dome is reinforced with some thin support beams on the lower side. But in general it is still a bit weak and wobbly for my taste. So what I did to reduce vibrations furthermore is adding a block of 'moon gel' right in the middle between dome and the cover of the battery terminals at the lower frame plate.

 If somebody does not know 'moon gel' yet: It is a gelly like material with very good vibration dampening properties. It is very soft and originally used by drummers (music band) to dampen high frequencies at their drums. It influences the sound by absorbing harmonics of the drum skins. My moon gel blocks are from a music instrument store around the corner and my pads are called 'Black Mamba Damper Pads'.  Just ask some employee for gelly damper pads for drums. He will most likely know what you are looking for :)






This stuff is also very good for dampening your GoPro or wahtever action camera during flight.

So this is it. My solution for a Pixhawk dampening mount in a DJI s900 SpreadingWings hexacopter.
Hope this may be helpful for you all, even if you try this mount style with another copter, plane or what ever vehicle :)

All the best, Sebastian

mandag den 17. august 2015

DJI s900 with 3DR PixHawk - frame assembly hints

Hi everybody. Sebastian again here on Peter's multicolor blog.
It is time for my next blog entry. This time I want to let you take part in quite big project: building up a DJI spreading wings s900 helicopter for professional usage with a 3DR Pixhawk flight controller.
DJI is delivering no printed documentation with its s900. You have to download it from the web or you can have a look at one of the build videos. I will only give some tips here for the first part of my build log.

First: I was not very sure what has to be in the package prior to delivery. DJI is delivering more parts than you need for assembly. And this is not only true for some spare prop blades. So don't be to curious when you have some screws left over, when the frame is assembled. What was left after my build is:
  • Spare bumpers for motor mounts 
  • Spare pairs of prop blades with plastic washers, regular velcro tape and velcro battery straps

  • Spare battery connectors and rubber rings for landing gear

  • Spare red plastik fasteners for locking motor arms in place 

Second: even when DJI is delivering more than you need, the opposite is also true for things you should have at hand when you start the build. What I did find handy and useful is the following:
  • Loctite (blue one is sufficient)
  • Allan keys in several sizes
So on to the main tips for the assembly:
Assembly is quite straight forward. There is a high degree of preassembly in your delivered box. I.e. the mechanics and servos for the retractable landing gear are already mounted at the center frame plates.
Before you are too enthusiastic when starting the assembly and you directly trying to puzzle your way through sticking the landing gear into the frame's mounts, make sure to slide on the thick black rubber rings onto the main carbon gear beams. I missed that in the first excitement and now my gear has gone through one disassemble and reassemble more of the ones of most owners during the first build day.
For mounting the landing gear to the foldable landing gear mounts, you need to use the screws with the very flat heads. After mounting the gear, you will some screws left over as spare parts (see fotograph)

Also don't forget to add some loctite to all screws you mount to the gear and frame. DJI has prebalanced the propulsion systems to minimize vibrations from the start on, but safety first! And I read about some owners who had to sent their frames back to DJI for recalibration because of massive vibrations.
With the gear mounted to the frame, the next (and last) parts waiting for attention are the motor arms. Arms are numbers from M1 to M6. Starting from M1 with counter clockwise motor rotation and red color as the forward right arm. Next is the second red arm with clockwise prop rotation on the front left. And then following the black ones with alternating motor rotation (ccw, cw, ...) in ccw direction around the frame.
What was very important here at my frame: checking that the upstanding plates between the upper deck and lower you mount the arms to are aligned correctly (see photograph).


There plates are only mounted with one screw and therefore can pivot around their vertical axis. One plate at my frame was slightly out of correct alignment and therefore the thread of the arm mounting screw grabbed in a wrong way into the thread. I might have screwed up one of my threads if I hadn't checked again when the screw was only very hard to drive in.

If you have a bad feeling about something during any build, always double check what you are doing. It's always very upsetting when you damage your expensive equipment because of too hasty decisions or laziness for not a wanting to read some instructions again.
So with the arms mounted correctly, it is time to connect the power and control cables. The connectors for that are located under a flat covering dome on the lower frame plate. This cover is loosened with 4 screws on the bottom of the lower frame plate.


When you have removed the dome cover first, you can connect the power cables of the rotor arms. For that DJI added a special L-shaped tool to tighten the cable lugs into the power mounts. DJI gives the advice to only tighten the screws as far as aligning the edge of the screws to the edge of the mounting brackets. At my frame the clamping force reached with that screw tightness didn't feel very reassuring at some of the power bracktes. With some vibrations always left during regular copter operations, I am not very excited to find out about an easy loosening power connection for two or more of my motors during mid flight. I rather buy a new power bracket or even a new lower frame plate than loosing a complete frame with camera because of a weak power connection (See next picture at the copper brackets. Black screws not in line with edge of brackets).


Second to last step is connecting the esc control cables. That is straight forward as DJI uses poke yoke style (can not only be mounted in correct direction) servo connectors for the ESC  control cables.


Last advise is to double check the fitting of the power cables into the precut holes of the cover dome. There is a chance to damage the silicone isolations of the power cables if you remount the cover and don't double check the power cables fitting. The following picture shows one of the black ground power cables with is exactly positioned WRONG. It would be sqeuzed and pinched if not corrected before retightening the cover dome.


If you have finished mounting the copter's  arms there isn't really much left to do. Mounting the GPS holder (if you use the one delivered from DJI). Mounting the inner part of the upper carbon fibre plate again. And that's it. You have finished the basic build up of your s900 frame.


The next steps like mounting an Atto-Pilot 180A current sensor and building an antivibration mount for the pixhawk flight controller into the s900 will follow in some next posts.

Have fun flying!