Hey guys, I am having a tiny problem with a basic tank drive system. its basically two motors connected into one motor1 of controller 1 and the other two dc motors into motor2 of controller 2. There were encoders but I am disregarding them at the moment so I can get rid of the problem. Here's the program I made for a basic tank drive system:

But every time I run the program, it lags. the motors jerk. This only happens because of the motor[motorsLeft] = 0; line. If i remove that allow the robot to go forever without stopping, it doesnt jerk at all. I have tried various versions of the same thing but the only line that makes it jerk is making the speed 0. A previous programmer suggested adding wait1Msec(1000/30); line in the while loop to let the motors catch up but that decreased the lagging yet still left it there. any suggestions to fix this? btw, i had this program last year as well and it worked perfectly. dont know what has changed this year.

Thanks!Team 348

Wed Nov 16, 2011 4:50 pm

grajalese

Rookie

Joined: Thu Jul 10, 2008 12:30 pmPosts: 14

Re: Motors Jerkin'

The first thing I noticed was that it looks like you have a motor controller and MUX controller attached to the same port?

Even if I remove that, it's still the same problem. The motors lag/jerk a lot.

Wed Nov 16, 2011 6:07 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Motors Jerkin'

According to the code, it should not execute the "motor[motorsLeft] = 0" line if you keep pushing the joystick unless your laptop is losing communication with the robot, in which case the RobotC 3.x will send a joystick packet with 0 values. That would trigger that line and caused the jerk. Are you using Bluetooth or WiFi? Try using a USB cable instead (with the robot off the ground so it doesn't run away), I'd bet you won't have the jerk. If that's the case, you may have communication issue.

Wed Nov 16, 2011 6:45 pm

prateeksach

Rookie

Joined: Wed Nov 16, 2011 4:42 pmPosts: 4

Re: Motors Jerkin'

I have only been using a USB so far. I haven't set up any Bluetooth or Wifi communication modules until I finish all the programming aspects.. any new input?

Wed Nov 16, 2011 11:29 pm

grajalese

Rookie

Joined: Thu Jul 10, 2008 12:30 pmPosts: 14

Re: Motors Jerkin'

1. What version of RobotC are you using?2. Did you replace the motor?3. Did you replace the motor Controller?4. Did you replace the motor power cable?5. Did you replace the NXT cable from the NXT to the motor controller?6. Re-download the firmware to the NXT.

Also I would change the deadband from 30 down to 10.

Hope the above helps...

_________________Eric Grajales

Wed Nov 16, 2011 11:51 pm

prateeksach

Rookie

Joined: Wed Nov 16, 2011 4:42 pmPosts: 4

Re: Motors Jerkin'

I have RobotC 3.03 and I will do all those replacements on Friday and let you know. I'll see what happens. and by deadband, im assuming you mean threshold?

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum