This is my first post so if there's any glaring issues, feel free to point them out. To get down to brass tacks, I wish to make a demonstration rocket that would have no means of actual thrust, but could have a nozzle respond accordingly to angle of the rocket.
Ideally a gyroscope sensor (an MPU6050) would register the rockets angle and would send a signal to an Arduino Nano board which in turn would send the appropriate signal to two servos acting as in a two axis gimballing system. This in turn would change the angle of a nozzle, which would again only be for show. (The method the nozzles angle would be changed would be by using a gimballing system of concentric rings.) The idea is the angle the nozzle would be should roughly be at the angle necessary to correct the rockets angle if it had thrust. Finally if at all possible there would be a secondary system where the nozzles angle is controlled via joystick (the KY-023).
I've been told a PID loop should work for this project and the servos data can be gotten from the gyros date by just using some linear conversions, however I'm note entirely clear how to accomplish this.
Now a rather huge roadblock for me is I've never coded before and its basically all Greek to me. If anything I attempted to explain was unclear feel free to ask about something. Lastly, one thing I'm a bit worried about is if I need any other components other than what's mentioned above as I hope that its simply a matter of coding that's the issue. Any help would be greatly appreciated.
This is an extremely challenging problem, not at all recommended for a beginner, but it would be a good long term learning experience. You could start with the Adafruit IMU tutorial.
I don't think this is a challenging project for a newbie. First, for a non-flying demo, you don't need a PID loop, which would be a challenging project for even an experienced programmer). Just do a linear translation. If the rocket tilts 5 degrees, then tilt the gimbal 185 degrees.
Google Ardurocket
Here is a project almost exactly like yours except that the builder is moving fins instead of the motor. (Which makes sense because it's pretty hard to gimbal a solid rocket motor.)
SteveMann: Here is a project almost exactly like yours except that the builder is moving fins instead of the motor. (Which makes sense because it's pretty hard to gimbal a solid rocket motor.)
Sparked my interest so I took a quick look and found this.........Unfortunately the code is no longer available to the public due to legal reasons. I apologize for the inconvenience caused
Did find this though over at Instructables.......well, occasionally one gets good stuff there, who knows.
The code for the Instructables project linked above uses an extremely crude, P-only form of PID. It measures and uses the X and Y acceleration values as feedback for deviation from vertical, and will work only if the Z axis is approximately vertical.
The project would be fine for a classroom demo of the basic idea, but would be a guaranteed disaster in a real rocket.