Feed Forward - rotorflight/rotorflight GitHub Wiki

❗ This page is outdated

Rotorflight Wiki is replaced by www.rotorflight.org.


Feed Forward

Feed forward is a control that is fed directly from your RC stick position. It does not go through the PID loop. The PID loop takes time to identify, control and minimise the error between your controllers setpoint (your stick position) and your helicopters actual feedback (gyro signal). This takes time (lag). The faster the gyro is able to track the setpoint the better. The aim of feed forward is to apply a command immediately to the output of the controller. The aim being that we want the helicopter to move as close as possible to the commanded rate. This means the control loop (P and I) do not have to do very much work to correct the error. Too little Feedforward and the helicopter will undershoot the rate and the controller will have to wind up (integral). Too much and the Helicopter will overshoot and the controller will have to wind down. We will use this Integral value to identify and tune the Feed forward.

Looking at the picture below showing a helicopter with zero feed forward configured (the blue line is flat). As it rolls one way then the other, the integral term (grey) has to increase when the setpoint (red) is increasing and has to decrease as the setpoint also decreases. This takes time and ultimately results in a slow laggy control. You can see this lag in the gyro signal (yellow) as it does not track the setpoint and is delayed.

Method

  1. From a hover, roll the helicopter to one side (maybe 45 degrees) letting it fly a few meters before transitioning back the other way. Fly 10 or more transitions like this then do the same in the pitch direction.

  2. Setup your logs. I like to plot the following parameters for each axis, with separate graphs for pitch and roll. Scale the integral up to 500%. This makes it much more visible.

  1. In this pic the feed forward has been increased from the original value of zero. The blue line (feed forward) is now providing some control. As the setpoint (red) increases, the integral (grey) also has to increase; however, it does not have to increase by anywhere near as much as it did in the previous pic. The delay is also slightly reduced.

.

  1. Increase the feed forward and again fly as above. Recheck the logs. You may have to repeat several times. The pic below shows a reasonably flat level of integral as the heli rotates in both directions. As the setpoint is going up and down the integral does not have any tendency to move in relation to the setpoint. Integral is just moving around in a random way correcting for external influences (wind). There is very little lag and the gyro tracks very close to the setpoint. This means the Feed forward is tuned reasonably closely. If you wish you can refine a little by taking some more logs around this point so see which is the closest. You must do this on both the pitch and the roll axis as it is very likely that they will be different.

  1. Stop.. in the pic below you have gone too far. There is now too much feed forward and the helicopter is now rotating greater than the setpoint and the integral now has to wind in the reverse direction to correct. This can be shown by when the setpoint (red) goes up, the integral (grey) now have to move in the opposite direction to each other.

Interactions

Make sure you fly and view the logs on Roll and Pitch independently. When flying the test in one axis try to avoid any control input for the other axis. This is because there will be cross interactions due to things such as Translational lift and Dissymmetry of lift. Plot the roll and pitch axis on 2 separate graphs. In the picture below you will see the test is being conducted on the Pitch axis (the lower graph) as the setpoint (red) and gyro (yellow) signals are moving up and down. No commands are being done on the Roll axis (the top graph) however, the integral is having to wind up and down to maintain the neutral roll rate. This is normal.

What does that mean for our Feed Forward tuning? It means that if we are changing both axis at the same time we will cover up or distort the integral value we are using to gauge how accurate our feed forward gain is. The only way to avoid this is to avoid inputs on the axis we are not testing.

Without Black Box Logger

Ok so you don't have a Black Box logger??? We do recommend getting hold of an OpenLager; but, if you do not have any form of logger available you can try tuning the FF by feel. It is far from ideal though and will really only be a best guess.

Generally speaking at low values of feed forward the helicopter will be very laggy and delayed. You will feel like you are chasing the helicopter around. As feed forward is increased this lag will reduce and it will feel more direct and immediate. Too much and the helicopter may begin to feel "tippy".

⚠️ **GitHub.com Fallback** ⚠️