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.
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?
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.
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
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
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?
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.
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.
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.
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.
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 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
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.
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.
Thanks. But can you please zoom in? With control+up/down
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?
Did you figure this out? I'm wondering the same thing.
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.
Hi! Is there any way I could use an inertial sensor instead of the build in motor encoders for the turning PID? Thanks!
Yes! Don’t get stuck on watching tutorials forever just modify the code yourself! See if it works
I am wondering if it is possible to do this in v5 text instead of pro
Could you explain to me the difference between bool, int, void, and double? Thanks!
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
ua-cam.com/video/wv89hHjXM0Y/v-deo.html
@@rahilshah6337 it's been 3 years, but double also can go into decimal points, where as integer cannot
@@ThespianDevil and an int isn't only a function but can just be a plain number, though either way it returns a number.
@@gage9775 Oh, right. Thanks for adding🙏
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
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.
I'm also wondering this :/
I tried this and it seemed to work
@TVA1814DeltaIII
can you explain how to tune the robot more in depth?
20:28 for the drive code
Is this with imu/interial sensor?
I know this is late to the party but what is desired value? Is it related to odometry?
Desired value is where you want the robot to go (please correct me if im wrong).
Basically how much you want the motors to spin for
Great video
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?
is a sleep a task_delay for PROS?
This made a lot of sense. Can you please try to speak slower in the future videos? Thanks so much!
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?
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.
@@valeriaramirez9419 oh thank you. But if use individual motors, what should I write for the error?
how do you convert the units, like how do you know how long it goes
i am new can i get help for my robot
One question, how would I convert the motor ticks into mm? Great video btw :)
1 rotation of your wheel would mean going the diameter of your wheel forward/backwards
Distance = diameter * gearRatio * rotations
Is the left and right motor the motors for the drivetrain?
if you called them like that in your code then yes
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.
just wondering if you have figured this out? I am having the same problem also.
when will be your next video adn what will it be on??
enableDriverPID is true, and while(enableDriverPID) {} will be a dead loop. I wonder when the loop should be stopped.
loop is stopped when you set enableDriverPID = false; when driver control starts
How would you do this for a single motor?
^ Answers the question
@@TVA1814DeltaIII would you be able to send this so i can dissect this further
Okay so if I wanted to use PID but using Rotations what would I need to change in this code?
Hello! I was just wondering if you figured this out since I'm trying to do the same thing? Thanks!
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.
Why you add the results of the both pid in the motor code?
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.
How could i modify this code so that it accepts inches or mm?
It is urgent any help will be appreciated
I just want to rotate my robot 90 degrees with pid, how can I do that basically? can you share the code with me?
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
@@amongus4543 actually i just have an inertial sensor and i don't know how can i do this. could you explain that specifically?
@@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
Thank you so much!
How would I adapt this to a set amount of distance in autonomous?
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.
Hey man I want the full auton code rn
12:29
hi~ I want to seek cooperation with you!
Is there any way I can talk to you?
Discord?