|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?? |
|
#2
|
||||
|
||||
|
Re: Control Problems
Quote:
2000 - p1_y |
|
#3
|
|||
|
|||
|
Re: Control Problems
It sounds like the left and right sides are swapped.
|
|
#4
|
|||
|
|||
|
Re: Control Problems
Quote:
Quote:
Code:
PWM 13 = PWM 14 = Limit_Mix(-(2000 + p1_y + p1_x - 127)); PWM 15 = PWM 16 = Limit_Mix(-(2000 - p1_y + p1_x + 127)); Last edited by Inverted : 14-02-2006 at 20:45. |
|
#5
|
|||||
|
|||||
|
Re: Control Problems
Quote:
|
|
#6
|
|||
|
|||
|
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); pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127); Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y - p1_x + 127); pwm15 = pwm16 = Limit_Mix(2000 + p1_y + p1_x - 127); |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
Re: Control Problems
Quote:
![]() |
|
#9
|
|||
|
|||
|
Re: Control Problems
Quote:
|
|
#10
|
|||
|
|||
|
Re: Control Problems
Just say "no" to PWMs 13-16. (Are you using open-loop driving?)
|
|
#11
|
|||
|
|||
|
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 Last edited by gnirts : 15-02-2006 at 02:11. Reason: found the answer, saw the light |
|
#12
|
|||
|
|||
|
Re: Control Problems
Quote:
|
|
#13
|
||||
|
||||
|
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. |
|
#14
|
||||
|
||||
|
Re: Control Problems
Quote:
if he inverted the PWMs to the motors then forward would go backward. |
|
#15
|
||||
|
||||
|
Re: Control Problems
Quote:
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Concept of PID explained | ConKbot of Doom | Technical Discussion | 11 | 27-01-2008 00:11 |
| Electronic Speed Control Problems | DustinB_3 | Electrical | 9 | 09-11-2005 23:42 |
| Pre-manufactured control box for FIRST | Ben.V.293 | Technical Discussion | 19 | 22-08-2005 12:53 |
| 2005 RadioShack Innovation In Control Award--What Won? | Billfred | Control System | 8 | 12-06-2005 01:51 |
| Robot Rodeo - fixing control problems | Gary Dillard | Off-Season Events | 7 | 26-10-2004 00:46 |