Programming track motors

I was running a program last night trying to get the johnny 5 to roll forward a certain distance and I did some type of way and cant remember now how I did it, I think it was accidental but how do you time the motors to run a certain time so that you can accomplish certain distance? I tried doing expert mode and then running the time feature but it was comming up with an error.

The best way is to use motor encoders so you can “monitor” the number of times the wheel has rotated. You might want to do a search on “motor encoder” as I believe this has been discussed before in the past.

No not encoders for the wheels I dont think you can put those on the johhny 5 I’m not sure, I’m talking about making the robot travel a certain distance forward rather than using default settings which isnt very far. I’m trying to get the robot to travel so far and then turn then go a certain distance futher in the program.

I think you can use the motor encoders. If for example you use the motors: lynxmotion.com/Product.aspx?productID=653&CategoryID=11, you might be able to put on the external encoder: lynxmotion.com/Product.aspx?productID=448&CategoryID=11.

That is assuming that it has enough clearances for them…

Kurt

The below seems to show encoder shafts sticking out the rear of the motors. One might also put encoders on the outside of the drive sprockets if desired.

Again you should be posting this in the SEQ section so peeps know what your running. The idea here is to use two servo channels on the SSC-32 for the Sabertooth left and right motor control. You may have to adjust the stop value as the value needed to stop the motors (1500uS) may not be exactly 1500uS. You set the two servos to 2000uS and set the time for mthe move to take to 2sec. This will be the time it takes the motors to go from stopped to full speed. Think of it as acceleration. Now the next step in the sequence will tell how long the motors stay running, or the distance the robot will travel. Then you can create a third step that takes both the servos back to stopped in 2 sec. This is decelleration. This is how James did the Johnny 5 videos on youtube.