Okay first time posting and I don’t know what I’m doing, but I have a problem. One thing I’d like to note is my team put the motors on backwards because our team name is ScrewBalls so they thought it’d would fit and they refuse to fix them. Anyway, the controller’s controls are inverted. I’ve put in this code to fix it.
using namespace vex;
vex::motor LeftMotor(vex::PORT1, vex::gearSetting::ratio18_1, false);
vex::motor RightMotor(vex::PORT10, vex::gearSetting::ratio18_1, true);
vex::controller Controller1 = vex::controller();
LeftMotor.spin(directionType::fwd,(Controller1.Axis3.value() + Controller1.Axis4.value())/2, velocityUnits::pct);
RightMotor.spin(directionType::fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2, velocityUnits::pct);
The code fixes the controls for the joystick, moving forward and backwards, but it’s still inverted when trying to make the robot go left and right. I have no clue what to do. Can someone please help me.
First, get a handle on exactly what’s happening:
When you tell both motors to go forward, LeftMotor and RightMotor go forward, and you observe both your right motor and left motor going forward.
When you tell your robot to turn left, LeftMotor goes backwards and RightMotor goes forwards.
What you observe is that your right motor goes backwards and your left motor goes forwards.
Does phrasing it like that make the problem clearer?
Without saying too much, if your turning is inverted, then just “invert” the turning aspect of it in your code. I see you’re in IQ so I was just trying to guide you on your quest in finding the solution. If you still don’t understand what @John_TYler and I are trying to say, never be afraid to respond.
I unfortunately am still confused, should I change the fwd to rev? I have done that and it didn’t work, I’m still unsure.
As one last additional hint, LeftMotor does not necessarily refer to the motor on the left side of your robot. LeftMotor refers to the motor attached to, in your case, port 1, regardless of where that motor is actually mounted on your robot. Does your left motor do what you tell LeftMotor to do?
Or you could just, you know, turn the moters around. I know your screw balls but don’t make it harder on yourselves
Okay… so maybe tell your team that it is absolutely 100% useless to refuse to fix something that is easily repairable. I get having a funny team name to match, but you should probably discuss with them why that is so unnecessary and is just complicating things for you and them. Ask them, “Why should we waste our own time trying to figure this out instead of doing it the way we know will work?” I know that other people have good answers on here for how to program it, but just don’t over complicate things for yourselves, especially if you are new to IQ or programming in general. Again, I completely understand doing it for your team name, but that is just so unnecessary, and maybe you guys could come up with something else, like making a poster or a flag. Good luck!
I’m not new to programming, just new to the robot aspect of everything and I’ve never had to deal with backwards motors. They refuse to fix the wheels because they claim it will take to much time to reconfigure the gears they had attached with the wheels to make the wheels go faster, so I didn’t argue with them. You’d think they’d listen since I’m the only one who knows how to program in the group, but no.
tell them that it’s easier to fix the robot now than later. If they don’t adjust their robot at all throughout the season, the chances of your team succeeding, (no offense) are very slim as all the other teams will continue to develop and upgrade their bots.
If you’re going to upgrade, might as well do it now rather than later.
There is nothing wrong with your robot. So long as the motors are attached to the wheels, you can program them to work properly. Stop trying to blame your team for a minute (and stop listening to people telling you to blame your team) and do a good hard think about your code. You might find it educational to abandon arcade drive for testing and try running each motor individually. Your true problem should present itself quite quickly.
I dont really find @BRoberts problem to be about the current issue in particular. I understand why they would refuse to change out something so small, but if the team is unwilling to make such a small change as flipping the motor around, then that is concerning. What other small changes would they not be willing to make?
(Again, not pegging the blame on the teammates, I’m just saying that they should have better work ethic(is that the term?))
His problem is not the direction of the motors. His problem is 100% a code problem. He has his left and right motors reversed. No amount of direction switching will fix that.
Actually, I would strongly discourage that. As a team member, you are morally obligated to go with the final decision of the team, even if you disagree. To secretly change things against the will of the team violates the spirit of teamwork
If you want to flip the motors, tell the team first and then only do it if they agree
Ok guys, this is ridiculous.
The OP asked for help to configure his motors to drive forward properly. This can be easily solved using programming, and does not require any physical change. If you have disagreements with your team, solve them. It is an important aspect of educational robotics to be able to work as a team and work through disagreements. However, making a hardware change is completely unrelated to the original question, and not a proper solution.
It is unreasonable for anyone on this forum (who are mostly middle and highschool students) to give you advice for your team dynamics. They do not know your situation, and it is up to you to raise any concerns you have with your mentors or teammates. Arguing with your team to try and flip your motors (which probably won’t solve the problem) is not the solution. It is up to the program to adapt to the robot, not the other way around.
@John_TYler gave excellent, simple advice. Test each motor individually and find the direction for each that moves the robot forward. Then test the left side motors and then the right side motors. By that time, you should have figured out your problem, such as you have the right and left ports switched. Then come back with your results and if you have not solved the problem, you may ask one of us again for help.
For the record, he is not an IQ student. The snippet he posted was for VCS or VEXCode, signifying he is in VEX EDR. He just did not properly categorize the thread.
I’m gonna have to agree with Theo here.
- This should be in a EDR channel not an IQ one
- The problem was fixed after the first reply
- This is completely a software problem
- Sort out all of this team stuff in private. It has no relevance to the discussion and frankly is just stupid.
Yes you are completely and totally 100% right, and that is why I said that in no way is that the best idea. But here’s why I said it: having them backwards doesn’t contribute anything to the team except making it harder for to programmer and being all “ha-ha funny our bot matches our name.” Again you are 100% right, I guess I did get a little opinionated in saying that. But I do think that I am right in questioning why you wouldn’t fix something that can easily be fixed. Thank you for your input.
I did not realize I put this in the wrong thread. I apologize.