With this guide you should have all the information you need to modify the appearance and flight characteristics of your quadcopter. The important blueprints are contained within:
“QuadcopterControl/Blueprints” and “QuadcopterControl/Blueprints/QuadcopterModes”.
The quadcopter system is made up of a base class “BP_Quadcopter_Base” and four child classes which are the flight modes.
The Base class “BP_Quadcopter_Base” is the first place you need to go to customize your quadcopter. It contains the settings and code that control the appearance, thrust output, controller sensitivity and camera control that affect all flight modes.
The quadcopter mesh is a skeletal mesh. The bone structure is extremely simple and requires only the most basic rigging knowledge to set up. In order for the blueprint system to work all it needs is a root and one child bone for each propeller. The included model also has 2 additional bones, one for each of the landing struts (these are optional). The landing struts are set up in the physics asset tool so they respond to landing more realistically.
If you chose to replace the skeletal mesh you must also update the animation blueprint. If your skeletal mesh differs from the included model you will need to create an animation blueprint for it. Simply copy the blueprint code from the “ABP_Quadcopter” animation blueprint in the Event Graph and the Anim Graph to your new animation blueprint. In the Event graph, ensure that each of the Transform Bone nodes has the correct “Bone to Modify” setting set for each propeller under the Skeletal Control tab in the details panel.
To replace the model, go to the BP_Quadcopter_Base class and select the Quadcopter Skeletal mesh component in the components menu. Replace the Skeletal mesh in the details panel under the Mesh tab. Then select the correct Anim Class under the Animation tab.
Finally, you must create a new material for your quadcopter. If it differs significantly from the included model, you may want to change or remove the code which selects the color of the quadcopter located in BP_Quadcopter_Base in the Construction Script.
If you have created a custom mesh for your quadcopter you will need to create a physics asset for it. In the physics asset you can set the mass of your quadcopter and the desired linear and angular damping. These settings will significantly affect the flight characteristics of your quadcopter, higher linear damping values are good for simulating drag created by air resistance. Higher angular damping values will make flight more stable and less responsive.
In the BP_Quadcopter_Base blueprint you will have to set three main thruster values based on the settings you set in the physics asset. These settings are located in the variables section under “Thrusters”. They are called “MinThrust”, “MaxThrust” and “YawTorque”
Higher mass will require a higher MinThrust and MaxThrust as well as a higher YawTorque. Lower mass will require lower values. To test these settings, place an instance of the BP_Quadcopter_Manual Blueprint in a scene. The manual setting is essentially a direct connection between your controller and the quadcopter without any stabilization so it is great for testing your new quadcopter parameters.
With your quadcopter placed in the scene, slowly increase the throttle until your it starts to take off. If the quadcopter takes off too quickly, you must decrease the MaxThrust value. If the quadcopter fails to take off or takes off too slowly the MaxThrust value must be increased.
is the minimum thruster output created by the quadcopter, this setting should be low enough that your quadcopter does not take off on its own when your throttle is completely lowered, but high enough that it slows the descent speed of your quadcopter when you let go of the throttle during flight. The purpose of this setting is to slow down the over-all descent speed of your quadcopter. The desired level of MinThrust is mostly subjective and should be experimented with in order to reach your desired preference.
This value determines how quickly your quadcopter can turn left or right. Higher mass requires higher torque. Experiment with this setting using the manual quadcopter mode until you find your preferred torque value.
With the physics settings configured, you can now modify the sensitivity levels for the yaw, pitch and roll controls. These settings are named “YawSensitivity”, “RollSensitivity” and “PitchSensitivity”. Use the Manual quadcopter control mode to tweak these settings to your liking.
By default the quadcopter control system comes with two default camera modes. Third person and First person modes. To add a camera mode, open the CameraModes Enumeration file located in “QuadcopterControl/Blueprints” and add a new item to the Enumerators list. Then in BP_Quadcopter_Base. Go to the CameraMode function. In the “Set camera to appropriate camera socket comment section you will see the camera mode switch. This is where you must add your new camera code.
Customizing the flight modes
This flight mode has no stabilization, it simply feeds the controller input to the thrusters directly. Most of the settings that affect this mode are located in BP_Quadcopter_Base. The yaw torque can be set in the overridden Yaw function.
The acrobatic flight mode behaves like a racing quadcopter. In between the controller input and the thruster output is stabilization code which seeks to keep the quadcopter oriented in the angle set by the pilot. Unlike the manual flight mode in which the quadcopter will keep its momentum If you let go of the controls, the acrobatic quadcopter will seek to remain in the same angle it was in when the controls were let go. This allows the pilot to precisely rotate the quadcopter freely in 360 degrees in all axis of motion and perform acrobatic maneuvers while in flight.
The main settings which need to be configured when using a custom quadcopter model are “YawGainValues” and “PitchRollGainValues”. These are the PID gain values used by the quadcopter stabilization code to keep the quadcopter oriented X, Y and Z correspond to P, I and D respectively. The YawGainValues are used to define the behavior of the Yaw stabilization algorithm. The PitchRollGainValues are used to define the behavior of the pitch and roll stabilization algorithms. These values need to be experimented with in order to achieve the desired results. The theory behind the function of the PID controller algorithm will not be covered in this document. For more information on how PID Controllers work, I would refer you to my previous blog post (https://protospace.wordpress.com/2017/03/27/pid-controller/) There you will find basic explanations of how PID Controllers work as well as a link to my PID Controller example pack on the Unreal Engine Marketplace, as well as the wikipedia article on PID Controllers which is an excellent place to start.
This mode also uses PID Controllers for the Yaw, Pitch and Roll. The difference between this mode and the Acrobatic mode, is that in this mode the quadcopter seeks to remain level in respect to the world, where as the acrobatic mode seeks to maintain its orientation from user input. When you let go of the controls in stabilized mode the quadcopter will automatically return to a level flying position. The Yaw, Pitch and Roll gain values function in the same fundamental manner in the acrobatic mode and manual mode. In fact, the Yaw values are exactly the same. Only the pitch/roll values have changed due to the difference in flight modes.
This mode is identical to the previous stabilized hover mode, but with the addition of throttle stabilization. Now in addition to remaining level with the world, the quadcopter also attempts to remain at the same altitude that the pilot last left it in. The throttle PID gain settings are called “ThrottleGainValues” and can be found with the other PID gain values.