C++ VEXCode V5 Text Tutorials - Autonomous PID and Multitasking

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

КОМЕНТАРІ • 62

  • @sangamchapagain160
    @sangamchapagain160 4 роки тому +14

    Thank You so much. Your videos are the best to program VEX v5 Robots. I would love to see some videos of autonomous and driver control for actual competition robots that have 4 motors drivetrain, two intake rollers, a lift, and a tilter.

  • @virto716
    @virto716 3 роки тому +13

    Thanks. But can you please zoom in? With control+up/down

  • @deuseldorfgaming1270
    @deuseldorfgaming1270 4 роки тому +4

    if I'm trying to do this with 4 motors do I create a new value of leftSidePosition and make it an average of the two motors? And does that go inside of the drive PID or outside of it?

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

      Did you figure this out? I'm wondering the same thing.

    • @patronum213
      @patronum213 2 місяці тому

      I know it's been 3 years and you've probably graduated but yes, you could either create a new variable which is the average of the two left motors (and the same for the right) and then set averagePosition to the average of those 2, or simply set it to the average of all 4 motors (or however many motors you're using). regardless of what you chose, the variables should be inside of drivePID between rightMotorPosition and averagePosition.

  • @arete1776
    @arete1776 2 роки тому +3

    Hi! Is there any way I could use an inertial sensor instead of the build in motor encoders for the turning PID? Thanks!

    • @adamsalem-s
      @adamsalem-s 2 роки тому

      Yes! Don’t get stuck on watching tutorials forever just modify the code yourself! See if it works

  • @rz-zl4vk
    @rz-zl4vk 2 роки тому +2

    I am wondering if it is possible to do this in v5 text instead of pro

  • @XXestential-crisis
    @XXestential-crisis 4 роки тому +6

    Could you explain to me the difference between bool, int, void, and double? Thanks!

    • @rahilshah6337
      @rahilshah6337 4 роки тому +5

      bool is a variable that is assigned either true or false
      int is a function that returns a number
      void a function that actually makes the robot do something
      double is a variable that is assigned a number

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

      ua-cam.com/video/wv89hHjXM0Y/v-deo.html

    • @ThespianDevil
      @ThespianDevil 11 місяців тому

      @@rahilshah6337 it's been 3 years, but double also can go into decimal points, where as integer cannot

    • @gage9775
      @gage9775 21 день тому +1

      @@ThespianDevil and an int isn't only a function but can just be a plain number, though either way it returns a number.

    • @ThespianDevil
      @ThespianDevil 21 день тому

      @@gage9775 Oh, right. Thanks for adding🙏

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

    I was wondering what some other people values were for KP KI and KD. I understand they will likely vary for everyone but I just want to see what others have had in the past

  • @desiama9764
    @desiama9764 4 роки тому +2

    Had a question. If i were to do degrees than voltage i would just /360 instead of 12 right?. would that be the only change.

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

    @TVA1814DeltaIII
    can you explain how to tune the robot more in depth?

  • @Ramennozzles
    @Ramennozzles 10 днів тому

    20:28 for the drive code

  • @YuvraajSingh-h4e
    @YuvraajSingh-h4e 11 днів тому

    Is this with imu/interial sensor?

  • @inventor2990
    @inventor2990 2 роки тому +2

    I know this is late to the party but what is desired value? Is it related to odometry?

    • @axl-pt3ou
      @axl-pt3ou 2 роки тому

      Desired value is where you want the robot to go (please correct me if im wrong).

    • @KlimVoroshilov-vg8wz
      @KlimVoroshilov-vg8wz 2 роки тому

      Basically how much you want the motors to spin for

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

    Great video

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

    So i downloaded your latest version of this on the forum and tried to use it. When I run auto nothing happens. Any idea why?

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

    is a sleep a task_delay for PROS?

  • @drftghjn-nr9qn
    @drftghjn-nr9qn 5 місяців тому

    This made a lot of sense. Can you please try to speak slower in the future videos? Thanks so much!

  • @waffles._.25
    @waffles._.25 3 роки тому

    Would this PID still work on a four motor drive, if I pair the 2 motors on the left as a motor group and pair the 2 motors on the right as well? Or would I need to make new modifications from this program?

    • @valeriaramirez9419
      @valeriaramirez9419 3 роки тому +1

      Yeah, you could do it. You don't even necessarily need to make it a group, just do the exact same thing to its respective side. So like :
      leftFront.spin(forward, lateralMotorPower + turnMotorPower, voltageUnits::volt);
      leftBack.spin(forward, lateralMotorPower + turnMotorPower, voltageUnits::volt);
      rightFront.spin(forward, lateralMotorPower - turnMotorPower, voltageUnits::volt);
      rightBack.spin(forward, lateralMotorPower - turnMotorPower, voltageUnits::volt);
      instead of the individual left and right sides and then also make sure getting the positions for all four motors, and resetting the sensors for all four motors, but other then that it should be almost identical.

    • @waffles._.25
      @waffles._.25 2 роки тому

      @@valeriaramirez9419 oh thank you. But if use individual motors, what should I write for the error?

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

    how do you convert the units, like how do you know how long it goes

  • @cameronconger385
    @cameronconger385 4 роки тому +1

    i am new can i get help for my robot

  • @waffles._.25
    @waffles._.25 2 роки тому +1

    One question, how would I convert the motor ticks into mm? Great video btw :)

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

      1 rotation of your wheel would mean going the diameter of your wheel forward/backwards
      Distance = diameter * gearRatio * rotations

  • @255Moon
    @255Moon 2 роки тому

    Is the left and right motor the motors for the drivetrain?

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

      if you called them like that in your code then yes

  • @e--5
    @e--5 2 роки тому

    I dont quite know how to actually make my robot move forward with this. Changing the desired value seems to do nothing and driving it normally in auton i cant notice a difference even with the gains set really high or low.

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

      just wondering if you have figured this out? I am having the same problem also.

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

    when will be your next video adn what will it be on??

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

    enableDriverPID is true, and while(enableDriverPID) {} will be a dead loop. I wonder when the loop should be stopped.

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

      loop is stopped when you set enableDriverPID = false; when driver control starts

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

    How would you do this for a single motor?

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

      ^ Answers the question

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

      @@TVA1814DeltaIII would you be able to send this so i can dissect this further

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

    Okay so if I wanted to use PID but using Rotations what would I need to change in this code?

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

      Hello! I was just wondering if you figured this out since I'm trying to do the same thing? Thanks!

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

      Well I mean, say you wished to move 500 rotations with your motor. Tare your encoders, set 500 encoderunits as your target, and while the current encoder reading of the motor does not come within some amount of the target, run the PID loop.

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

    Why you add the results of the both pid in the motor code?

    • @rahilshah6337
      @rahilshah6337 4 роки тому +3

      if you say that you set desiredValue to 300 and then desiredTurnValue to 300, then the robot will drive in a sort of curved line, not straight. If you set desiredValue to 300 and desiredTurnValue to 0, then the robot will drive in a straight line. If you set desiredValue to 0 and desiredTurnValue to 300, then the robot will point turn.

  • @a.c.2659
    @a.c.2659 2 роки тому

    How could i modify this code so that it accepts inches or mm?

    • @a.c.2659
      @a.c.2659 2 роки тому

      It is urgent any help will be appreciated

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

    I just want to rotate my robot 90 degrees with pid, how can I do that basically? can you share the code with me?

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

      you find out how many ticks/degrees/... the motors have to turn the robot rotate 90 degrees (do the algebra with your gear ratio), then you set turnDesiredValue to that

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

      @@amongus4543 actually i just have an inertial sensor and i don't know how can i do this. could you explain that specifically?

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

      @@borasaltk7702 well, I you have to set the turnDesiredAngle to whatever absolute angle (in relation to the orientation you had while initializing) you want. The actual turn position is then your Inertial sensor's rotation value

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

    Thank you so much!

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

    How would I adapt this to a set amount of distance in autonomous?

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

      you would calculate how many rotation of your wheel the distance would be, and the use the number of rotations, or convert that to whatever measurement you want like degrees.

  • @f4llvortex576
    @f4llvortex576 4 роки тому +2

    Hey man I want the full auton code rn

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

    hi~ I want to seek cooperation with you!
    Is there any way I can talk to you?
    Discord?