Turret Syndrome – Week 2


“Individual sparks ignite the brightest flames in our collective fire of success.”

– Someone

Hello the blogz! 🖱️⚡❤️

Boy oh boy… What a week!🤯 Following our first project week, which was primarily marked by collective efforts, we have this week been working more on a disciplinary and individual level. This change is based on a deeper, comprehensive understanding of the system and a better allocation of tasks within the team. As a result, our future blog posts will be more divided into individual updates and contributions.

MATS BERGUM

I have also looked at different solutions for our firing mechanism, leaning towards using a pull/push solenoid and a relay for easy control from the Raspberry Pi. An example of a linear solenoid can be found at  https://no.rs-online.com/web/p/linear-solenoids/1770139?gb=b

I’ve also spent some time learning OrCAD. More specifically, capture CIS, Pspice and PCB editor. To be able to make Harald’s circuit into a PCB. I have made a goal to be able to make and simulate the circuit in OrCAD by the end of the week. Pictures of this will be added in the next Blog.

HARALD BERZINIS

I have been looking through how stepper motors work when using a motor controller, and whjich type of signalts it takes. The motor controller takes 5V for input signals while the Raspberry Pi 4 sends 3.3V our of its GPIO pins. I have then made a circuit which amplifies the 3.3V to 5V in order to fit the motor controllers 5V input requirement. The circuit takes 12V and then converts it to the desired voltages.

Circuit drawn in LTSpice:

Simulation done in LTSpice:

After making the circuit I made SDM Components list for Mats in order for us to print this circuit into a PCB:

Voltage regulator:

LM317D2TR4G

https://octopart.com/lm317d2tr4g-onsemi-530496?r=sp

Resistors:

10k ohm x 6 stykk:

CRCW120610K0FKEA

https://octopart.com/crcw120610k0fkea-vishay-39556170?r=sp

100k ohm x 6 stykk:

CRCW0603100KFKEAHP

https://octopart.com/crcw0603100kfkeahp-vishay-42634004?r=sp

220 ohm x 6 stykk:

CRCW0805220RFKEAHP

https://octopart.com/crcw0805220rfkeahp-vishay-42634722?r=sp

1M ohm x 6 stykk:

CRCW12061M00FKEA

https://octopart.com/crcw12061m00fkea-vishay-39437940?r=sp

1k ohm x 7 stykk:

CRCW12061K00FKEAHP

https://octopart.com/crcw12061k00fkeahp-vishay-42635114?r=sp

330 ohm x 1 stykk:

CRCW1206330RFKEAHP

https://octopart.com/crcw1206330rfkeahp-vishay-42635212?r=sp

Capacitors

0.1uF kondensator x 1 stykk

C0603C104K4RACTU

https://octopart.com/c0603c104k4ractu-kemet-93067?r=sp

Zener diode

Zener diode 7.5V Zener Voltage x 1 stykk

TZMC13-GS08

https://octopart.com/tzmc13-gs08-vishay-55388684?r=sp

Transistors

NPN bipolar transistor x 6 stykk

MMBT3904,215

https://octopart.com/mmbt3904%2C215-nexperia-78736188?r=sp

PMOS x 6 stykk

BS250FTA

https://octopart.com/bs250fta-diodes+inc.-335761?r=sp

  • I have also made the circuit on a breadboard with the help of Mats, but I’m unable to test it due to not having PMOS, so it needs to be ordered. 
  • I have also helped Hannes to find the correct gear ratio for the turret in order for it to have a 2cm accuracy for each step when the target is 5m away.

Next week:

  • Try to figure out a code for the Raspberry PI4 which takes the data collected by the camera and regulates the motors to the desired positions. Will also try to implement a thumbstick function in order to test and verify the PID controller.

CHRISTOPHER DAFFINRUD

System ABC-Requirements

To achieve a broad and clear understanding of our system between every group member, my main task on Monday was to refine our ABC-requirements for our system. These are divided between A = Critical system requirements, B = Beneficial System Requirements and C = Desirable System Requirements.

ABC-requirements for system

Black-box diagrams with inputs/outputs for major system functions

Since our workloads is divided between individuals and disciplinary teams in our group, I created some simple black-box diagrams mapping out necessary inputs and outputs for major system functionality. This to make it easier to start implementing and testing some software functions that will work interfacing electrical or mechanical components at a later stage:

Inputs and outputs for major system functionality

I have also spent the week researching OpenCV, HAAR Cascade and YOLO for Python together with Ole for color and object recognition. Ole will elaborate further regarding this.

Future work:

For next week I will collaborate with Ole to research, find or if necessary make a dataset for training the YOLO model and object recognition.

OLE EIRIK SOLBERG SELJORDSLIA

Sphinx documentation

We wanted to use a tool to automatically document our code based on comments present in our codebase. Some of us were already familiar with Doxygen for generating documentation for C++ code. However, since our plan was to write most of our code in Python, we needed to investigate Doxygen’s support for python. After a bit of research we stumbled upon Sphinx , which seemed to be the de facto standard for generating Python documentation. Although this tool needs some getting used to, it seems to be the right tool going forward. 

Azure pipeline

With Azure as our devops tool, I wanted to investigate the possibility of hosting our generated code documentation automatically. So, I set up a pipeline that processes our entire codebase and generates documentation using Sphinx. However, I encountered a snag; Microsoft’s student license does not include hosting for static websites, or at least I couldn’t find a way to do it. So for now; we will have to host the documentation on our own machines. 

OpenCV

The goal of our system is to be able to shoot balloons of a specific color. To achieve this, we must be able to differentiate between different colors. After some research, we discovered that OpenCV was one of the most widely used tools for image processing. Thus, we began exploring the capabilities of OpenCV. I ended up creating a “proof of concept” code that dynamically filters out pixels based on HSV values (Hue, Saturation, Value)

Hue, Saturation and Value model

[http://www.ece.northwestern.edu/local-apps/matlabhelp/toolbox/images/color11.html]

After some testing and tinkering, we could confidently filter a live image stream to isolate red cola cans:

Red cola can separated from every other color in image

YOLO

To shoot balloons effectively, it’s not enough to merely look for colors; we must also identify what is a balloon and what isn’t. Knowing this, we can use the information to aim at the balloon. The position of a balloon can be utilized in a control loop with azimuth and pitch motors to achieve accurate targeting.

We explored Haar-cascade with OpenCV and YOLO(You Only Look Once) for object detection. After some testing, we were thoroughly impressed with the efficiency of YOLO. This is a crucial factor since we intend to deploy the system on a Raspberry Pi.

YOLO vs Haar Cascade

Object recognition with YOLO-model from Camera Input

Moving forward

Moving forward, we need to find a dataset containing images of balloons so that we can train the YOLO model to identify balloons. We must also familiarize ourselves with the format that the model expects for training and so that we can preprocess the dataset accordingly to match the model’s requirements.

HANNES WEIGEL

This week I acquired a paintball marker which is to be used with the turret. Said marker needed some maintenance, which resulted in disassembling the marker, identifying the o-rings, and acquiring new o-rings.

Additionally, the High-pressure tanks needed to be refilled and pressure tested. 

Azimuth rotation

I started the design of the azimuth rotation apparatus. A challenge we’re facing are the Nema 23HS9430B Stepper motors who only have a resolution of 1.8 degrees per step.

This means that in a 1:1 gear ratio scenario we would have a 15.7cm travel between each step. Therefore the azimuth drive would need to feature a gearing system of sorts.

Harald and I evaluated the needed precision at 5m to be approximately 2 cm of travel per step. This would result in a 1:7.85 gear ratio. 

Given this gear ratio I started researching and drafting some initial solutions:

The first suitable solution was a planetary gearing system. Here the planetary gears (blue) would have a 1:7.85 ratio to the ring gear (orange). In this draft, the planetary gears would be driven by one Nema 23HS9430B Stepper motor each.


Some challenges we would face with this solution:

  • The modus of the gear teeth would have to be big enough so that the teeth would not shear off
  • The modus of the gear teeth could not be too big, otherwise the ring gear would become enormous.

A design with two planetary gears would have an additional challenge, worsened by the bad tolerances of our productions methods.

Therefore the current draft features three planetary gears, where two are driven by the Nema motors, and the last is a dummy gear. 

Pitch rotation

To pitch the paintball marker, we would need a system that could move the relatively bulky and heavy equipment precisely. As with the azimuth rotation; The resolution of the Nema stepper motor is 1.8 degrees per step. This would again at 5 meters give us a 15.7cm travel per step.

The initial draft features trapezoidal threaded rods which would be driven by the stepper motor and move a carriage up or down the rod.

Thereby the pitch stepper motor could rotate in the plane of the azimuth motor and pitch the paintball marker up and down. 

A close-up of a screw and a bolt

Work for the next week

We have to evaluate using a compounded planetary gear system where we have 2 or 3 stages of gearing with different modus.

We have to research materials suited for manufacturing the gears.

We have to find the correct thread-count and pitch of the trapezoidal rod and carriage. 


Leave a Reply