Thursday, December 13, 2012

MIOS: Multi-Copter I/O Shield for the Arduino Due

  As I previewed in my last post,  I am making an shield to fit the Arduino Due that will simplify connecting the RC reciever, motor ESC, and I/O for sensor communication.  The PCB's for the shield came this week and below are pictures and some explanations.


  Above is the board layout in Eagle before sending it to the fab house.  I used a board fab service called OSH Park.  This service combines many small PCB orders into a large order to spread the cost out between all of the participants.



  Above is the board render I received back from OSH Park after they accepted my design.



  Here is a picture of the board by itself.  The Picture came out a bit blurry, but the actual board is very clean and sharp.  The silk masks are very clean and the gold plating on the solder pads/holes is pretty.  Dark Purple is the only color option from OSH Park, but that seemed like an good alternative to the traditional pea green pcb I could have received from another board service.  I spent a bunch of time with the continuity tester on my DMM making sure everything was routed correctly and there were no shorts or miss directed paths.  Everything checked out as good.



  Here I am test fitting the board to make sure all of the headers will fit in the correct holes when placed on top of an Due.  It's a little hard to see the header pins in the picture since they match the color of the gold plating.  I am happy to see everything fit perfectly.



  All of the header pins are soldered in now including the SPI header in the middle of the board.



  The servo and receiver headers are now soldered in place.




  The voltage divider resistors are in place and soldered.  Since the Due is only compatible with 3.3v signals, I have to reduce the 5v signal that comes from the receiver.  I tested them by applying 5v to each one end then measuring the voltage at the mid point.  All of them were very close to 3.3v.


  Here is a view of the underside of the board with all of the connectors soldered in place.  After taking this picture, I washed the board to remove the solder flux.  This significantly reduced the smudged and dirty appearance near where I soldered.



  Placed onto the Due.  Everything still fits nicely.



  Another angle.

  My next steps will be soldering on pig tails with connectors for attaching sensors.  The I/O holes are spaced correctly for 0.1" connectors, but I am using pig tails on this board so I can attach and detach sensors even when the unit is installed in a tight air frame.

  That is all for now.  Let me know if you have any questions.

  Thanks for reading and please sign up on the right if you want to be automatically notified when I post more updates.

~Phillip

<< Previous Quadrotor Post | Next Quadrotor Post >>

Saturday, November 17, 2012

More Fun

  It's been a while since I posted last, so here's a quick one for me to tell about where my quadcopter is and introduce my next project.

  My current quadcopter is flying well.  It has proved quite durable as I started at zero with 'copter flying experience and this one has shrugged off most of my silly mistakes.  I have a lot to learn, but it has been a great learning tool so far.

  Now on to my next adventure.  Arduino announced about a month ago that they were coming our with a 32 bit ARM based board called the "Due" that would be roughly code compatible with the 8bit processors.
Arduino Due

  This got me thinking about using one for a multi-copter controller.  This new processor is roughly 20 times faster than the 16Mhz Arduino pro mini that I am currently using.  This is wild over-kill as my current program runs at a 400Hz control loop, which is generally considered optimal.  One of the items that killed my inertial position tracking idea was that the processor was not accurate enough when using decimal numbers (32bit float).  The Due supports decimal numbers that use twice as many bits (64 bit double).  This doesn't give me an number that is twice as accurate, but one that is ~50 million times more accurate.  This means it may be possible to on the Due to perform 50 million operations before you have the magnitude of  error of doing one operation on my old processor.  That is over simplifying it a bit, but the point is that the reduction in error is huge.  The other factor that killed inertial position tracking was the low accuracy of the sensors.  Nothing has changed on that front, so I won't be putting a huge amount of time into trying to resuscitate IPT.  That wont stop me from developing a platform that might be able to take advantage of better sensors as they come out.
  One of the pains I had when using my old processor was that it ran on 5v and its I/O ran on 5v.  This was awkward as all of the modern sensors are designed to run on 3.3v.  Adapting between the two voltages is not too hard, but it was inconvenient.  The new Due is natively a 3.3v processor so no conversion will be required.
  After thinking about the Due and how I could use it for multi-copters, it occurred to me that using one right out of the box would generate an ugly wire nest when routing all of the connections.  I looked around to see if there was a shield that could be attached to the Due to reduce that mess, but nothing really had what I wanted.  I wanted all of the major I/O busses exposed with adjacent power and ground so all of the wires needed for a sensor could all be pulled from the same spot on the board.  I wanted to be able to plug in all of my R/C receiver channels and motor ESC's into 3 pin headers.  So I decided to design my own shield.  The first version of the shield is complete and being made by a board fab service.  I should have it in my hands in a week and a half.  I have called it the Due MIOS (Multi-copter I/O Shield)  Below is a picture.

My Arduino Due multi-copter I/O shield 
  All of the Due's pins have solder terminals brought in from the edges in case I need to attach a wire to them.  I am not a fan of mounting the sensors directly to a shield, so that is why it only breaks out the I/O busses.  This way I have the flexibility to mount the sensors where I think they make sense in the frame while placing the Due in an convenient location.  This also makes this board's usage very flexible as it could be used for almost any type of robotic control or data collection application.  Servos could be attached to the motor locations and then be used to control anything.  The resistors that are located next to the R/C input area are used to divide the incoming signal and convert it from 5v to 3.3v (this will prevent the receiver from damaging the inputs in the Due by providing too strong of a signal.)
  I have plans to improve this shield.  I want to go to surface mount resistors (I already have the regular wire resistors, so that is why this version has through holes.)  I want to add LED lights that can used to indicate the machine's status (calibrating, standby, armed, etc...).  I want the MIOS to power the Due in the future, as currently it is not hooked up that way because the official page for the Due notes that it could be damaged when powering it through the 5v pins.  I will look into it more closely and see if there is an easy alternative.  In any case, the motor ESC's are used to power the R/C receiver.

  In addition to the Shield, I've been contemplating building a multi-rotor for doing camera work or first person video flying.  I have sketched up an initial design to allow me to think about how I would go about it. Since I can machine all of the components myself, making it would be relatively cheap for me.  Besides, I enjoy designing, building and programming... maybe even more than flying.  Below is an very early version of my design.

My early hex-copter design

  I am debating between sticking with four motors or going to six like is show in the above picture.  I am also contemplating giving the motors a small amount of "up-angle" to increase the natural stability of the copter.  This copter will have much longer legs to provide room for hanging stuff under the frame.  The green disks represent the area covered by a ten inch (250mm) propellor, which is the largest I would consider for this frame.  I think 8in or 9in (200mm or 225mm) will be more realistic.

  That is all for now.  Let me know if you have any questions.

  Thanks for reading and please sign up on the right if you want to be automatically notified when I post more updates.

~Phillip

Tuesday, June 26, 2012

Quadcopter Build Status

  In this post I will be covering the final assembly of the quadcopter frame and the mounting of the electronics.
Picture 1 - Wiring
  In picture 1 you can see that most of the wiring is connected.  I have soldered 3mm plugs to the ESC and motor leads and covered them in shrink wrap.  I have soldered the ESC power leads into the yellow XT-60 battery plug and covered it in shrink wrap.  I still need to attach three of the four ESC signal wires to the Arduino, and I still need to attach three more 3-pin connectors for getting the receiver signals to the Arduino.  Everything needs to be mount and or tied down.  Nylon nuts on the nylon screws are holding the arms to the lower plate.  This keeps the arms from falling apart when I have the top plate off and gives me slightly more height room for the wiring and components.

Picture 2 - Components mounted
  In picture 2 I have everything mounted to the lower plate.  The four ESCs have been zip tied.  The Arduino is attached with double sided foam tape and a zip tie.  The pins of the FTDI port point out so I can program it without removing the top plate.  The square sensor board with the gyro and accelerometer is attached with double sided foam tape.  The battery connector is held on with a zip tie and a small block was placed under the wires to help keep the connector from tilting too much due to the force from the tie.  Two of the ECS have the power part of their signal wire attached to diodes that then connect to the Arduino and receiver.  If the BEC part of one ESC dies, then the second one will back it up.  The white signal wires from the ESC are all connected to the left side of the Arduino.  The white wires that bring the signal from the receiver (not shown) connect to the right side of the Arduino.  The extra wires from the ESC are zip tied in the center to keep them from bouncing around and hitting the sensor or getting into some other form of trouble.  The nuts on top of the arms allow me to to pass wires over the arms and helps to solve some of the wire routing problems I might have had otherwise.  I will not win any beauty contests with this layout, but it should be durable and functional.

Picture 3
  In picture 3 I have used nylon nuts to attach the top plate.  The R/C receiver and battery are attached with a high durability and high strength version of velcro.  I may use a rubber band over the battery to insure that it stays on, but it currently seems to be very well attached without it.  I decided to place the battery on top as I intend to play around with mounting a small camera under the body for my own entertainment.  The battery also reduces the pendulum effect of having too much weight too far below the height of the propellers.  This should make it easier for the control system to keep the aircraft stable.

Picture 4
  In the low angle shot shown in picture 4,  You can easily see the XT-60 battery connector.  I may eventually mount this connector on a short pig-tail to allow it to reach the top surface.  This would allow me to rotate the battery 180 degrees and prevent the battery wires from looping quite as far out in front of the aircraft.  Not a huge issue right now.

Picture 5
  Picture 5 shows the quad with propellers attached.  These are 8x4.5" (200x125mm) slow flyer propellers I bought in matched counter rotating sets online.  So far they seem like they should work quite well.  The air frame is designed to allow for up to 9" (225mm) propellers before they start to extend over the body.

Picture 6
  Picture 6 is taken from the side of the quad opposite the battery connector.  I am using an 6 channel Orange receiver from Hobby King.  I seems to work great and it's hard to beat the price.  Below the receiver you can see the FTDI port pins from the Arduino peeking out.  In this position it is very easy for me to connect to and re-program the Arduino.


  The distance between opposite motors is 16.25" (410mm) center-to-center.  The distance between adjacent motors is 11.5" (290mm) center-to-center.  So when flying forward this quad would fit through an opening slightly less than 20" (500mm) wide.   The final aircraft ready-to-fly weighs 20oz (570g).  This is a little heavier than I was planning, but nothing to get excited about.  Preliminary testing indicates that at 100% throttle it generates about 60oz (1700g) of thrust.  With a 3:1 power to weight ratio, I anticipate that it should fly well.  Even with a light camera hanging below it it should be stable although it will probably start feeling a bit sluggish.  I will probably be attaching a set of helicopter training gear to the bottom to help cushion my inevitable mistakes as I learn to fly this thing ( I have never flown a quad before ).

  In the next post I will be talking about stability testing and tuning.


   That is all for now.  Let me know if you have any questions.

  Thanks for reading and please sign up on the right if you want to be automatically notified when I post more updates.

~Phillip

<< Previous Quadrotor Post | Next Quadrotor Post >>