![]() |
Control Problems
We have our bot set up for one-joystick drive, with the two-motor transmissions hooked up to PWMs 13-16. here's the set-up:
(right side) PWM 13 = PWM 14 = Limit_Mix(2000 + p1_y + p1_x - 127) (left side) PWM 15 = PWM 16 = Limit_Mix(2000 _ p1_y + p1_x + 127) The wheels go forwards and backwards correctly, but turns like a boat (turns left when you push the joystick right; turns right when you push the joystick left). Any idea why this isn't working?? |
Re: Control Problems
Quote:
2000 - p1_y |
Re: Control Problems
It sounds like the left and right sides are swapped.
|
Re: Control Problems
Quote:
Quote:
Code:
PWM 13 = PWM 14 = Limit_Mix(-(2000 + p1_y + p1_x - 127)); |
Re: Control Problems
Quote:
|
Re: Control Problems
Quote:
You went to far in modifying the code. If this original doesn't work: Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y - p1_x + 127); |
Re: Control Problems
Before I left the shop today I copied down the X and Y values given when I moved the joystick in all directions, and I was going to do the math on it tomorrow to see what was going wrong (or something, I'm not really sure what I was looking for). For some reason I think I messed with pairs of terms, instead of individual terms, which probably explains the problem. Though, when I originally switched the signs of the whole Limit_Mix operation, I did leave the 2000 positive, but changed everything else, and got the same result, or something similar.
Thanks for the suggestion, I always overlook the 'simple' solutions. I'll try that tomorrow and see if it works. |
Re: Control Problems
Quote:
|
Re: Control Problems
Quote:
|
Re: Control Problems
Just say "no" to PWMs 13-16. (Are you using open-loop driving?)
|
Re: Control Problems
Quote:
See the Motors and the High Port Numbers post, but to summarize it in the words of M. McLeod: Quote:
Robinson |
Re: Control Problems
Quote:
|
Re: Control Problems
If anything is moving in the wrong direction, you could just subtract the Limit_Mix result from 254. (To reverse direction)
for the right motor I use (254-(Limit_Mix(2000 + p1_y + p1_x - 127))); for the left motor I use (Limit_Mix(2000 + p1_y - p1_x + 127)); I've used this setup for all of my team's robots. |
Re: Control Problems
Quote:
if he inverted the PWMs to the motors then forward would go backward. |
Re: Control Problems
Quote:
Quote:
|
| All times are GMT -5. The time now is 18:01. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi