ok i have read just about every single post about the encoders… and don’t quite see an answer that could benifit what i’m wondering… here is the idea.

Given teh manufactoring differences in the motors. I understand that motor A will be a different speed of Motor B at the same speed. so I’m wondering…

Is it possible to use easy c v2 to create a program that uses the encoders to speed up and slow down the motors to keep them more in unison? if it’s not i can always fail safe to a mechanical option of adding the differential with locks. the differential for the skid steer effect and lock it when not steering. thanks for the inputs… no pun intended

I would worry more about your DT gear friction more than the very minimal motor differences. I recently took apart my entire DT and replaced all of the gears, all of the axles and all of the bearings with brand new stuff. I am now reaching the wall over .5 a second quicker. I would try reducing friction in the slower side of your DT

I have also just programmed my robot to drive straight to see it it arcs at all and it moved about a .25" over 15’ which is really not enough (for my applications) to worry about it.


You could setup a PI or PID control loop using feedback from both encoders in order to keep the speed of each motor as close to each other. This technique is commonly used to make robots move in a straight line and to control their speed or position.

Short Answer is yes…

tswift1 is right-on in that a PID Loop is a Graceful Way to make the Motor corrections as well as get the total distance.

wow fast responses… and seems the PID is the way to go but thats so far advanced of my programing knowledge. will keep testing things. … on that note… is there an easyc book to read what all the items are ? might have missed it on the cd.

Can we set up PID with easy c yet. I know that the new micro controllers will allow PID of some sort somehow but to be honest i have never though about using PID so i have never really payed too much attention to them but i understand what they are and how they work.


PTD is playing with PID’s, the code breaks down into crazy simpleness. Seriously, one line does the bulk of the math you just need to really understand HOW the math prominently displayed on Wikipedia works. It’s calculus 2 level math btw, I know this because my pre-calc professor said so.

All joking aside, find the smartest / highest level math teacher you can at your school and ask him/her if you can talk to them about the BASIC functions of a derivative and an integral, just by asking it’ll likely impress them.

EDIT: DK: PID is NOT a hardware based function, the FTC Tetrix kit just has a programming function built into RobotC that does it automatically because their motors suck and really need to ramp up for protective reasons.

lol well not in school anymore graduated like 13 years ago… i just play cause it’s fun. keeps the brain working.

I assumed you were a high-schooler who is competing on a VRC team, sorry. :o

I know that it is not a hardware thing but i never really understood them. I know the new micro-controllers said that they would be PID compatible. So i did not know if it was possible with the current micro-controller and easy c v2. Is it?


Wikipedia and some Embedded Programming Searches will be helpful to you…

PID code in here (search for PID )–> Embedded Systems Programming.

Also, Control TheoryPID (from another FRC Team).

and Programming: P.I.D. Filter Control and a really cool looking forum, Embedded Control Concepts Forum.

FRC Team 957 use a PID loop for the Arm in the 2007 Rack-n-Roll competition. I can locate the Code if you need a start, but it is in MPLAB.

LOL looks like i wasn’t the only one who was looking to do that while i think he uses robot c … anywayhttps://vexforum.com/t/optical-shaft-encoder-programming/17008/1 post are only 3 mins apart

And I am an Equal Opportunity Assist-or…

I have given him my best interpretation on the Information Provided…

yeap your a great asset to this community. but it appears i havn’t taken my own advice by not jumping into the water if i havn’t learned to swim… so maybe i’ll go play in the kiddie pool for a bit longer make some lights flash on and off or something more simple. :stuck_out_tongue:

Don’t give up yet…

I should be refreshing myself over this programming too…

What do you want to do?? Drive in a line??

well heres the total idea… my nephew wants to build this cool dump truck… we have a chasis made and is awesome i think it’s neet. it’s a 6 wheel drive 3 on left on single motor and 3 on right single motor.he wanted the big knobby tires… so thats alot of friction on a drive train thats chains and not gears. … so with the friction if one motor is out driving the other it’s the same as turning and i’m trying to avoid stripping the sprockets or breaking the chain. so we have a set of wheels in the front driven by a slide that will lift the frame on it’s rear 2 tires to allow it to easily turn. thats something completly different in it self… though i’m getting there in the programing … i at least got it to stop the motor when the limit is made but the reason for the straight line is just to keep the tension equal across the left and right side drve systems. i’d hate to strip something out. oh and it’s 2- 1-5-35 channels long… and 15 wide i think. so it’s really long… then we will be suing a gear to cause the wooden (proposed) bucket to dump.


I think that will be too much stress on the Single Motor on each side… Is there any Way to Get Two or Three Motors on each side??

That is cool too… In the RV/Bus Industry, the Tag Axe can be lifted to achieve the same effect…

Have the Motor stop at what Limit??

The Optical Encoders and a little PID Loop will help tremendously. with keeping the Two sides of the Truck tracking straight…

Do you have a Photo to show what you have so far??

I just found another example of PID, 2009 FIRST Traction Control Conference Presentation.

WOW! great article even downloaded the test code to see what it does… though going back and looking at it is greek to me. While i don’t think i will give up on that i do think that i may have the wrong encoders… got V1.0 not the quads… at anyrate that way above my skill level. i just spent the last 6 hours trying to figure out how to do a simple command from the transmitter. I feel it should be easy. and to others out there it might be easy but hey i’m the mechanical guy… this is my first time doing any type of programing and i’ve had this for nearly 4 years. yes i did figure out how to make an led blink with a switch press. this is what i have been working on for the last 6 hours.

Motor 1 waits for signal from transmitter.
when it recieves the signal up on the transmitter the motor moves CW till i remove the signal or limit switch 1 is reached.

when it recieves teh signal down on the transmitter the motor moves CCW till i remove the signal or limit switch 2 is reached.

seems simple enough but yet elusive… gonna keep trying till i fall asleep.

maybe another few hours.
would you prefer pictures or a video of it?

@ DK:

I think your a bit confused. The new high-strength motors will use a current sensor to provide feedback which could result in a PID loop.

PID is just essentially a function or task that anyone could code and post online. Again, I’m playing with such a loop now and I may post a video tutorial on it sometime after the World Championship.