Change center of gravity for quadcopter to account for weight imbalance?

I have a large custom built drone that is to carry a 2kg mass at its front. The IMU is close to the center of the drone. Does Ardupilot have a system or parameter I can play with to increase the RPMs of the front two propellers (the side the mass is situated on) in order to account for the weight imbalance?

The mass is fixed and so hypothetically if all four rotors are spinning at x RPM for stable hovering, I would assume the front two need to spin at x+m RPM where m is the additional RPM to generate thrust to carry the weight. How can I achieve this with ardupilot?

DRONE

It does that anyway.

Could you elaborate a bit further?

Will the attitude controller adjust on its own?

Yes, sure it will. We see this all the time with off-center CG. It can be problematic depending on the thrust/weight present. If the front motors max out from maneuvering stability will be lost. You will see this with Thrust Loss errors in the log. Can’t you balance it with the battery?

The rotors Im using are pretty powerful and shouldnt max out hopefully. As a matter of fact this weight isnt a weight but a mechanism that moves around, so in fact its own weight distribution changes with user input. Think of it as a beam that can bend itself like an elbow thus applying a different moment (torque) on the drone.

I was actually hoping if ardupilot has a feature whereby the CoG can be changed dynamically such that for different positions the mechanism is in, the CoG updates and the rotors superpose the additional support thrust accordingly without the attitude controller figuring it out itself (the mechanism would feed the data about its position to the controller and I want to use this data to update hypothetical CoG variable)

Is there a particular file within the build you could point me towards to achieve this? I plan to write it myself, just looking for a the place to insert it. i.e. a CoG variable the attitude controller uses perhaps?

It does this anyway. It’s going to try to stabilize the vehicle regardless. But use Search here for Arducopter Motor Matrix for some additional info.

Thats good to hear but If i wanted to improve the stability of the drone by feeding the current position of the mechanism (such that this mechanism and drone are coupled instead of the drone reacting to the mechanism) which file should I look to work on such a feature?

Edit: Just found this: Adding Custom Attitude Controller to Copter — Dev documentation
safe to say this is where I should start?

I think you should simply adjust the motor matrix to bias more thrust forward. You don’t even need to compile any source for that. Look through the GitHub Lua scripting examples for custom motor matrix.