# Bebek Bakım Algoritması (0-3 ay)

Tamamen kişisel tecrübe olup, geliştirmeye açıktır. Lütfen düşüncelerinizi paylaşın; eksikleri tamamlayalım 🙂

# Laser Beam Profile: Knife Edge Method Matlab Function for Error Function Fitting

Here is the Matlab function to calculate the beam profile of a Gaussian beam using error function fit.

Fitting function:

Transmission(x-x0) = 0.5(1+erf(sqrt(2).(x-x0)./w))

where x is the position of the knife edge (measured in mm usually), x0 is the beam center, w is the beam waist that we will calculate, erf is the error function.

Here is the Matlab Function:

function [w, x0, fitresult, gof] = knifEdge(x, TransmittedPower)
% knifEdge(x,NormalizedPower)
% Knife edge method: Calculation of beam waist and center of the beam
%
% Input :
% X Input : Knife position (eg. in mm)
% Y Output: Power for each of the x position.
% Output:
% w = beam waist
% x0 = center of the beam
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.

%% Fit: ‘Error Function Fitting’.
NormalizedPower = TransmittedPower./max(TransmittedPower); % Normalizing Power
x = x-min(x);
lincoeff = polyfit(x, NormalizedPower, 1);
a = lincoeff(1);

[xData, yData] = prepareCurveData( x, NormalizedPower );

% Fit Type
if a<0
ft = fittype( ‘0.5*(1-erf(sqrt(2).*(x-x0)./w))’, ‘independent’, ‘x’, ‘dependent’, ‘y’ );
else
ft = fittype( ‘0.5*(1+erf(sqrt(2).*(x-x0)./w))’, ‘independent’, ‘x’, ‘dependent’, ‘y’ );
end
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.StartPoint = [0.913375856139019 0.63235924622541];

% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );

% Plot fit with data.
figure( ‘Name’, ‘Error Function Fitting’ );
h = plot( fitresult, xData, yData );
legend( h, ‘x vs Normalized Power ‘, ‘Error Function Fitting’, ‘Location’, ‘NorthEast’ );
w = fitresult.w;
x0 = fitresult.x0;
% Label axes
xlabel x
ylabel NormalizedPower
grid on

# How to upgrade or downgrade raspberrypi’s kernel? (Servoblaster problem Raspberry Pi2)

Lately, I got some problems with servoblaster and some other softwares because of the kernel version. That is why sometimes it is good idea to have previous kernels rather than very last one. To solve these kind of problems we can downgrade linux kernel.

For those who had problem with servoblaster on raspberrypi2, servoblaster DID work on kernel 4.0.9 ! !!

Here how we downgrade(upgrade) our kernel to a specific kernel with rpi-update.

First, install rpi-update

sudo apt-get install rpi-update

Then, go to the firmware repository of rpi: https://github.com/Hexxeh/rpi-firmware/commits/master

Find your kernel version. I will install 4.09 so here how I do:

Then get the git hash as shown in the following image:

After copying the git hash, type this in the terminal:

sudo rpi-update  46d179597370c5145c7452796acbee0f1ff93392->This is kernel 4.0.9’s git hash you should use the one that you copied.

You should get something like in the following image:

# Writing/Reading Integer 2D Arrays to/from Arduino’s Internal EEPROM – Arduinonun Harici EEPROM una Tamsayi Matris Yazip Okuma

CODE:

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 #include #include int address = 0; int mode[16][6]; int i=0, j=0; int modeEEPROM[16][6]; void setup() { Serial.begin(9600); Serial.println("The 2D Array has been generated in order to write into EEPROM :"); //Set the mode matrix all 0's for(i=0;i<16;i++){ for(j=0;j<6;j++){ mode[i][j]=i+j; }} for(i=0;i<16;i++){ Serial.println(); for(j=0;j<6;j++){ Serial.print(mode[i][j]); Serial.print("\t"); }} for(i=0;i<16;i++){ for(j=0;j<6;j++){ EEPROM.writeInt(address, mode[i][j]); address+=2; }} address=0; for(i=0;i<16;i++){ for(j=0;j<6;j++){ modeEEPROM[i][j]=EEPROM.readInt(address); address+=2; }} Serial.println(); Serial.println("The 2D Array has been read from EEPROM :"); for(i=0;i<16;i++){ Serial.println(); for(j=0;j<6;j++){ Serial.print(modeEEPROM[i][j]); Serial.print("\t"); }} } void loop(){}

# Arduino Uno Smart Line Following Robot With Obstacle Detection

Here is all the documentation. Make your own robot!

CODE:

# Arduino Uno Line Following Robot – Arduino Uno Cizgi Izleyen Robot

Hardware:
Robot Shield
Arduino Uno R3
Black Tape
QRD1113 IR Sensors (x2)
Resistors(2x10k, 2×220)

Code:

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 #include Servo left; Servo right; const int leftSensor=A2; const int rightSensor=A3; int i=0; int FL=1700; // Left Servo Forward int FR=1300; //Right Servo Forward int R=0; int L=0; void setup() { Serial.begin(9600); left.attach(12); //left servo motor right.attach(13); //right servo motor pinMode(leftSensor, INPUT); pinMode(rightSensor, INPUT); } void loop() { int leftSens; int rightSens; leftSens = ReadSens_L(); rightSens = ReadSens_R(); Serial.println("Beginning"); Serial.println(leftSens); Serial.println(rightSens); if(leftSens<400&&rightSens<400) { left.writeMicroseconds(FL); right.writeMicroseconds(FR); Serial.println("Forward!"); delay(40); } else { if(leftSens>400&&rightSens<400) { left.writeMicroseconds(1450); right.writeMicroseconds(1400); Serial.println("Turn Left!"); delay(10); Serial.println(leftSens); delay(10); Serial.println(rightSens); delay(10); int leftSens = ReadSens_L(); delay(10); int rightSens = ReadSens_R(); delay(10); } else { if(leftSens<400&&rightSens>400) { left.writeMicroseconds(1600); right.writeMicroseconds(1550); Serial.println("Turn Right!"); delay(10); Serial.println(leftSens); delay(10); Serial.println(rightSens); delay(10); int leftSens = ReadSens_L(); delay(10); int rightSens = ReadSens_R(); delay(10); } else{ }}} } int ReadSens_L(){ int i; int L = 0; for (i = 0; i < 5; i++){ L = L + analogRead(A2); // sensor on analog pin A2 } L = L / 5; // average return L; } int ReadSens_R(){ int j; int R = 0; for (j = 0; j < 5; j++){ R = R + analogRead(A3); // sensor on analog pin A3 } R = R / 5; // avarage return R; }

# Value-Based Software Engineering

(This writing is a summary of Barry Boehm’s “Value-Based Software Engineering” article.)

The paper written by Barry Boehm discusses “Value-Based Software Engineering” which is basically about “value”. The dictionary meaning of value is that the regard that something is held to deserve; the importance, worth, or usefulness of something. According to Boehm, in order to have a more realistic software design, division of value should be separated correctly. To give an example, earlier software designs were value-neutral, so they are used to fail due to lack of user input, incomplete requirements, changing requirements, lack of resources, unrealistic expectations, unclear objectives, and unrealistic time frames. Failures occur because the process of design is done without considering essential factors adequately.
He introduces seven key elements which form value based software engineering framework. According to this framework, the first part is shared vision, gathering all information, ideas, concerns, expectations and so on in order to have a realistic prediction for the future of the software, the part which includes first three elements. First one is “Benefits Realization Analysis” in which “Result Chain” which is to determine the initiatives and the stakeholders’ desired outcomes, and the other factors connecting these first two in order to complete the system is used. In this part, the factors are not only the software related but also related to other ingredient such as economic, time, human, and so forth. Second, “Stakeholder Value Proposition Elicitation and Reconciliation” meaning that eliminating arguments by using “Model-Clash Spiderweb” in order to reconcile. In other words, this step is the decision making with various values of different people. Third, “Business Case Analysis” which aims at creating a realistic financial plan considering return on investment across a system’s lifecycle.
The second section of the framework is “Planning and Execution” where the fourth and fifth elements are placed. The fourth element is “Continuous Risk and Opportunity Management” in which risk analysis and risk management are performed, so that eliminating uncertainties by prototypes, surveys, focal point person who watches marketplace or technology. Risk analysis and management is important because there might be rapid changes which might affect the performance of the design. The fifth element is “Concurrent System and Software Engineering” that stands for performing simultaneously product’s or service’s operational concept, requirements, architecture, lifecycle plans, and key sections of code because the changes affect these processes simultaneously. Therefore to be able to respond rapidly to changes, fifth element occurs to fix this emerging issue.
Third part of the framework is monitoring which is the sixth element: “Value Based Monitoring and Control”. Monitoring is the process of checking whether assumptions, outcomes, contributions, cost predictions are the same as the original plan. If not, a corrective action is required.
The last element, “Change as Opportunity”, is proposed by the author in order to identify and reorient the project to address unexpected risks and opportunities. According to Boehm, design should be adaptable to changes because change is the inherent character of the real world.
To sum up, Boehm introduces the value-based software engineering and shows that it has countless advantages compared to value neutral approaches because, as he says, “Better decision making is the key enabler of greater value added.” In order to make better decisions, we need to integrate the value consideration into our design process.

Isa Hatipoglu – 09/24/2014

(This writing is a summary of Barry Boehm’s “Value-Based Software Engineering” article.)

# Açıktaki Gemi

“Önce mahallede akan yağmur suyuna bırakılan kağıttan gemiler gibiydik. Sular birikti, aktı aktı derelere ulaştı. Sonra dereler gün yüzüne çıktığı yüksek yaylalardan, dağlardan kaçarak denizlere… Uzun bir süre dalgalar dövdü bizi. Uzaklara gitmek için her deneyişte o büyük heybetli dalgalar engel oldu. Ama o açıkta demirlemiş gemi hep bizi çağırdı sanki, bizi bekliyor gibiydi. Kıyıdan bakıldığında görünen heybetiyle, koskoca denize aldırmayan cesaretiyle adeta büyülüyordu bizleri. Sonra bir gün dalgaların o kadar da büyük olmadığını fark ettik. Bir cesaretle, boğulmayı göze alarak yüzmeye başladık açıktaki gemiye doğru. Karadan uzaklaştıkça açıklayamadığımız duygularla boğuşmaktan denizi, gemiyi unuttuk gitti. Atılan her kulaç o kaçmaya çalıştığımız sahili daha da güzelleştirdi. Aslında açıktaki o heybetli gemide yaklaştıkça güzelliğini yitiriyordu. Her yorgunluk hissinde arkaya bakıp o muhteşemliği görüp buna rağmen uzaklaşmaya devam etmek en büyük çelişki oldu içinden çıkamadığımız… “

İsa HATİPOĞLU

Can Sıkıntıları

People dream, but very few of them make dreams come true. Mustafa Kemal Ataturk was such person who was one of those heroes. He was born in 1881 in Salonica, which is in Greece now. His mother was a housewife, and his father was a military officer in Ottoman Army, as Ataturk would be. He grew up in a very harsh time during which Ottoman was stuck politically and economically. He shined in World War I, and these tough times challenged him, therefore he became the leader of Turkish National Movement as an excellent soldier. He was not only a great soldier but also the first President of Republic of Turkey and a revolutionary statesman.

The first reason why I admire him is that he was an intelligent soldier. Although his parents wanted him to study trade, he took the military entrance exam. As a result, he study at Salonica Military School. After graduating from Salonica Military School, he continued his education at Monastir Military High School. After he had graduated from Ottoman Military Academy, he was assigned to the fifth Army of Ottoman. To give an example, in the army, he accomplished massive goals. He started to shine because of his intelligence. Similarly, in the World War I, he succeeded to be a great commander, and made Ottoman stand against its enemies especially in Battle of Gallipoli, which was a turning point for Ataturk. On 19th of May 1919, he set a huge movement off in order to be independent, and he was successful. After that, he founded Republic Of Turkey by making people believe in an idea which claims that Turkish War of Independence would be successful. He was an excellent soldier that he guided his people to freedom.

The second reason why I admire him is that he was the first President of Turkey. The most important thing that I was influenced was Ataturk’s determination to found the Turkish Republic. To illustrate, during World War I, he arranged several meetings which let him to explain his aim which was to establish a new government instead of continuing with stucked Ottoman. First, under his leadership, the legitimate government was established on 23 April 1920. On 29 October 1923 the Republic Of Turkey was officially proclaimed. Ataturk was chosen the first President of Turkey. He was the only one person that deserved this hundred percent. If he had not founded Republic Of Turkey, my nation would not have had freedom. This is one of the most important reasons that he is my role model and I admire him.

Thirdly, I admire him because he was a revolutionary statesman. For instance, after he had been chosen as the first President, he made a lot of things which were transformed from the old style of ideas into modern ideas by him. For example, he published a lot of book to explain himself. His reforms taught the people of Turkey to be free and democratic. He is still being criticized by the citizens of Turkey in some ways especially a secular government system which provide the people who live in Turkey equality in terms of religious differences. Some examples of his reforms are new alphabet, to cease the caliphate, some educational reforms, and so on.

To sum up, at the same time, he was an intelligent soldier, the first President of Turkey and a revolutionary statesman. He affected a lot because of his determination even in the worse times. He taught me not to give up and to be aware of my potential. In spite of the fact that some people adversely criticize him, he was a great person and a real hero for me and I will always follow his way as long as I live.

Isa HATIPOGLU

08 October 2013 – Essay