![]() |
Re: Controlling the individual speed of mecanum wheels within the main programme
If your robot drives OK, you may not have to do anything. You'll need to check with something close to the expected weight and weight distribution. You probably want to hook things up so that going forward has all four motors running faster than going in reverse -- this may mean you need to reverse the two motor wires that attach to the output of two of the speed controllers. This way, forward and reverse should work well. If rotation and going to one side or the other don't work as you like, you can reduce the power in the forward direction so that it matches that in reverse, via software. Of course, you'll only want to do this when you need to, not for forward and reverse. Hopefully, this makes sense...
|
Re: Controlling the individual speed of mecanum wheels within the main programme
I'm going to guess that you meant to do all the other things recommended here in this thread (i.e. write my own Mecanum code and place it into it's own method below the main method) and then modify the motor controller speeds as needed. I'm not on our development laptop right now, so I threw together the following code:
Code:
#include <WPILib.h> |
Re: Controlling the individual speed of mecanum wheels within the main programme
|
Re: Controlling the individual speed of mecanum wheels within the main programme
You have the right idea. I imagine a little trial and error will get you there!
It might be good to only apply the 'fix' logic if not all wheels are going in the same direction -- this way, you only cut the power if it is needed. Good luck, and if you have further trouble, just post... |
Re: Controlling the individual speed of mecanum wheels within the main programme
Hey! I just wanted to let you all know that the robot worked flawlessly :D I'll put up some pictures of the robot we built in four days when we can get a hold of a decent resolution camera. Thank you all so much! This is hands down the most helpful and informative thread I've ever seen. Much appreciated, CD.
|
Re: Controlling the individual speed of mecanum wheels within the main programme
Thanks for the update!
A further refinement would be to move the normalization to last -- in other words, add the 'fix' logic before the normalization is done. In case others come across this thread, you can compensate for a lot of things in software but, in general, when you have different wheels behaving differently, you should first look for other possible causes: - check for mechanical issues, make sure they all have the same feel, etc.; - check for electrical issues, lose connections, very uneven length wire runs with too-small gage wire, etc.; - consider swapping various components to see if you can isolate the source of the difference as this will provide insight into what is going on; - realize that some motors do have some bias for running faster in one direction than the other, this usually is going to be lost in the noise but it could be a factor; - be on the lookout for non-repeatable results, such as when things shift around without explanation from test-to-test (if you find yourself chasing a moving target, take a break and then think things through again). |
| All times are GMT -5. The time now is 21:21. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi