Log in

View Full Version : Mecanum Trouble


REDBARON
27-01-2015, 18:40
Our team is trying mecanum this year with four Talon SRXs and CAN, however we've been having troubles with the motors not behaving as expected, we are aware that the code from NI is not correct, but we've tried various configurations, and nothing has worked, we've ensured our SRXs are ID-ed properly yet still the code refuses to work, forward/backward, and rotate will work fine but strafing fail, or strafing and rotate work but forward/backward fail, all help is appreciated,
-Jack

Ether
27-01-2015, 18:44
forward/backward, and rotate will work fine but strafing fail, or strafing and rotate work but forward/backward fail, all help is appreciated,

Run this test (http://www.chiefdelphi.com/forums/showpost.php?p=1429849&postcount=3) and post your results here.

Ether
27-01-2015, 18:46
Run this test (http://www.chiefdelphi.com/forums/showpost.php?p=1429849&postcount=3) and post your results here.

Also, tilt your bot on its side and take a picture of the bottom showing all 4 wheels. Post the picture here.

REDBARON
27-01-2015, 21:30
Update: we achieved strafing and forward/backward, but rotation is not working, the front motors run forwards and the back backwards, or vice-versa based on direction of rotation, so that all motors are pulling outward and are fighting each other, the wheels are arranged in the proper X-formation, we arranged our input values and everything else is functioning properly, here is the code we used that fixed the problem: http://pho.to/8fJab from this thread: http://www.chiefdelphi.com/forums/showthread.php?t=132800&highlight=mechanum
We also used this link to setup or rotation values: http://www.pobots.com/files/8213/5726/0394/mecanum.pdf
Again, all help is appreciated,
-Jack

Ether
27-01-2015, 21:48
the wheels are arranged in the proper X-formation

As viewed from the top of the bot, or from below? (They won't be the same).


we achieved strafing and forward/backward, but rotation is not working... Again, all help is appreciated

Do this:
http://www.chiefdelphi.com/forums/showpost.php?p=1434889&postcount=2

Dawg2T4
27-01-2015, 22:19
The wheels are arranged in the proper X as viewed from the top of the bot, as I believe they should be. Right now, sending a pure forward, backward, left, or right signal has the bot going in the right direction. The rotate, however, has all of the wheels going outward from each other (the two front go forward while the two back go backward) or all inward (front go backward, back go forward).

Ether
27-01-2015, 22:24
The rotate, however, has all of the wheels going outward from each other (the two front go forward while the two back go backward) or all inward (front go backward, back go forward).

Which rotate command direction (clockwise or counterclockwise) corresponds to which behavior (all outward or all inward)?

Ether
27-01-2015, 23:07
From the top, the wheels should look like a diamond, an X from the bottom.

The above advice is incorrect.

From the top, rollers should look like X.
From the bottom, rollers should look like diamond.

http://www.chiefdelphi.com/forums/showpost.php?p=907174&postcount=18

Cecil
27-01-2015, 23:20
The above advice is incorrect.


You got me there... My interpretation of "X from the top" is different than others apparently. After looking at the linked PDF, based on the description the wheels are in the correct orientation.

My apologies.. Carry on..

(I often describe it to the team as diamond from the top because the rollers face each other in a diamond shape. Guess I should tell them differently. Never thought to look at the way the rollers relate to each other...)

Ether
27-01-2015, 23:35
Which rotate command direction (clockwise or counterclockwise) corresponds to which behavior (all outward or all inward)?

If a rotate clockwise command causes all the wheels to run outward you need to swap the FrontRight and BackLeft motor commands.

If a rotate clockwise command causes all the wheels to run inward you need to swap the FrontLeft and BackRight motor comands.

Others here can advise you how to do that in the software, or you can swap the appropriate motor wires.

Levansic
28-01-2015, 01:23
Outward or inward is a bit confusing, try looking directly at the wheels from the outside of the robot, while the robot is elevated and not touching the floor. If you crank the joystick clockwise, all of the wheels should appear to turn counter-clockwise, when viewed from the outside. Take note of the ones that are going clockwise.

Go into begin.vi, and right-click on the terminal on the left side of the 4-motor drive open vi, that matches the inversion for the motors which spin clockwise. Click on the new boolean constant to turn it from false to true. Do this for all motors that are turning the wrong way.

If you have trouble finding the motor inversion terminals (which likely are unconnected), use Control-H to bring up the context-sensitive help, and mouse over the drive open vi.

All of this assumes that your motors are called in the correct position. In most cases, you will likely have to invert two of the four motors.

Ether
28-01-2015, 01:45
Outward or inward is a bit confusing

He defined exactly what he meant by those terms in his earlier post:

The rotate, however, has all of the wheels going outward from each other (the two front go forward while the two back go backward) or all inward (front go backward, back go forward).

... but he didn't clearly specify which rotate command (clockwise or counterclockwise) was causing which wheel motion ("outward" or "inward").



If you crank the joystick clockwise, all of the wheels should appear to turn counter-clockwise, when viewed from the outside. Take note of the ones that are going clockwise.

Go into begin.vi, and right-click on the terminal on the left side of the 4-motor drive open vi, that matches the inversion for the motors which spin clockwise. Click on the new boolean constant to turn it from false to true. Do this for all motors that are turning the wrong way.

If he does what you recommended above, it will fix the rotate problem, but break the forward/reverse and strafe right/left motions which are presently working correctly.

What he needs to do is swap the FrontRight and BackLeft motor commands (if the rotate clockwise command is causing the wheels to turn "outward") or swap the FrontLeft and BackRight motor commands (if the rotate clockwise command is causing the wheels to turn "inward").

All of this assumes that your motors are called in the correct position. They are not. That's the problem.

Ether
28-01-2015, 10:14
What he needs to do is swap the FrontRight and BackLeft motor commands (if the rotate clockwise command is causing the wheels to turn "outward") or swap the FrontLeft and BackRight motor commands (if the rotate clockwise command is causing the wheels to turn "inward").

The attached chart (http://www.chiefdelphi.com/forums/attachment.php?attachmentid=18022&stc=1&d=1422458124) shows the situation if OP meant to say that a rotate clockwise command
caused the front wheels to rotate forward and the back wheels to rotate backward.


Green means wheel rotation forward
Red means wheel rotation backward
Columns B D F H J L show what it should be
Columns labeled "?" show what it is actually doing (per OP's testing)


As you can see, swapping the FrontRight and BackLeft motor commands will correct the problem:

the RCW and RCC will be corrected, and
the already correct FWD, REV, STR, & STL will be unaffected

Dawg2T4
28-01-2015, 16:55
Just for some clarification, when you say swap the Front Right and Back Left motors, do you mean within the HolonomicDrive.vi, or is there a place within the teleop.vi to do that? Our Build session starts in about half an hour, so we can tell how well it worked then.

Ether
28-01-2015, 17:26
Just for some clarification, when you say swap the Front Right and Back Left motors...

Just to be clear, I said swap the motor commands, not the motors. This can be accomplished in software, or in hardware by swapping the motor wires (while leaving the motors themselves unmoved). Swapping the physical motors themselves would serve no purpose here.

do you mean within the HolonomicDrive.vi, or is there a place within the teleop.vi to do that? Our Build session starts in about half an hour, so we can tell how well it worked then.

I don't do LabVIEW. Do whatever you have to do so that the motor commands are swapped. What that means is this:

the command that presently is going to the FrontRight motor should be sent instead to the BackLeft motor, and


the command that presently is going to the BackLeft motor should be sent instead to the FrontRight motor


I think that can be accomplished in the Begin vi, wherever you assign the CAN addresses for the 4 motor locations. If there are any LabVIEW gurus reading, please chime in here.


PS: you never did answer this post (http://www.chiefdelphi.com/forums/showpost.php?p=1435009&postcount=7). It's important; it determines which motor commands should be swapped.

Alan Anderson
28-01-2015, 17:39
Swap them in Begin, making the inputs to the Open 4 Motor Drive match the actual motors on the robot.

Dawg2T4
28-01-2015, 18:15
Sending the robot a clockwise signal makes all of the wheels turn inward towards each other. When we made the change for the motor commands all it did was changed the strafing to the all in/out command and changed what we wanted the rotation to be to strafing.

Dawg2T4
28-01-2015, 18:29
Here's a screenshot of our code, just to reiterate, this is the code that has forward, backward, and strafing correct but has a problem with rotating. When we try to rotate clockwise the robots wheels all run inward (meaning, the two front wheel go backward and the two back wheels go forward) and when we try to rotate counterclockwise the wheels go outward (the two front go forward and the two back go backward).

Begin

http://i278.photobucket.com/albums/kk84/DawgThePorcupine/ScreenshotBegin_zpsf197473d_1.png (http://s278.photobucket.com/user/DawgThePorcupine/media/ScreenshotBegin_zpsf197473d_1.png.html)

Holonomic

http://i278.photobucket.com/albums/kk84/DawgThePorcupine/ScreenshotMecanum_zps1bc5647b_1.png (http://s278.photobucket.com/user/DawgThePorcupine/media/ScreenshotMecanum_zps1bc5647b_1.png.html)

Teleop

http://i278.photobucket.com/albums/kk84/DawgThePorcupine/ScreenshotTeleop_zpsaf308811_1.png (http://s278.photobucket.com/user/DawgThePorcupine/media/ScreenshotTeleop_zpsaf308811_1.png.html)

Ether
28-01-2015, 18:42
Sending the robot a clockwise signal makes all of the wheels turn inward towards each other.

If that's the case, the change you should have made, according to previous posts, is to swap the FrontLeft and BackRight motor commands. Is that what you did?

If not, undo what you did and make the correct change.


PS: you never did answer this post (http://www.chiefdelphi.com/forums/showpost.php?p=1435009&postcount=7). It's important; it determines which motor commands should be swapped.

What he needs to do is swap the FrontRight and BackLeft motor commands (if the rotate clockwise command is causing the wheels to turn "outward") or swap the FrontLeft and BackRight motor commands (if the rotate clockwise command is causing the wheels to turn "inward").

If a rotate clockwise command causes all the wheels to run outward you need to swap the FrontRight and BackLeft motor commands.

If a rotate clockwise command causes all the wheels to run inward you need to swap the FrontLeft and BackRight motor commands.

Ether
28-01-2015, 19:40
Sending the robot a clockwise signal makes all of the wheels turn inward towards each other. When we made the change for the motor commands all it did was changed the strafing to the all in/out command and changed what we wanted the rotation to be to strafing.

What change did you make?

Looks like the change was not done properly.

Please post LabVIEW png snippet of before & after code.

REDBARON
28-01-2015, 19:40
If that's the case, the change you should have made, according to previous posts, is to swap the FrontLeft and BackRight motor commands. Is that what you did?
Yes that is what we have done, we have tried it swapped and not swapped and neither ways work, when swapped if we give a pure clockwise command both sides run inward, sorry if I am repeating things, I just want to make sure everything is clear,
-Jack

REDBARON
28-01-2015, 19:56
What change did you make?

Looks like the change was not done properly.

Please post LabVIEW png snippet of before & after code.





Before:
http://s278.photobucket.com/user/DawgThePorcupine/media/ChangeNotMade_zps2215be2e_1.png.html?sort=3&o=1

After:
http://s278.photobucket.com/user/DawgThePorcupine/media/ChangeMade_zpsd42fddba_1.png.html?sort=3&o=0

Ether
28-01-2015, 20:12
Sending the robot a clockwise signal makes all of the wheels turn inward towards each other. When we made the change for the motor commands all it did was changed the strafing to the all in/out command and changed what we wanted the rotation to be to strafing.

I don't know what change you made, but it didn't swap the suggested motor commands. The behavior described above is not consistent with the change suggested.

Swapping the FL&BR motor commands should have had no impact at all on the strafe command. And it should have corrected the rotate behavior.

This is assuming that you have provided accurate test data about wheel direction in response to fwd/rev and strafe left/right as shown in the attached chart.

Would you please post the before and after code as a LabVIEW PNG snippet as an attachment here on CD.

REDBARON
28-01-2015, 20:19
Sorry, had some problem with posting the picture of the code. It's updated now with a link to each instance of the code.

REDBARON
28-01-2015, 20:24
Swapping the FL&BR motor commands should have had no impact at all on the strafe command. And it should have corrected the rotate behavior.

Strafing worked fine, it was during rotation (specifically clockwise) that both sides turned inward.

Ether
28-01-2015, 20:33
When we made the change for the motor commands all it did was changed the strafing to the all in/out command and changed what we wanted the rotation to be to strafing.

Swapping the FL&BR motor commands should have had no impact at all on the strafe command. And it should have corrected the rotate behavior.

Strafing worked fine, it was during rotation (specifically clockwise) that both sides turned inward.

????

REDBARON
28-01-2015, 20:38
Here are the attachments, in order before and after.

REDBARON
28-01-2015, 20:45
????




Sorry there was a miscommunication. With the motors FL & BR switched strafing and forward/backward work fine but rotation does not work, with them not switched, using rotation buttons causes strafing, and strafing fights itself.
The miscommunication was that the "change" in question was not clearly defined, as we had already left yesterday with that change made and the rotation still wasn't working. Sorry about that.

Cecil
28-01-2015, 21:00
Hold on a second, I think I know what's going on. On the "Open 4 Motor.vi", there are actually 4 terminals to invert motors. It looks like you have both of the bottom ones set to true and the top two unwired (which defaults to false). This would mean that Both your front left and front right motors are inverted, but not the other ones. Your inversions should match on sides, not front to back. I have attached a photo that should explain it a bit better.

Try going back to the default code (run the wires directly from the joystick axes to the holonomic vi) and see if inverting the correct motors fixes everything for you. If you push the joystick forward, and the robot moves backwards, switch the inversions to the right side instead.

REDBARON
30-01-2015, 18:32
We've sorted out the rotation problems by coding in a button that switches to arcade and using that to rotate, however we have noticed that strafing remains on the x-axis. but the y-axis causes rotation. we would like to resolve this and have the y-axis remain the same and the x-axis change

Dawg2T4
31-01-2015, 17:37
Hey guys, sorry its been a while, but we still dont have a solution. We did find out our Talons were not ID'd correctly and we have fixed that. So here's the situation.
We changed the Holonomic.vi so that the values were correct. After a few more tests, we swapped the X and Y-axis wires that lead into the Holonomic.vi in teleop. We ended up having something similar to arcade drive, but with the Z-axis of the controller being used for strafing, and the strafing malfunctioning so that the wheels in front both ran forward, and the back ones ran back, rather than strafing right, and the front ran backwards, and the back forwards, rather than strafing left.

Dawg2T4
05-02-2015, 18:56
Very strange happenings!

So, needless to say, your guys' fixes worked. The reason it didn't help us at first is because we had a Talon IDing issue on our Mobile Test Bed. Then, when we decided to code the drive on our smaller test bed, something very strange happened. Every time we issued a forward signal to the roboRIO, the motors on our test bed ran backwards. After losing a lot of sleep and a lot of troubleshooting, we found out that the smaller motors on our test bed (the bag motors) run reverse of the Mini Cims, which made testing very confusing. Very strange!