Monday, July 06, 2009

The ... is connected to the ...

My basic control loop is as follows:

  • 1)I have an actual and  desired position.-> I use that to generate a desired velocity.

  • 2a)I transform the desired velocity into a desired right and forward velocity with current yaw/heading.

  • 2b)Transform the actual velocity into right and forward velocity with current heading.

  • 3a)I use  actual and desired right /left velocity to set desired roll* angle.

  • 3b)I use actual and desired forward/back velocity to set desired pitch angle.

  • 4a)I use the actual and desired roll angle to set the aileron or actuator position to cause roll.

  • 4b)I use the actual and desired pitch angle to set the elevator  or actuator position to cause pitch change.

I reality steps 1,3 and 4 are PID loops(proportional integral differential) , I’ve been running for a while with  Step 1 P,I step 3 p and step 4 pd. For hovering this works just fine as what I really care about is holding position. Any bias in the system is taken out with the integral term in the position hold. When I start navigation from place to place that does not work so well. It’s beginning to look like I need properly distributed I and D terms on each loop. For example a helicopter does not hover with the frame level, my current helicopter hovers with a 12 degree to the right and 5 degree nose up from its resting position on the skids. I could carefully tune the centers of all the loops so these biases don’t effect the control laws, but they seem to vary with somewhat randomly.

I’m in the process of trying to change to 1:PI,3:PI,4:PID as I get each loop under control I have to turn down the gain in the outer most loops as the gain was cranked up there to handle the biases not taken into account with the integral terms.   I have a simple utility that runs on the laptop and allows me to tweak gain constants without recompiling things in the field. It also allows me to assign one constant to a trim lever on the RC transmitter for tuning. I’ve flown  about 30 times in the last week trying to get all this sorted out on the helicopter.  I’m going to have to tune the rocket as well, but hopefully I’ll be more efficient with that after learning on the copter.

I started with 10 variable slots, and have now moved to 16 variable slots. I was having a hard time making sense of it all until I discovered today that when I did a cut copy and paste on the UI that sets gains, the channel being assigned to the “trim” lever was the wrong one, olny  if I was trying to set one of the 6 new channels, so the trim lever made things change, but not what I though it was making change so it was all very confusing arghhhh…

I’ve fixed that tonight and I’ll try again after work on Tuesday, or maybe not, I’ve been reading some David Weber snipits aka “book crack” and amazon tells me the book in question has been shipped and I will get it on Tuesday. no more rushing to the site to see the latest installment on Mon,Wed,Fri ;-)


*Since I started on a helicopter I’m using that coordinate convention, where what is typically done for rockets is to call “roll” rotation around the nominally vertical actuator.

1 comment:

David said...

Even though there are not many comments - I do enjoy this type of post. Interesting - good work.