Simulating external force applied to a copter


I need to simulate a copter with a varying external force applied to it (e.g. a payload on a rope) and develop a compensation mechanism for that. Currently, I’m thinking about faking IMU output or injecting fake accelerometer readings to understand the current behavior of the drone.

I’m wondering if there is a better approach which exists within ArduPilot/SITL for such kind of things (I could find nothing through reading the developers documentation)?


The closest thing that is available is the WIND simulation in SITL.
There are a lot’s of WIND parameters in SITL, the most interesting in this case could be the WIND_DIR and WIND_DIR_Z but it needs to dig into the code to figure out what they actually do…

(edit) Well, it seems WIND sim could be used for some extent. you can define a vectored force to the copter by Wind_spd, wind_dir and wind_dir_z these parameters will translate to a vector

wind_ef = Vector3f(cosf(radians(input.wind.direction))*cosf(radians(input.wind.dir_z)), 
                       sinf(radians(input.wind.dir_z))) * input.wind.speed;
1 Like

Thank you Andras, the direction (pun intended!) looks indeed very promising. Will dive a bit deeper into the code! If you have any other tips, I’d really appreciate that!

The external payloads add weight to the vehicle. Notionally we could add
parameterised offsets to that weight to induce a torque.

1 Like

Ok, I’ve explored a bit SITL code and had an idea that 2 additional co-axial motors per force, tiltable in any direction, may do the job. Co-axiality is used for neutralizing rotational torque.

This gives everything, including point of force applied. The only things which should be “fixed” then are:

  • Increased battery draw (maybe it can be fixed by feeding the consumed power back to the battery)
  • Motor direction should be updated manually by extra parameters introduced to SITL (4 floats per force: direction and amplitude).

What is your opinion? Do you see any potential problems?


Of course, the external force dynamics are to be simulated outside SITL. Additionally, the mass of “extra” motors should be compensated by adding their negative to “external_payload”.