Go Down

Topic: rocket guidance by arduino (Read 3575 times)previous topic - next topic

cesarecandela

Feb 28, 2015, 06:29 pmLast Edit: Mar 01, 2015, 02:54 pm by leo72
Hi to all of you.
I'm from Italy.
I'm trying to build a little guidance device for my rocket model.
The idea is take analog data output from a 7361L accelerometer, convert millivolt to degrees and write them to one or more servo.
For example: if my rocket goes 20 degrees on the left, the servo will rotate fins 20 degrees in the opposite direction.

Here it is my sketch draft. Many Thanks in advance to all who help me in this project:
Code: [Select]
`#include <Servo.h>Servo myservo; //Ingressi analogici di Arduinoconst int xPin = A0;const int yPin = A1;const int zPin = A2;//Valori massimo e minimo dell'accelerometro//utilizzato e quindi da modificare se necessarioint minVal = 850;int maxVal = 2450;//Variabili che contengono il valore attualedouble x;double y;double z;void setup() {Serial.begin(9600); //VISUALIZZAZIONE VALORI  analogReference(EXTERNAL);  Serial.println("Setup MMA7361L");  myservo.attach(7); //pin di controllo} void loop() {//Lettura valori di tensione forniti dal sensore  int xRead = analogRead(xPin);  int yRead = analogRead(yPin);  int zRead = analogRead(zPin);    //Conversione dei valori letti in gradi    int xAng = map(xRead, minVal, maxVal, -90, 90);  int yAng = map(yRead, minVal, maxVal, -90, 90);  int zAng = map(zRead, minVal, maxVal, -90, 90);    //Visualizzo i valori   Serial.print("x: ");  Serial.print(xAng);   Serial.print(" | y: ");  Serial.print(yAng);   Serial.print(" | z: ");  Serial.println(zAng);    delay(1000);myservo.write(-xAng);}`

EDIT BY MOD: added code tags

AWOL

#1
Feb 28, 2015, 08:41 pm
Be very, very careful.
Many jurisdictions forbid guidance of rockets.

Please use code tags when posting code.

cesarecandela

#2
Mar 01, 2015, 01:13 pm
Many thanks, I knew this...altough I'm a lawyer..
Anyway, this is not a guidance system, but a stabilization system.
I won't be able to guide the rocket, but only to make it rise vertically.

Bye

simone

AWOL

#3
Mar 01, 2015, 01:52 pmLast Edit: Mar 01, 2015, 02:39 pm by AWOL
As a lawyer, you should know to always read the small-print

bobcousins

#4
Mar 01, 2015, 02:24 pm
It's an interesting idea, but I think that you will need a fast control loop to get useful stabilisation. A typical model rocket reaches a peak speed of about 120 m/s, or 260 mph. Put another way, that is 1 meter in about 8 ms.

If you are new to control theory, I would find something to practice with that is less demanding than a model rocket.
Please ask questions in the forum so everyone can benefit. PM me for paid work.

cesarecandela

#5
Mar 01, 2015, 07:12 pm
Thanks...we lawyers write the small print clauses, never read them

Anyway...I've found differents projects online to stabilize the rocket fly, but I prefer a new one made by myself.

Responding to bobcousins, I understend what are you talking about, but I'd like to try this.
So, if someone has notes or suggestions, I'll be very gratefull.....
Bye

simone

AWOL

#6
Mar 01, 2015, 07:16 pm
Then there's the issue of "plausible deniability".
Calling the thread "rocket guidance by arduino" is not going to go well with the judge.

cesarecandela

#7
Mar 01, 2015, 07:28 pm
Italian laws about penal courts are a little different....Italian criminal laws are different too.
Talking about a thing IS NOT making the thing.
I'm not going to build a guidance system, but only a rudimental stabilization system. For a flying model.
I think, for example, is more dangerous talking about sugar self made propellants. They are explosives, for italian laws.

AWOL

#8
Mar 01, 2015, 08:28 pm
Quote
I'd start by getting some flight surface actuators, and measuring the latency.
I don't think an R/C sevro is going to be reponsive enough.

On the Web, it used to be possible to find papers and manuals about control rules for stuff like TOW missiles.
Although these are man-in-the-loop guidance, I think the description of the gas-powered control surfaces is informative.
(One paper describes the launch sequence - I just love the use of squibs for everything from melting the electrolyte in the flight battery, to blowing off the valve of the nitrogen bottle to spin up the gyro)

zoomkat

#9
Mar 02, 2015, 02:08 am
Small rockets probably won't be able to support the weight of a guidance system. Just put a stabalizing stick on the rocket, like a skyrocket.

Quote
#7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

cesarecandela

#10
Mar 05, 2015, 12:21 pm
Thanks to all. I'll try to post a different topic in the appropriate section to work on servo movement driven by accelerometer. One step before...

AWOL

#11
Mar 05, 2015, 12:30 pm
Remember that standard R/C servos have an update rate of only 50Hz.
You'll probably want to be looking at more responsive digital servos.

Go Up