First of all this is the best thing to do as soon as you have 2 locos and more !!! So much fun to run a KATO with an Atlas finally with matched speed locos !!!
Here is what I did :
I measured an 8 feet stretch on the layout ( which is 1,280 feet in N scale ) , my freight locos are supposed to go from one point to the other at 70 smph. in 12.5 seconds , that is for the max speed ( CV5 )
For the mid speed at 35 smph. it is supposed to do it in 25 seconds . ( mid speed is CV6 )
The value for CV5 and CV6 is between 0 and 255 .
CV6 mid speed
I usually start with the mid speed , I am using my computer to program the value on a programming track using the free program JMRI Decoder Pro available on internet , I find it faster this way but you could use your handheld controller depending of which system you use .
I always begin with a value of 60 for CV6 . Put back the loco from the programming track ( PT ) a couple of feet before the measured 8' section . I run the loco with the throttle at 50% and time the loco between the 2 points , if it's less than 25 sec. than I put back the loco on the PT and add some more value to 60 , maybe 10 more and redo the timing again . If it's too fast you lower the value programmed before .
CV5 ( max. speed )
Basically the same , except starting with a value of 130 for KATOs and 255 for Atlas loco and others .
It's never the same value for 2 locos even when they are from the same company and batch ... It does not take much to have a difference .
It's easier to measure the time than trying to match another loco . This way all your locos will be match together .
I would be a lyer if I tell you that it's perfect forever , it's not and you will find out that after a while you will have to readjust locomotives .
Locomotives that you don't use often will tend to go slower at first and then after 5 minutes or so the speed will get back on par or so with others .
While you are at it , you should program the momentum for acceleration and stopping . On mainline locos I put a value of 3 to both CV3 and CV4 .
If everything goes wrong you can erase everything you did and put a value of 8 to CV8 . ( default settings )
It's a good thing to keep your programmation on writing somewhere , which I never did ...
After al I have only 135 locos programmed ...
Some of my locos cannot obtain the max speed of 70 smph . but the mid speed is obtainable which is fun for switchers mix in a consist of mainliner .