I am trying to perform an aileron roll maneuver for an un-manned aircraft in a simulation. The lateral control architecture is that I am controlling roll rate (stability) with aileron stick and side-slip angle with rudder stick, in which there is also a yaw damper in the inner loop. The longitudinal controllers are speed, and pitch rate is being controlled by the elevator stick. While doing the aileron roll maneuver, my pitch attitude gets affected significantly and the aircraft losses a lot of altitude. I need to perform this maneuver while maintaining the almost same altitude and heading? Can anyone advise me what am I missing in my lateral and longitudinal controller architectures?
An aileron roll is done semi-ballistically, that is, the roll is done while the aircraft is pitched up slightly, the rolled at the maximum rate with elevators neutral, and being completed as the airplane has completed a very shallow ballistic arc.
Therefore, it has to start with ample speed and an initial pitch up, then the pitch is mostly unloaded as full aileron is applied. During the time the airplane is rolling, the nose will fall through in a more or less ballistic arc, returning to wings level by the time the nose has gone from 10-20 deg nose up to 10-20 deg nose down. Try this:
Lateral control should be maximum roll rate.
After adequate speed is attained, pitch control should be mild pitch up until the nose is 10+ deg above the horizon, then pitch neutral as maximum aileron is applied. Just let the nose fall through. At this point your are a spinning ballistic object, like an arrow. Rolling at maximum roll rate should complete the roll before the nose has fallen though too far. If the roll is completed with the nose pointing down 45 deg, the entry speed was too low, the pitch attitude at entry was too low, or the roll rate is too slow.
Yaw control should just be counteract adverse yaw, to the extent there is any.
An aileron roll is not the same as a slow roll, which transfers lift from the wings, to the fuselage, to the wings upside down, to the other side of the fuselage and back to the wings, and which requires complex elevator and rudder control inputs to achieve those conditions.
pitch attitude is affected and the aircraft loses altitude
Losing altitude in a roll maneuver will happen unless enough lift can be generated with the fuselage angle of attack and the vertical component of the thrust vector. Highly overpowered and lightweight models are capable of this. Rudder input is required in the quarter roll.
Change of pitch is the result of the aircraft being rolled sideways. Natural (longitudinal) stability will cause the nose to dip as it descends. Again, rudder input is required. When the plane is sideways, the rudder becomes the "elevator" (of the nose).
To do all this, it might be better not to have a yaw damper function. Also, the drone design should be as simple as possible. Work on the inputs for smooth rolling manually first. Then it might be possible to program them.
One approach can be to avoid excessive static stability. Move the weight back, if you can, to nuetral. This will help keep the nose up in the roll. In my early days, I built a sport model that was actually a bit tail heavy. Very difficult to control, but one time, with full aileron, it rolled 2x before I even knew what I saw.