% Kanske bör sägas något om varför vi valde att bygga en egen kopter till att börja med? //Lars
% Kom ihåg SI kommandot \SI{1}{\kilogram} t.ex.
Since we decided to base our quadrocopter around the open source flight controller Flip32 because of the ability to customize
your configuration and multiple ways of communicating with the flight controller, this also meant we had to build the copter
When starting to assemble a copter we first started by choosing a suitable frame to fit the equipment.
A 65cm square frame was chosen to get space for the sensors between the rotors.
Next step was to choose motors and propellers to get enough lift for our payload at a comfortable throttle setting.
The NTM propdrive 28-30S motor with a TGS 12x6 propellers and a 4S Li-Po battery would suit our needs.
% Ekvationsreferens som flytande text. //Lars
This would give us enough lift for 3kg of payload at full throttle see equation(\ref{mcopter}-\ref{payload}), which means we should be able to fly with \SI{1}{\kilogram} payload at a reasonable throttle setting.
ESC's where chosen to handle the battery voltage and amperage of the motors, Afro 30A fit these requirements and also runs th open source software SimonK which allows a lot of settings.
The last step was to choose battery size and discharge rating to handle flight time and current delivery.
We wanted to at least five minutes of flight time so we chose a Zippy 8000mAh 30C battery which would give us around six minutes of flight at full throttle (eq.\ref{flighttime}) and more than enough current delivery.
Flight\ time = \frac{Battery\ capacity}{Max\ amp} =
\frac{8000mAh}{80A}\approx 6\ minutes
\label{flighttime}
\end{equation}
\subsection{Circuit boards}
We decided to make a shield to distribute all connectors from the Nucleo board base.
The reason we decided to make a shield was that we still wanted to use the Ethernet port on the Nucleo and since we lack any real analogue components keeping the short traces to reduce disturbances was not a priority.
The shield board contains connectors to all our peripherals except the LIDAR, because the LIDAR uses Ethernet communication which is already integrated on the Nucleo board.
We used a dip socket for the IMU because of the convenience when setting up the chip with our breakout board and then just moving the chip.
% Frågande utifall man ska skriva 3V och 5V eller om måste hålla sig till rule of 12?
We decided to use a switching regulator to make a five volt rail for peripherals, because of efficiency when stepping down from 15 volts.
A three volt rail for logic level was needed so a linear regulator from five volt was suitable there.
All power rails and 15 volt peripherals were handled on a separate board to avoid disturbance.
% Finns en bild på pwrboard i eagle, men inte på shielden? Ska man ha bägge, eller ingen? Kanske har en tanke bakom detta?
% Bilder på bägge kontakterna hade nog varit nice, isåfall i en subplot.
When wiring everything up on the copter we used xt60 connectors to distribute power from the battery to ESCs and power board because of their high current capability and keyed design.
The connectors we used on the shield and power board were "Molex LLC" which have stable locking connection that can only be plugged in one way.
The only complicated part of the wiring was when connecting the laser scanner, because we wanted to rotate the laser to get 3D images we had to route wires though the motor.
To do this we need to use a slip-ring to avoid twisting the cables see Figure~\ref{fig:slipring}.
% Vet man vad en slip-ring är? kanske måste ha bild här också? eller förklara lite mer.
A hollow shaft stepper motor was used to be able to route wires through the motor.
\caption{Slipring for rotating connection without twisting wires}
\label{fig:slipring}
\end{figure}
\subsection{Cases and mounts}
When designing mounts we started with the ultrasonic sensors, we wanted the sonar arms and cases to double as bumpers so if we hit something like a wall these would hit the wall instead of the propellers.
This was achieved by simply extending the motor mount arms so that the sonar case would protrude beyond the propellers, see Figure~\ref{fig:sonararm}.
The 3D model of the case for the sonar we got from "thingiverse.com" see Figure~\ref{fig:sonarcase} since it's a commonly used sensor it was easy to find,
When designing the tower that would hold our stepper motor and LIDAR we decided to include a mount for our MCU on the side, see Figure~\ref{fig:steppermcu}