Here’s my program
I also redid all my wheels 2 times with new motors
Can someone help please thank you
Here’s my program
I also redid all my wheels 2 times with new motors
Can someone help please thank you
Are the wheels aligned correctly? flip it around and see if the wheels are aligned in a “X”
Are the motors totally not responding or…?
The set velocity block sets a motor’s velocity for the future. If you set the motor’s velocity to 10 percent, then whenever you spin it, it will try to spin at 10 percent speed.
You want the spin block instead.
Whenever I individually try all the motors they spin the wheels and yes they are in a X
It’s still doing the same thing forward will kinda turn it
I did both of those things but it still is the same
First, the code should go in the ‘when driver control’ section, not when started.
Second, save your project under a new name, then change the code to a simple tank drive. See if it works now. If so, your code is good, but your math (the plus minus commands) is wrong. If it still won’t work… start a new project from scratch… this one might have hidden issues.
Do you what plus and minus would be right for the program or is only some of my program wrong
Not sure. Would have to lookup the correct math for mec wheels. But if you follow those steps… it should lead you to an answer either way.
It goes forward now but doesn’t straft like it’s supposed to
Then it sounds like the code is flowing/processing properly. Looks like the problem might be the logic/math for the wheels.
First…
If you have not already moved them, place all 4 “spin” commands inside the forever loop after the “set” commands.
Second…
You may have some errors in how you are calculating the motor velocities from the joystick positions. We need to know your intended controller mapping to be sure and if you reversed any motors.
I am making these assumption from what I’ve read above…
If this is true, then what you have should work as long as your wheels are in the correct orientation (I often se negative sign errors when subtracting with the block code grouping, but you got it correct.)
Please tell us your control layout and confirm if you did reverse the right side motors.
Nice. Was focused on code/math and wheel assignment… forgot to make sure motor rotation was correct.
Also, I see a tiny bit of code in the upper edge of the screen. What is that? Do you have anymore ‘orphaned’ code in the window? That can cause problems also.
The alone blocks are my skills autonomous and my regular autonomous
First thing I would do would be to to set the left motors to normal and set both right motors to reverse. This will make a positive signal to both sides move the robot forward. most people prefer this. (I normally won’t reverse any motors for a holonomic drivetrain, but lets reverse both right motors in your case.)
A quick search led me to this site with a decent explanation of the basic wheel movements. CS-STEM Network
Here is a pic from that site that shows the force components applied by each wheel when rotating forwards. Read through it so you understand how the forces interact.
You want Channel 3 to move forward and from the pic, you can see that a positive to each motor will move the robot forwards. Ch 3 should be positive in all velocity formulas.
To strafe right (positive channel 4), leftfront and rightrear need a + signal, while leftrear and rightfront need a - signal. Channel 4 must have those signs in your velocity formulas
To rotate right (positive channel 1) both left motors need a +signal and both right motors need a -signal
so__________________________ regrouping for block code and consitent structure
leftfront = ch3 + ch4 + ch1 _______ ch3 + (ch4 + ch1)
leftrear = ch3 - ch4 + ch1 ________ ch3 - (ch4 - ch1)
rightfront = ch3 - ch4 - ch1 _______ ch3 - (ch4 + ch1)
rightrear = ch3 + ch4 - ch1 _______ ch3 + (ch4 - ch1)
in block code…
Hopefully this will straighten things out… remember to reverse only the right motors for this.
That worked thank you
Not sure if you’ve used mec very much. Few things worth noting.
good luck. glad you got it working.