![]() |
Re: Wheels spinning at different speeds program or electrical error?
Your CIMs may or may not be biased, but that's not the issue you need to chase first.
this line from your first post is what you need to address first Quote:
|
Re: Wheels spinning at different speeds program or electrical error?
The reason (or a possible reason) Grim Tuesday brought up encoders is because they can help you in correcting any bias that may pop up due to any issues, be it a mechanical or an electronic issue.
With an encoder, you can perform some higher-level programming and include features such as PID (proportional–integral–derivative) loops to account for error. For example, if your code is telling the wheels to spin at 2,000 RPMs (I know, not how it actually works, but bear with me), and the encoder says the wheels are only spinning at 1,800 RPMs, you can use your code to dynamically adjust the output until the wheels are all spinning at the same (and/or correct) rate. Simply multiplying the output by .96 because that's the error you measured once or twice is not a good programming habit to get in to. These "magic numbers" are bad practice because they make the code difficult to adapt later and the magic number that indeed performs magic may vary depending on the situation. Quote:
However, be aware that if you aren't pushing your joystick perfectly in one direction, all four values shouldn't be the same. I would recommend taking the joysticks' values and running them through the code yourself to see what is happening and what should (in your eyes) be happening. Also make sure you are working with freshly charged batteries. Poorly charged batteries can cause a number of problems. |
Re: Wheels spinning at different speeds program or electrical error?
I think the problem may be from me inverting some crap, which I was also thinking through and guess I'll just have to see that. My program makes it so that the joystick is directly controlling each motor. I have not subtracted the speed from any of the motors or interfered with that, so that's what is perplexing me. Again this basically only happens when strafing left and right, so that's just making me think more and more that it's my code since forward/reverse are near perfect
Edit: Oh that brings up another thing too we did test the voltmeter having the joystick in different directions and the voltage did go up when I was very close to horizontal. I probably need to get a joystick with notches or disable the y axis when the x axis is active then? |
Re: Wheels spinning at different speeds program or electrical error?
Quote:
My team has used mecanum for a number of years now with two joysticks. One joystick essentially provides arcade drive (y-axis controls forward/back, x-axis controls rotation), and the second joystick provides strafe on the x-axis. You don't need to disable the y-axis on the second joystick, you simply don't use any of the values it gives you. There are of course other control options that would require tweaking this a little. How are you planning on controlling it? |
Re: Wheels spinning at different speeds program or electrical error?
Right now it's set up so one joystick does it all (I just did it for fun and ease of carrying things around) Rotation of the joystick rotates the bot (working fine) Forward/reverse on joystick=forward/reverse on bot lastly left and right is strafing. My other set up was one joystick does strafe and forward/backward and the other joystick rotates on the x axis (like call of duty controls) and thinking about it that set up would cause the strafe value to be read a little weird since it's also reading the y axis and it's hard to strafe unless all the motors are the same speed
|
Re: Wheels spinning at different speeds program or electrical error?
A simple debugging strategy you could try is swap the Jaguars' pwms front and back. That will tell you if it's programming or calibration of the Jags.
Encoders are the best way to make both sides match exactly, if you've got some programming help to get them working. Another way you could do it is with a gyro, it may be a little simpler, but it does have other issues. One advantage to the gyro is it will compensate for differing traction between the wheels (within reason). |
Re: Wheels spinning at different speeds program or electrical error?
Found it it's just a joystick issue so I gave strafing its own joystick and its fine. Only problem is when going back it curves slightly. Pwm 2 is going slightly slower so I guess it's time for the encoders.
|
Re: Wheels spinning at different speeds program or electrical error?
Quote:
When I read your description of what was happening, the first thing I thought was that the robot was trying to rotate a little whenever you told it to strafe. Since the picture showed the rotate input coming from a separate joystick, that didn't make sense. Now that you say otherwise, it seems a likely possibility. When you're pushing the joystick to the side, it's easy to twist it a little without realizing it. |
Re: Wheels spinning at different speeds program or electrical error?
Quote:
|
| All times are GMT -5. The time now is 08:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi