- Joined
- Jan 13, 2008
- Messages
- 2,303
- Reaction score
- 6
- Points
- 38
- Location
- Atlanta, GA, USA, North America
I'm working on tuning an autopilot for a launcher in Orbiter, and I'm breaking out the data into a table to see what effects the variable changes are having. One thing I noticed though when the vehicle approaches the setpoint, the error rate remains the same. Here's the data:
simt|current|error|rate
25.765484|89.988951|0.011049|-1.022837
25.772039|89.998118|0.001882|-1.39849
25.779284|90.006247|-0.006247|-1.121982
25.785579|90.015207|-0.015207|-1.423363And here's the code for generating the rate from the error
As I said, I would expect the rate to change from negative to positive when the controller crosses the 0 error mark ("current" is the current heading of the vehicle, and it's set to 90 so 0 error is in between those middle two timesteps). Am I calculating the rate incorrectly? Or is this actually right?
Thanks!
25.765484|89.988951|0.011049|-1.022837
25.772039|89.998118|0.001882|-1.39849
25.779284|90.006247|-0.006247|-1.121982
25.785579|90.015207|-0.015207|-1.423363
Code:
rate = ((error - olderror) / (simt - oldtime));
Thanks!
Last edited: