-2

I am on the project quadcopter. So i have to use PID for stabalizing it. I think i am going wrong because i am adding the pid output to motors thrust. While the motors thrust means to be its acceleraTion. The reason of my previous statment is that when the quad is static in air(not goin up nor below), that time the thrust is enough to cancel gravity, means thrust is negative gravity, that is acceleration. So if i add pid output to thrust that is acceleration of motors, it will be wrong. I have to add pid to speed of motors, which is not visible. My quad is not stabalizing the reason i see is this, that i am adding pid to acc, while it should be added to speed(virtually). What should i do. Should i derivate the pid output and add to thrust? https://mbasic.facebook.com/photo.php?fbid=1545278952394916&id=100007384772233&set=a.1447457675510378.1073741830.100007384772233&refid=17&ft=top_level_post_id.1545278952394916%3Athid.100007384772233%3A306061129499414%3A69%3A0%3A1443682799%3A-1394728329505289925&tn=E

https://mbasic.facebook.com/photo.php?fbid=1545281645727980&id=100007384772233&set=a.1447457675510378.1073741830.100007384772233&refid=17&tn=E

This is the drawing of my circuit. I am giving the current from one esc to whole of the circuit. Other esc's has only pwm wire connected to circuit.

  • Did you take any of the advice given on the other question you asked about this? Can you post a link to all of your code and the data sheets for all of your parts? Can you post a picture that shows where all of your sensors are located on your quadcopter? You already posted one picture, but in that picture it looks like you have IC's wired to your quadcopter that are on the ground. I just want to see where everything is to ensure your attitude sensor isn't on the ground. – Chuck Sep 04 '15 at 11:56
  • I am asking that the propellers and motors produce acceleration. That is the motors at thrust x will have height equation as {height+=speed and speed += thrust.} And it is not like this that{height += thrust}. Tell me which of the two happens in the motors. If 1st statment is true then i should no be adding pid to thrust ,but i should add change in pid to thrust. Help – Sulaiman Ayub Sep 04 '15 at 12:34
  • It doesn't matter what effect thrust has on height. If you send a reference height to your controller, and you provide a height feedback to your controller, then the controller will output the correct motor signal. If you are having issues then you are either (1) not providing it the correct reference signal, (2) not providing it the correct feedback signal, (3) not providing the correct gains, and/or (4) not implementing the controller correctly. Given the last question you asked, I doubt you are providing the correct gains and I also don't think you have your system configured correctly. – Chuck Sep 04 '15 at 17:24
  • The problems/limitations i face are below; 1. When i use a floating variable the microcntlr doesnt start. So i cant use kp or ki or kd in floats. What will i do for that. 2. I only use the acceleromter at 2g for my error signal. So it gives output half of full range at full error. Which is 16280. So the error signal is ranging from -16280to +16280. So the pid will try to correct this error. And give output of this scale. BUT BUT,,,,,, my microcontrl accepts a value ranging from 0 to 42, to set speed from 0 to max respectively. So i will have to add pid to speed. – Sulaiman Ayub Sep 04 '15 at 18:14
  • NOW the error range is 0 to 16380, and my speed range is 0 to 42. Provide a solution. – Sulaiman Ayub Sep 04 '15 at 18:15
  • Give me the code for pid ocntroller that is properly scaled to that range – Sulaiman Ayub Sep 04 '15 at 19:14
  • Again, I have no idea why your microcontroller won't run floats, or why you can only use 43 values for speed. I don't know anything about your accelerometer. Please post everything I asked for above - code, labeled picture, and data sheets. – Chuck Sep 04 '15 at 21:54
  • My accelerm is mpu6050, microtlr is 8051 8bit. 1 is main 8051 controlr that controls other 4 8051's . Those 4 controls the esc. The main 8051 has 4ports, 8bit all. In every port 6bits/pins are dedicated to a 8051. So remained pins are 32-24= 8 pins. In these pins 4 are for reciever, and 2 are for mpu6050 i2c interface. I have 2 pins free now,. So thats why i use 42 values cause bits are 6. – Sulaiman Ayub Sep 04 '15 at 22:18

1 Answers1

0

The propellers convert a rotary speed into thrust. You should still be controlling the motor speed. The un-modified output of a PID controller should be the input to your plant/system.

Chuck
  • 16,061
  • 2
  • 18
  • 47
  • Thrust is force so it has acceleration, that is it will increase the speed with time and height will increase at 2nd order. – Sulaiman Ayub Sep 04 '15 at 12:36
  • @SulaimanAyub Height has nothing to do with stability. The controller is a controller - it will automatically adjust the motor signal until the output matches the input. See my comment on your question. – Chuck Sep 04 '15 at 17:23