|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#12
|
|||
|
|||
|
Re: Slow down teh motors!
I'm so excited...something I can respond to.
We had the same problem with our robot. I doesn't give you the same variability as the other methods but it let us drive the robot. Our driver motors are pwm01 and 02. The values that you set them for are the actual speed that you end up going. You are basically partitioning different areas of joystick placement to different output voltages (speed). Be carefull how you order each statement since its an if else if statement and it checks stuff in order that you put it in. You will also notice that the minimum amount of joystick movement before the robot actually moves is 27 going backward and 18 going forward. That way there was a little bit of dead stick in the middle since the sticks were too sensitive at the start. You can add more else if statements to put in more drive speeds. You could make the extreme ends ( 0 and 254) to actually go 0 and 254 (100% forward and backward). if (p1_y < 50) //back fast { pwm01 = 120; //ange these values to the actual speed you want pwm02 = 120; //"speed" is how far forward and backward you go } else if (p1_y < 100) // back slow { pwm01 = 123; pwm02 = 123; } else if (p1_y >200) //forward fast { pwm01 = 155; pwm02 = 155; } else if (p1_y > 155)//forward slow { pwm01 = 145; pwm02 = 145; } else //stop and idle { pwm01=127; //left motor pwm02=127; //right motor } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cheapest and easiest way to slow down a motor | sanddrag | Technical Discussion | 41 | 21-12-2005 07:26 |
| Slowing Down Drive Motors | Arc736UV | Programming | 5 | 24-01-2005 22:35 |
| How slow is too slow? | Joe Ross | Rules/Strategy | 23 | 12-10-2004 20:23 |
| Gearing down motors | MechaJag | Motors | 11 | 17-01-2004 02:27 |
| teh funnah | Zeinin | Chit-Chat | 1 | 15-04-2002 15:02 |