Arduino DRONE II Part 2 IMU and PID

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 129

  • @ELECTRONOOBS
    @ELECTRONOOBS  7 років тому +17

    I couldn’t manage to make the drone fly straight. I couldn’t find the correct PID values. I’ve made 100 tests and still noting. Stay tuned for future updates. You could always use the MultiWii platform. Also, if you consider helping my projects chek my Patreon: www.patreon.com/ELECTRONOOBS
    I hope that you'll be able to learn sommething new with this video.

    • @Roxor05
      @Roxor05 7 років тому +5

      The plot twist was awesome :D
      In the TWO axis file you made a mistake in the pid section. "if(pitch_PID < -4000){pitch_PID=-400;}" I think you want that to be 400 instead of 4000. I know you propably found it, but if somebody uses the code from your site will pull their hair, why is it not working.. :D
      BTW if you want to improve the quality of your code, make sure that you put every group of functions into a different tab. It's like using separate classes in .h and .cpp files, but simpler. (I have separate tabs for: Setup-Loop, Transmitter, IMU, PID, Motor control, Telemetry, LED signals.) It makes much easier to read the code.
      I hope that both of us will be able to tune the pid. :D
      Cheers!

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +3

      Ferenczi Csongor thank you very much!!!

    • @Roxor05
      @Roxor05 7 років тому

      Electronoobs You're welcome. :)

    • @garethronaldo8692
      @garethronaldo8692 7 років тому

      Have you check weight on each side? i think it's not symmetric

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +1

      I will never be perfectly symmetric. The idea of the PID is that even with bigger load on one side it should fly streight. On of the PID tests is to hang sommething on one side of the bar and it should always fly horizontal. I'll improve the code... Keep up!

  • @tugaric
    @tugaric 7 років тому +5

    As a tip to anyone trying to build a quad with the mpu6050, calculating the pitch and roll angles the way he did is wrong, you are gonna encounter problems, with rotations around the z- axis.
    You can test it yourself. 1) Implement his code so that you get an angle that's calculate only with the gyro values.
    pitch = gyro_x * dt and print the values to the serial port.
    Now starting at 0° if you rotate around x or y to 45° for example and then rotate around yaw, you'll see that the angle won't change or just a bit. If you now rotate back to the initial orientation the starting angle will be wrong.
    The correct formula is :
    phi = prevPhi + dt*(wx + wy*sinPhi*tanTheta + wz*cosPhi*tanTheta);
    For more information I'd recommend the following book: Rigid Body Dynamics for Beginners by Phil Kim
    or read this:
    andrew.gibiansky.com/blog/physics/quadcopter-dynamics/

    • @SithaSek
      @SithaSek 7 років тому

      Well, it is depend on the flight mode he is trying to program. In rate/acro mode you don't need to calculate the angle of the IMU what you need is rate of velocity of the gyro. Only if Angle/Auto-level is programed for the quad you need absolute angle measurement. He is not mention about the flight mode he is trying to do though. One month agos I comment the same as you.

    • @tekken_king1151
      @tekken_king1151 6 років тому

      Can you please provide link to the equation above ??
      so from the equation you provided above , is it for Roll angle calculation ??

    • @debsarkar4893
      @debsarkar4893 8 місяців тому

      can someone plz say how to implement in his code

  • @vishal01mehra
    @vishal01mehra 7 років тому +11

    Thanks for your hardwork it's because of you we LEARN.

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +1

      Vishal Mehra thank you. I'm glad to hear that!

  • @dtpc_technologies
    @dtpc_technologies 7 років тому +16

    Hello,
    I think that the main problem resides in the code itself.. Let me explain..
    As in the flight controller the PID errors are calculated using the pitch and roll angles, the PID controller is unable to compensate for sudden changes in movement or sudden changes in rate of rotation..
    Let's consider an example.. Suppose that the refresh rate is 250Hz giving a loop time of 0.004s or 4ms.. Now let's consider that the drone is flying with zero roll angle, and suddenly due to wind the drone starts to rotate with a rate of rotation of 100 degrees per second.. In this situation the roll angle will change only by 0.0121 ((100/32.8) * 0.004) degrees in one loop, hence the PID error will be +/- 0.0121 which is "very small" to account for a 100 dps movement and hence the PID controller fails to stabilise the drone.. The same can be applied for pitch axis..
    According to me, the PID controller should be based on degrees per second movement and not on angles.. Also, do not use the map function as it don't work for floating point numbers and returns long (data type) values..
    Divyanshu

    • @francoisguyot789
      @francoisguyot789 5 років тому

      Interesting :) thanks but gyro is drifting..

    • @sumitrawat5317
      @sumitrawat5317 2 роки тому

      Bro can I use its flight controller code? Will it be worked with my drone?

  • @acegame1452
    @acegame1452 4 роки тому

    I believe (I might be wrong) that the unstable state of the drone was due to the use of Euler Angles which are susceptible to the gimbal lock phenomena. If you opted for a quaternion interpretation of the rotation maybe you would get better results even without extra sensors. To be clear this is not a critique but just an idea. Love your channel and your videos helped me so much through my thesis, so thank you.

  • @jeffisanon1
    @jeffisanon1 7 років тому

    Thank you for this information, watching your video and others is helping to put all the pieces of the puzzle together on how to program a diy flight controller.

  • @denizpnarl3059
    @denizpnarl3059 7 років тому +3

    Man, it was very nice that you built the control algorithm yourself and showed us. I was looking for such video for a long time. I think that you should take the yaw motion into account because when one or two motors try to compensate the disturbance, due to the conservation of angular momentum the yaw orientation of drone also changes. Also anti windup integral may help and probably with that much of code the refresh rate of arduino became insufficient. And you somewhat calibrated the gyro to assume the initial position of the drone to be flat by offsetting the initial reading, I think that should not be done. I also dont know how to control the yaw by the way, if you get it somehow please tell me also)

  • @giftgodswin3557
    @giftgodswin3557 5 років тому +1

    Hello my name is Gift, I love your video to me you are day best I'm learning from you as I'm also trying please keep up the good work

  • @suphisonerkaracay7766
    @suphisonerkaracay7766 7 років тому

    Oh man you're excellent :) I never undestood the PID in school.But at least now I have an small idea how it works and how to implement it on somethings like multicopter :)

  • @ali8067
    @ali8067 4 роки тому

    Love these video series, great man, really nicely done.

  • @djredrover
    @djredrover 2 роки тому +1

    Hey man, your problem isn't in your PID tuning, its in the actual structure of the drone. You see, you have programmed your software to assume symmetry, but your prop-arms are not symmetric about the roll-axis. Meaning, roll and pitch controls are not the same due to the angle of the prop-arms coming out of the center of the body.
    If you look at Falcon-9 grid fin orientation, they are separated by 90 deg giving identical roll and pitch ability, but if you look at the superheavy grid fins, they are at 120deg and 60 deg orientation, giving more control authority to pitch than roll (since the roll ability of the grid fins is much higher than pitch, I know i was confused at first too). I believe you have the same problem. Just orient your prop positions to be 90 deg apart.
    PS. even if you look at the other drone footage in your video that shows testing cage, those drones all have their props 90 degs apart.

  • @gunarajgajurel1932
    @gunarajgajurel1932 7 років тому +3

    You are a Genius. Love your Videos.

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому

      Thank you very much.

    • @gunarajgajurel1932
      @gunarajgajurel1932 7 років тому

      My pleasure. Actually was really impressed by your Electronic speed controller project and indeed it was a really complicated one.

  • @varnabhapatra6008
    @varnabhapatra6008 2 роки тому

    Hi electronoobs love you video from India

  • @widyahong
    @widyahong 3 роки тому

    10:35 you can test with 1 wire atached to load at bottom its more cheaper?

  • @vovanikotin
    @vovanikotin 7 років тому +4

    You need to make integral windup protection.
    Also calculating rol, pitch, and yaw angle as you made kind a bad idea. Euler angles in 3d rotation sometimes works bad (gimbal lock) = crash.
    You need to use quaternions instead of euler.
    read about this things

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +2

      Ave Vovus! Thanks, I'll definitely improve my code.

    • @johns66723
      @johns66723 6 років тому

      why are quaternions better ? I'm working on a similar project and i keep seeing this advice without explanation. please could you explain ?

    • @electrico799
      @electrico799 6 років тому

      As Ave stated to describe 3D rotations you need to use quaternions, you can search for "gimbal lock" and get a very detailed explanation.

  • @tszfunglo934
    @tszfunglo934 6 років тому

    good job! looking forward to ESCs PWM write part!!

  • @robertparenton7470
    @robertparenton7470 2 роки тому

    Thank You! From Frisco, TX

  • @debsarkar4893
    @debsarkar4893 8 місяців тому

    Dude 😎 u are an absolute legendary legit legend

  • @juniorfenelon5251
    @juniorfenelon5251 Рік тому

    Question: why is the servo library not used since it is usually used to control ESCs with BLDC motor? Please answer

  • @sophyreading7705
    @sophyreading7705 2 роки тому

    Thank you so much for sharing. I learned so much from your work. Thanks, heaps. 🤗

  • @crazysavage7840
    @crazysavage7840 7 років тому

    You are awesome man u teach so clearly now i am all clear i can make my own drone thanks a lot

  • @ELMO7TARAMQ8
    @ELMO7TARAMQ8 7 років тому +1

    there is a mistake in line 294 it should be (-400) not -4000 9:46. You probably forgot while typing

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +2

      ELMO7TARAMQ8 yes, you're the second person that tells me that. Already corrected that in the code on my webpage thanks again

  • @barcelona7991
    @barcelona7991 6 років тому

    Sir, i have a doubt... is it possible to use ur program for a drone which is not controlled by remote.... instead we r using GSM to controll the moment of drone.... Please answer fast !!!!

  • @RahulKumar-jm4yw
    @RahulKumar-jm4yw 2 роки тому

    Very good and easy explanation,.thanks a lot

  • @tirthrajgandhakwala6201
    @tirthrajgandhakwala6201 5 років тому

    What is the metal mechanism you have used to levitate drone with 4 rods in between.

  • @steevenm1345
    @steevenm1345 3 роки тому

    really nice video man ... I tried to make the same but the motors don't turn on ... i don't know why. Maybe the soldering ? or something esle ?

  • @kevalnakar6269
    @kevalnakar6269 2 роки тому +1

    I think you haven't included yaw values that's why it isn't flies perfectly

  • @minayakarimova
    @minayakarimova 3 роки тому

    Hi, thanks. i have a question. how can we make correction on gyro drift to make full imu code the help of magnetometer? i am using mpu9250

  • @chirayupurohit197
    @chirayupurohit197 4 роки тому

    Sir , can I use nodemcu instead of transmitter and reciver because it produce pwm output and control pwm using webpage.

  • @alphalimit8
    @alphalimit8 6 років тому

    my pwm output from pid calculation is responsive but when it write to esc ,the bldc response is slow(its like have some delay on it) so my quad can't stable in any pid constants that i tune..
    Please help how to make my esc reponse to fast with no delay ?( thanks.

  • @hansdegroot652
    @hansdegroot652 2 роки тому

    Sorry. I am trying to make some sort if uber walter scooter for my son using ovc pipes. Do you gave any suggestiin how to make a warercproof throttke?so novwater will get in the pvc pipes i tgought hall sendors vut they do not seem very good,at sensing range rgs just go on or jf and i would kiks ti avoid using 10 sensers. Or naybe veter use 2 push buttons

  • @bktechnologies88
    @bktechnologies88 2 роки тому

    This is great you taught me a lot I give a thumbs up 😍😍😍 and I've built mine but how can I add a barometric sensor if I add a barometric sensor do need to code what should I do 🙏

  • @wisehomo
    @wisehomo 4 роки тому

    First, I would like to thank you for sharing the knowledge and putting the effort into making educative videos with great illustrations and video editing.
    I really have something that's bugging me regarding how you calculate the angles using the linear acceleration. the MPU ciruit gives angles from the gyro sensors and linear acceleration from acceleration sensors. a rigid body in space can be fully defined kinematically by 6 DOFs ( 3 dispacements and 3 rotations). in the calculation of angle you seem to include the acceleration which you only account for 2% while 98% comes from gyro angular acceleration. I am also very confused on the formula used to compute angles using acceleration. because the gyro is attached to the body of interest (aircraft) angles should be only coming from gyros and if you want to control translation motion then you can but you will use the linear acceleration data. let me know what you think.

  • @crisscriss2943
    @crisscriss2943 3 роки тому

    Pregunta brother El control que colocas bajo que función de transferencia lo basas o es de la librería de Arduino?

  • @beyondlimitssss
    @beyondlimitssss 6 років тому

    instead of arudino nano we can use arduino uno...for two axis flight controller.

  • @نشوانالظاهر-م9ف
    @نشوانالظاهر-م9ف 2 роки тому

    How are you sir...Can you use the ADXL345 you want the MPU6050 because I don't have the MPU6050 and thank you

  • @abd-elrahmanmohamed9839
    @abd-elrahmanmohamed9839 6 років тому

    Really great . Thanks a lot !

  • @KARTIKCHDEY-ye1cg
    @KARTIKCHDEY-ye1cg Рік тому

    How do you power the arduino without cable from laptop source?

  • @kerimmoral
    @kerimmoral 7 років тому

    You havent done any coding to choose FS_Select=2 in Register 0x1B, so weren't you using default FS select=0? if so, weren't you suppose to divide gyro raw with 131?

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому

      If you go in the final 2 axis code in the setup loop you wil find this lines:
      Wire.beginTransmission(0x68); //begin, Send the slave adress (in this case 68)
      Wire.write(0x1B); //We want to write to the GYRO_CONFIG register (1B hex)
      Wire.write(0x10); //Set the register bits as 00010000 (100dps full scale)
      Wire.endTransmission(true); //End the transmission with the gyro
      Wire.beginTransmission(0x68); //Start communication with the address found during search.
      Wire.write(0x1C); //We want to write to the ACCEL_CONFIG register (1A hex)
      Wire.write(0x10); //Set the register bits as 00010000 (+/- 8g full scale range)
      Wire.endTransmission(true);
      This will setup the gyroand acc data to that range!
      Keep up!

  • @solitary062ak
    @solitary062ak 3 роки тому

    Help please
    If I want to compute value using a flight controller like Naza M, can I just use analogWrite(pwmPin, pwmInput) to send pwm signal?

    • @debsarkar4893
      @debsarkar4893 8 місяців тому

      pulseOut(pwmPin, pwmInput); works on arduino pins labelled with a "~" next to them like ~3 ~4

  • @rajatburmankp
    @rajatburmankp 7 років тому

    sir can i use bluetooth module? and operate by a smartphone...?

  • @dukedblu
    @dukedblu 7 років тому

    thank you very much for this vid!

  • @MCsCreations
    @MCsCreations 7 років тому +5

    Really, really nice work, man. :)

  • @mostafahady6538
    @mostafahady6538 6 років тому

    it's a good work man, i understood the main idea but i need to know why you use a value of pitch angle range as i deal with only one axis (i talk about the pid balance control ) i use that code but i didn't work with me , serial monitor of that code when i use it didn't begin , what do you think ??

    • @ELECTRONOOBS
      @ELECTRONOOBS  6 років тому

      I don't understand your question/problem.

    • @mostafahady6538
      @mostafahady6538 6 років тому

      Electronoobs , the code of pid balance control didn’t work for the test and serial monitor gives nothing when when move the gyroscope sensor

  • @vaibhavzade7040
    @vaibhavzade7040 7 років тому

    is it required only pwm transmitter or not...?

  • @SithaSek
    @SithaSek 7 років тому

    Hi, first of all congratulation on your new spanish channel. I want to see you get your flight software to fly. So another comment. I read your code you use the elapsedTime, time, timePrev;. I just want to suggest you to try cycle time like multiwii of 2800us or higher depend on your program run. using while loop to create cycle rate.

  • @piamsuknoipong3811
    @piamsuknoipong3811 6 років тому

    Thank you very much.

  • @garethronaldo8692
    @garethronaldo8692 7 років тому +1

    Dude you are awsome

  • @clintpereira4529
    @clintpereira4529 3 роки тому

    can this be used for Beta FPV drone

  • @shoshinschool2793
    @shoshinschool2793 7 років тому

    i am building a bicopter with arduino flight controller, please help me,share some important points you can tell ?

  • @kashishkitawatgo
    @kashishkitawatgo 7 років тому

    how can we make the same receiver using arduino ?
    in your previous video you made the receiver with arduino but the pwm values were coming out using only 1 pin..
    But i want to make the receiver using arduino where it has multiple pins for sending different pwm values of roll, throttle, yall & pitch

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому

      That receiver has PPM output not PWM. If you want PWM you should try a servo.writeMicroseconds() for each cahnnel and use a different pin for each one. Keep up!

    • @kashishkitawatgo
      @kashishkitawatgo 7 років тому

      yaa it is PPM. :)
      how can we do it using an arduino ?
      because if we can do that using arduino.. that receiver can be used anywhere like a normal receiver!!

  • @beyondlimitssss
    @beyondlimitssss 6 років тому

    where in the code we change the value of PID

  • @ais_robotic
    @ais_robotic Рік тому

    is possible to get lat lan from Apm2.8 by arduino ?? plz make a video on arduino Mavlink

  • @gouravsiddesh246
    @gouravsiddesh246 3 роки тому

    Bro try with 2212 motor and use Q450 frame and 30am esc it will be stable

  • @ParthBhat
    @ParthBhat 7 років тому +1

    Hey, thanks a lot for sharing. I always love watching your videos! , may I ask what editing softwares you use ? I am guessing adobe premier pro and after effects but still.
    Cheers!

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +1

      Just After Effects. I stoped using premiere...

  • @brundum
    @brundum 7 років тому

    how do I do it for Altitude control

  • @adelashour3253
    @adelashour3253 7 років тому

    sir how are you ,
    there is some thing i am working on in pid issue
    and there is some thing special about not calculating setpoint in an error term , i have perfect results when changing pid rules , more ditles when you respond
    more thing about using virtual wire instead interrupt routine details

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +1

      I don't follow you. Thanks !

    • @adelashour3253
      @adelashour3253 7 років тому

      ok,
      , i didnt mean to follow me , but it is just about acknowledge

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому +1

      Thank for everything but what I meant by don't following you is that I didn't fully understood your message. Keep up!

    • @adelashour3253
      @adelashour3253 7 років тому

      oh i am sorry for misunderstanding
      my friend
      i have been working on my cuad and i have always wondering why error = gyrovalue-setpoint
      why to add an necessary term to the PID equation , what i did simply is that i removed all the setpoint values from pid equations and i added them to the esc final signal drop calculations , the wonder result that i have achieved more stable cuad and when i searched about my way of PID i found that all scientific referances about this subject i found that (error = gyrovalue-setpoint) is a main truth in designing
      , so how my conclusions are correct!?
      is what i did a method of PID i dont know?
      if so why isnt it used in common cuadqopters or balanced systems?

    • @adelashour3253
      @adelashour3253 7 років тому

      to be more clear , i modfied Joop Brooking code, Brooking from Norway i am sure that you know him

  • @lurkingcorsa10
    @lurkingcorsa10 4 роки тому

    thnks dude, it could minimalize the fee 😁

  • @harunlisic
    @harunlisic 6 років тому

    This only works with ESC's and not Brushed Motors, make one with analogWrite(); pls

  • @georgesmukanku4891
    @georgesmukanku4891 6 років тому

    hello nice when you build the controller i like that

  • @ImranImran-pn3in
    @ImranImran-pn3in 7 років тому

    merci bcp.

  • @bujitron21
    @bujitron21 7 років тому

    👏👏👏👏

  • @adelashour3253
    @adelashour3253 7 років тому

    good

  • @beyondlimitssss
    @beyondlimitssss 6 років тому

    i m making quadcopter using arduino uno mpu6050 and hc05 bluetooth as a transreciever...i tried but there is some mistakes in my code..can u plzz check it and suggest the way to fix it
    #include
    #include "I2Cdev.h"
    #include "MPU6050.h"
    #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    #include "Wire.h"
    #endif
    MPU6050 accelgyro;
    int16_t ax, ay, az;
    int16_t gx, gy, gz;
    #define OUTPUT_READABLE_ACCELGYRO
    #define LED_PIN 13
    bool blinkState = false;
    //Create the 4 esc objects
    Servo esc1;
    Servo esc2;
    Servo esc3;
    Servo esc4;
    //Esc pins
    int escPin1 = 5; //back
    int escPin2 = 9; //left
    int escPin3 = 10; //right
    int escPin4 = 11; //front
    //Min and max pulse
    int minPulseRate = 1000;
    int maxPulseRate = 2000;
    int throttleChangeDelay = 50;
    //SETUP
    void setup()
    {
    #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    Wire.begin();
    #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
    Fastwire::setup(400, true);
    #endif
    Serial.begin(9600);
    Serial.println("Initializing I2C devices...");
    accelgyro.initialize();
    // verify connection
    Serial.println("Testing device connections...");
    Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
    //pinMode(2,OUTPUT);
    pinMode(3,OUTPUT);
    Serial.setTimeout(500);
    //Init escs
    initEscs();
    }
    //LOOP
    void loop() {
    //for led's
    // digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    // Wait for some input
    if (Serial.available() > 0) {
    // Read the new throttle value
    int throttle = normalizeThrottle(Serial.parseInt());
    // Print it out
    Serial.print(" Setting throttle to: ");
    Serial.println(throttle);
    // Change throttle to the new value
    changeThrottle(throttle);
    }
    }
    //Change throttle value
    void changeThrottle(int throttle) {
    int currentThrottle = readThrottle();
    int step = 1;
    if(throttle < currentThrottle) {
    step = -1;
    }
    // Slowly move to the new throttle value
    while(currentThrottle != throttle) {
    writeTo4Escs(currentThrottle + step);
    currentThrottle = readThrottle();
    delay(throttleChangeDelay);
    }
    }
    //Read the throttle value
    int readThrottle() {
    int throttle = esc1.read();
    Serial.print("Ct th is: ");
    Serial.print(throttle);

    return throttle;
    }
    //Change velocity of the 4 escs at the same time
    void writeTo4Escs(int throttle) {



    //for gyro
    accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
    #ifdef OUTPUT_READABLE_ACCELGYRO
    float x,y,z;
    x=(ax/131);
    y=(ay/131);
    z=(az/7072);
    Serial.print("a/g:\t");
    Serial.print(x); Serial.print("\t");
    Serial.print(y); Serial.print("\t");
    Serial.print(z); Serial.print("\t");
    //Serial.println();
    #endif
    #ifdef OUTPUT_BINARY_ACCELGYRO
    Serial.write((uint8_t)(ax >> 8)); Serial.write((uint8_t)(ax & 0xFF));
    Serial.write((uint8_t)(ay >> 8)); Serial.write((uint8_t)(ay & 0xFF));
    Serial.write((uint8_t)(az >> 8)); Serial.write((uint8_t)(az & 0xFF));
    #endif



    int A,B,C,D;
    C=throttle;
    A=B=D=C;
    //D=B;
    int yhigh=7;
    int ylow=3;
    int xhigh=15;
    int xlow=10;
    if(y=xhigh)
    {
    C-=3;
    B-=2;
    esc1.write(A);
    esc2.write(B);
    esc3.write(C);
    esc4.write(D);
    }
    else if(y>=yhigh)
    {
    C-=3;
    esc1.write(A);
    esc2.write(B);
    esc3.write(C);
    esc4.write(D);
    }
    else if(y=xhigh)
    {
    B-=3;
    esc1.write(A);
    esc2.write(B);
    esc3.write(C);
    esc4.write(D);
    }

    else if(x 80) {
    return 80;
    }
    return value;
    }
    plz check and help me to fix it

  • @gouravsiddesh246
    @gouravsiddesh246 3 роки тому

    Make the third part bro

  • @foxyrollouts
    @foxyrollouts 7 років тому

    maybe hobbyking has a complete unit you can plug in and reverse engineer

    • @foxyrollouts
      @foxyrollouts 7 років тому

      your test bar was not always leveling properly...could be due to pinch points

  • @paucliment9280
    @paucliment9280 7 років тому

    Then just get a betaflight compatible flight controller, and it will fly

  • @maheshpatil9589
    @maheshpatil9589 6 років тому

    Bro.... Where is library link....??

    • @ELECTRONOOBS
      @ELECTRONOOBS  6 років тому

      whar library do you need? Codes are in the description!

    • @maheshpatil9589
      @maheshpatil9589 6 років тому

      sorry bro....got it

    • @ELECTRONOOBS
      @ELECTRONOOBS  6 років тому

      Any Arduino IDE updated version should have that library.

  • @appadiya5634
    @appadiya5634 Рік тому

    👌👌good 👏👏🏁🏁🏁🏁

  • @viswanath7168
    @viswanath7168 5 років тому

    Sir please make a micromouse robot

  • @anooftech345k6
    @anooftech345k6 5 років тому

    Bro it name is eletronoob kid

  • @1st_ProCactus
    @1st_ProCactus 7 років тому

    Why even show the IDE with that font size, LOL

    • @ELECTRONOOBS
      @ELECTRONOOBS  7 років тому

      If you watch this on a smartphone, well sorry. The video is Full HD and I can perfectly see all the text on my screen. Sorry and keep up!

    • @1st_ProCactus
      @1st_ProCactus 7 років тому

      If you think that is fine to watch, then it's not my problem. I watch videos from atleast 1 meter from my large laptop. I dont watch video's in a typing position where I would clearly be able to read the very left edge of the screen where your code resides.
      Basically you think its fine because you can read it ?

  • @GeraMF
    @GeraMF 7 років тому

    good job if your need help to system control algorithm . write in my email i am working in fuzzy neural network , adaptive control

    • @GeraMF
      @GeraMF 7 років тому

      import numpy as np
      import matplotlib.pyplot as plt
      from module import *
      class Neuronal(object):
      def __init__(self, inputLayerSize,hiddenLayerSize,output):
      self.n1 = hiddenLayerSize
      self.n2 = inputLayerSize
      self.out=output
      def sigmoid(self,x):
      return 1 / (1 + np.exp(-x)) # activation function
      def tansig(self,n):
      y = (np.exp(n) - np.exp(-n)) / (np.exp(n) + np.exp(-n))
      return y
      def train(self,epochs,x1,y):
      ep=1
      alfa=0.01
      W1 = 2 * ep * np.random.uniform(size=(self.n1, self.out)) - ep
      b1 = 2 * ep * np.random.uniform(size=(self.n1, self.out)) - ep
      W2 = 2 * ep * np.random.uniform(size=(self.n2, self.n1)) - ep
      b2 = 2 * ep * np.random.uniform(size=(self.n2, self.out)) - ep
      W3 = 2 * ep * np.random.uniform(size=(self.out, self.n2)) - ep
      b3 = 2 * ep * np.random.uniform() - ep;
      l = len(x1)
      for i in range(epochs):
      sum = 0
      for q in range(l):
      a1 = self.sigmoid(W1 * x1[q] + b1)
      a2 = self.sigmoid(W2 * a1 + b2)
      a3 = W3 * a2 + b3
      e = y[q] - a3
      s3 = -2 * 1 * e
      s2 = np.diag((1 - a2) * a2) * W3.T * s3
      s1 = np.diag((1 - a1) * a1) * W2.T * s2
      W3 = W3 - alfa * s3 * a2.T
      b3 = b3 - alfa * s3
      W2 = W2 - alfa * s2 * a1.T
      b2 = b2 - alfa * s2
      W1 = W1 - alfa * s1 * x1[q].T
      b1 = b1 - alfa * s1
      sum = e * e + sum
      emedio = sum / l
      return a3
      def fun(x):
      return x*x*x+2*x+1
      #x1=np.array([-4,-3,-2,-1,0,1,2,3,4])
      #y=fun(x1)
      #P = np.array([[0 ,0, 1, 1],[0 ,1 ,0 ,1]])
      #T = np.array([-1, 1, 1, -1])
      #nn=Neuronal(4,4,1)
      #t=nn.train(600,P,T)
      #print len(P[1,:]) y
      #print t[1,:]
      #plt.plot(y,'ro')
      #plt.plot(t[1,:])
      #x=0
      #while True :
      # v = circle_trajectory(2, x, 0.1)
      # print v
      # plt.plot(v[0], v[1], 'ro')
      #plt.show()
      #x=x+1

    • @GeraMF
      @GeraMF 7 років тому

      #separa los valores del universo y de los de pertencia de la matiz
      # si la funcion de membresia es de tipo trapeziodal
      def fTra(A,x):
      # type: (Matrix, universo) -> object
      #interseccion de la funcion de membresia y singleton
      """
      :rtype: float
      """
      a = A[0]
      b = A[1]
      c = A[2]
      d = A[3]
      if xa and xb and xc and xd :
      p=0
      return p
      ################# Triangulo ###########################################
      #///separa los valores del universo y de los de pertencia de la matiz //
      #////si la funcion de membresia es de tipo triangular //////////////////
      def fTi(A,x):
      a = A[0]
      b = A[1]
      c = A[2]
      if x a and x b and x 0 and b_t>0 :
      Or=1
      return Or
      ######## AND difuso#############
      def t_norma(a_t,b_t,op) :
      if op==1 :
      And = min(a_t, b_t)
      if op==2 :
      And = a_t * b_t
      #####Producto drastico
      if op==3 :
      if b_t==1 :
      And=a_t
      if a_t==1 :
      And=b_t
      if a_t

  • @guitarguy3688
    @guitarguy3688 7 років тому

    Too complicated to understand