Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Here's a video of the final hardware!


I need to put the fins on and see if the code needs any offsets before I glue it together.
Here's a video of the final hardware, all put together:

As the weather was pretty bad this past weekend, I'm aiming for this weekend for a launch.
Yas! I'm looking forward to this. Seems I've missed quite a few posts, those rockets and the calibration look solid! How did you verify the rockets fly straight slash make sure the offsets are correct?
theprogrammingcube wrote:
Right now, I have a version of the code that seems it will work just fine, but it doesn't use PID tuning (it uses my existing code but maps the angle of the servos to a much smaller range).

When I tried using the arduino PID library, I made a PID object with an input of the angle tilt in degrees, a setpoint angle of 90 degrees, and Kp of 0, Ki of 10, and Kd of 0.

What ends up happening is that the fins will move ALL the way over to the left or right when I tilt the body. If I wiggle it back and forth, the fins will "appear" to work, but when I stop moving it, instead of pointing straight up, the fins will continue on their merry way to the side they were approaching.
Also, the servo movement is very jumpy.


Were you able to figure out the correct PID gains for your controller? Generally, you will want to start with Kp>0, Ki=0 and Kd=0, then add in Kd and Ki as necessary to achieve your desired response. This will probably be difficult to do without a good system model, but I would highly recommend revisiting your controller setup. What you have described will lead to instability as the controller repeatedly overshoots the setpoint because the integral of error over time is lagging behind the current state.
Alex wrote:
Yas! I'm looking forward to this. Seems I've missed quite a few posts, those rockets and the calibration look solid! How did you verify the rockets fly straight slash make sure the offsets are correct?


As for the offsets, I use a tried and true method of grabbing 200 samples from all axes at startup, sorting them least to greatest, and then taking the median (NOT mean). This is my base offset.

The final code will actually use the offset Z axis for the calculations, not a live calculation because I found out that the high G's during launch will skew the math and cause the rocket to snap into the ground.

jonbush wrote:
Were you able to figure out the correct PID gains for your controller? Generally, you will want to start with Kp>0, Ki=0 and Kd=0, then add in Kd and Ki as necessary to achieve your desired response. This will probably be difficult to do without a good system model, but I would highly recommend revisiting your controller setup. What you have described will lead to instability as the controller repeatedly overshoots the setpoint because the integral of error over time is lagging behind the current state.


I'll try doing the PID tuning again in a day or two (school stuff came up). The issue isn't exactly the nature of the PID, its actually "Okay, I have the PID loop, now how do I use this resultant number to drive the servos". They constantly slam to the right because I don't know how the math worked out in the end and I was pretty tired at that point.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement