I know that adjustments are needed in the motor matrix like the yaw factor, but I did not manage to get any further.
Does anyone have a clue about what is needed to be done to have the drone hover steadily? I would appreciate at least a starting point so that I know where to start.
Anyone could lead me please to see if what i mentioned make sense? The reason of changing the combination between CW and CCW, is that i want to conduct a brief study for motor loss.
I’ve never tried this personally. If someone else has, and they chime in, I’ll go quiet.
I’m looking at the source. I can’t tell if you already knew this: The motor direction looks hard-coded to align with the diagram.
However, once i change the motor rotation to the following combination:
Can you specify the details of where/how you made this change?
(Obviously if you did not change it in all the right places, that explains why it does not work.)
I also see a mention in the source of using a custom-written motor configuration source. That’s probably writing a custom Lua script to configure ArduPilot for your desired custom configuration. I mention this because it looks like to accomplish your goal you’ll either need to write Lua code, or modify the main source code.
By simply reverse the rotation of the output channel.
My understanding for the scripting motor matrix using LUA is done when your motor position with respect to the thrust center or cg, are different than the default one. But i dont have any other understanding and that’s why I am asking if I changed the rotation combination between all motors, then what do i need to change in the motor matrix for the corresponding frame?
Did you validate that your code was changed as you intended without error?
Have you looked at the SITL specific code or Realflight model configuration for that frame type? It probably has the physical motor/prop characteristics baked in, though I’d have to go do a code review to find the exact configuration and values to change.
Mistakes in either case would result in poor behavior on throttle up.
Thank you Yuri for replying.
I have not yet changed the code. I have a motor matrix that is coded using LUA and worked with the default CCW-CW combination of an octo H-frame. So with the default everything working. Since it worked with the default setup, i don’t see the reason why i need to check the model; however, I would appreciate if you guide me where the model is coded (that is flightaxis) as I am interested.
Once I change the combination of CCW-CW for all motors as mentioned in my previous then the drone is not able to hold its heading and enters instability in all axis. My question is do i need to adjust anything from the LUA script side if I do such change? reminder that i only reversed the channel outputs and confirmed that the change is success through a motor test.
What i know so far that the roll, and pitch are computed as normalized factors between maximum offset distance to the distance between cg or thrust center of each motor. However, the yaw factor is always 1, -1. And I honestly do not understand how this is computed. I saw the existing code in AP_MotorsMatrix but it is not clear for me and i would appreciate your help.
I think I’m responding to this, where you’re confused about what the 1,-1 means. Perhaps I haven’t fully grasped your question, but let me keep going and see if this answers your question.
The motor mixer is simply an array that determines how much effort should be applied to each motor for roll, pitch, yaw, and thrust. Geometry is used to come up with those factors, but in essence they are unit-less to the motor mixer. In the case of yaw, a convenience macro is defined so that you can specify which motor spins in which direction, and the sign of the unit used to track which motors need to be spun up to provide yaw in the direction of the effort, and which motors need to be reduced. The API is such that the mixer expects you to provide the direction that the motors spin, as opposed to the direction of the moment that the motor imparts on the body.
While the API has matured a little since this video, https://youtu.be/QUDhnYvH66k should help you figure out what the mixer is doing and how to configure it for your needs.
If this isn’t what you need, let me know what I’ve missed from your question and I’ll try to clarify.
I said I’d stay quiet… but just in case I spot the miscommunication: I wonder if responders assume OP has attempted to modify the motor matrix, when in fact no such attempt has been made? That might explain the disconnect between explaining how the motor matrix works, and the problem persisting.
Hopefully I’m mistaken, and this response can be ignored!