0
$\begingroup$

I am new to quadcopters. My physics/mechanics has always been weak. I need help to clear this doubt.

I am working on a project where i need to control my quadcopter by giving it acceleration input in world frame. I am converting acceleration in x,y directions to pitch and roll angles using $roll(\phi)=tan^{-1}(\frac{a_y}{g})$, where $a_y$ is desired acceleration in world frame y-aixs and $g$= acceleration due to gravity. So if my quad is tilted at some roll angle then there is some component of thrust/force in y-axis(world frame) and hence quad accelerates along thay direction. Now if after some time my acceleration input is 0, then as per above formula roll=0, now if roll becomes 0 shouldnt the quad come to a stop? Because if it keeps moving then we know for a quad to translate in XY direction roll/pitch needed, so in order to maintain roll=0 the quad cannot move, but as per defintiion of acceleration, zero acceleration means it must maintain the previous velocity. So in such a scenario how to give acceleration input to quadcopters?

Can I instead directly do velcoity control from acceleration, by integrating acceleration over time?

I feel that simply giving roll/pitch as setpoint to PID controller wont suffice, I need to get feedback using accelerometers, and some other things to do acceleration control?

$\endgroup$

2 Answers 2

0
$\begingroup$

I can't give you a specific answer based on your provided equation but I will try to make things clearer for you.

Yes, you are correct in saying that just because your acceleration, roll and pitch are zero, doesn't mean that you aren't moving.

Your control strategy will depend on what you are trying to control. In most simple cases this would be maintaining a certain setpoint position. Initially, you'd want to make the quadcopter hover, in which case your control strategy would be obtaining orientation or acceleration data from an IMU and using a PID controller to maintain zero pitch and roll.

You can then try to get velocity control to work. This would involve you having a PID feedback loop with your $roll (\phi)$ or $pitch (\theta)$ as the input and your drone $v_y$ or $v_x$ as your output. In this case, you'll need to integrate IMU acceleration readings to obtain your velocity measurements and feed that back into your PID controller to get an error estimation.

To control your position, you would then use a PID controller with your drone velocity as an input and your current drone position as an output.

But this is where things will get a little tricky. IMUs are known for having measurement drift. This means that if you continuously integrate your IMU acceleration reaading to find your velocity and also your position, over time your vlocity and position readings are gonna get further and further away from the true value. This doesnt happen too quickly when you are integrating your acceleration once to find velocity, but it happens faster when you double integrate your acceleration to find position. So I would recommend you using a type of a Global Navigation Satellite System (GNSS) with an IMU for position control.

I hope this helps to clear thinsg up. Let me know if I've made a mistake somewhere or if you have any questions.

$\endgroup$
0
$\begingroup$

Going through your question:

I am converting acceleration in x,y directions to pitch and roll angles using $\text{roll}(\phi)=tan^{-1}(\frac{a_y}{g})$, where $a_y$ is desired acceleration in world frame y-aixs and $g$ = acceleration due to gravity

So, to put this another way, you have your desired acceleration given as:

$$ a_y = g\tan{\phi} $$

And, to be explicit here (because this comes up later), your acceleration is a function of roll angle.

Then you say

So if my quad is tilted at some roll angle then there is some component of thrust/force in y-axis(world frame) and hence quad accelerates along that direction.

That's correct.

Now if after some time my acceleration input is 0, then as per above formula roll=0, now if roll becomes 0 shouldn't the quad come to a stop?

No, because as stated above the acceleration is a function of roll angle. Acceleration is the rate of change in the quad's speed. If you make acceleration zero then you say "I want the speed to stay constant." Since it was moving in +y (or whichever direction when you rolled) it will continue moving in that direction after you zero the roll angle.

Because if it keeps moving then we know for a quad to translate in XY direction roll/pitch needed

Nope, again we know that to accelerate in XY direction a roll/pitch is needed.

so in order to maintain roll=0 the quad cannot move

cannot accelerate

but as per definition of acceleration, zero acceleration means it must maintain the previous velocity

Yes this statement is correct.

So in such a scenario how to give acceleration input to quadcopters?

Can I instead directly do velocity control from acceleration, by integrating acceleration over time?

If it were me, and I care about doing velocity control, then that's what I would use. Get a reference velocity as an input and subtract from that the measured quadcopter velocity to get a reference error. This is what you feed to a PID controller.

I feel that simply giving roll/pitch as setpoint to PID controller wont suffice, I need to get feedback using accelerometers, and some other things to do acceleration control?

Yeah you can do this, this is basically how helicopters work. They have a swashplate that converts pilot stick (request) to blade angle (acceleration) and so they directly control acceleration. It depends on the "feel" you want in the system, whether you provide acceleration/pitch as an input (helicopter-style) or whether you provide speed as an input (RC-car-style).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.