Home                          Go to Page 2 of the ScopeDrive excerpts             Andy Martyn's page

 

A Method for Determining Microstep Values

Here is a simple procedure for determining corrections to microstep values as used in the scope program by Mel Bartels.

There is another, excellent method using an Excel spreadsheet by Tom Krajci. I’m sure it is very good, and even uses graphs. I would have in fact used it, but I don’t have a spreadsheet program running at home. Working late at night in the garage, I more or less just came upon this method on my workbench. It’s not an end all system, but it got my microsteps figured out quickly.

This method uses the measurements of the first half of the microsteps in a full step. After taking readings for all of the steps, folding the paper in half virtually duplicated the readings on the other side. What I mean is that steps 0-10 virtually mirrored steps 11-20. And, as was mentioned on the scope-drive list, I did notice differences between four fullstep spans. At least for my motors, I came to the conclusion that further messing around (tweaking) could not help my particular setup. However, other setups could very well benefit from more detailed analysis. Especially for critical high-power viewing.

When I finished the 20ms version of config.dat, I saved it as config.20. Things were working so well, I did it again using 30 microsteps. If I would do this again at 40 microsteps, I’d have to back off to 15 feet or so to get more resolution.

Taking the Measurements

Determine the absolute displacement per microstep. One very popular way is to attach a laser pointer to the motor shaft and have it point to a wall at some distance, magnifying the small microstep motions of the shaft. I used a borrowed laser-level. Any distance that gives suitable deflection per microstep will work fine. For this example, we will use a distance of about 10 1/2 feet, about three meters, from the motor shaft to the wall. To get best accuracy, take your readings when the projected light beam is at or close to 90 degrees to the wall. Tape a sheet or two of paper on the wall to mark the microstep positions. Higher accuracy will be obtained from longer distances. 10 feet or about 3 meters is a good starting point for up to 30 microsteps.

In the config.dat file, set the TestString to track. 

        [ That option (TestString) doesn't exist any more. The way to do it is :
        1. Go to 'two motor track' and set motors to step 1 microstep at a time.
        2. Go to the MSParms menu and move the motor one microstep at a time, using '+' or '-' key,.   Jan van Gastel  ]

Start scope.exe. Use 1/10 (.1) microsteps per second. This will give you 10 seconds between each microstep and allow your test apparatus to stabilize between readings. If necessary, stop down your laser pointer with a piece of tape with a pinhole in the middle.

At step 0, make a pencil mark in the center of the dot. As the program advances, keep marking each microstep in a like manner, making marginal notes where necessary.

If using 20 microscosteps, readings corresponding to steps 0-19 will be laid down.

Once the data is gathered, measurements must be taken. It is helpful to use a sheet of paper with columns for the various measurements and calculations.

Start by labeling the columns as follows:

 

 

M-Step

PWM Settings

Meas Posn(MP)

Ideal Posn(IP)

Delta

Step Weight(WT)

Corr.

0

100-0

0

0

0

0

0

1

100-29

0.175

0.2020

-27

16.2

+1=30

2

100-47

0.468

0.4052

+63

18.8

-3=44

3

100-58

0.675

0.6078

+68

18.1

-4=54

4

100-65

0.802

0.8104

-8

21.6

-0=65

5

100-70

0.910

1.0130

-103

20

+5=75

6

100-78

1.070

1.2156

-145

31

+4=78

7

100-84

1.256

1.4182

-162

31

+5=89

8

100-88

1.380

1.6208

-240

37

+6=94

9

100-92

1.530

1.8234

-290

53

+5=97

10

100-100

1.955

2.0260

-71

   

 

To get you started, if using 20 microsteps, fill out the present settings for steps 0-10. You will find them on the screen in front of you when running in testmode track, or in the config.dat file.

After step 10, the settings are mirrored backwards. If using 30 microsteps, after step 15 the steps are mirrored backwards, etc.

Now make the measurements. It is most convenient to use a dial caliper. For step 0, absolute position is 0. For step 1, measure the distance from point 0 to point 1. For step 2, measure distance from step 0 to step 2. Continue with the absolute measurements. 0-3, 0-4…0-10. All measurements reference step 0. Fill out the rest of the form.

Measure the distance between point 0 and the following point 0 to get the full step (FS) distance. Write this down. Divide this number by the number of microsteps being used (ms=20 in this case) and write this down also. For step 0, the ideal reading is 0. For step 1, the ideal reading is (FS/20)x1. For step 2, the ideal reading is (FS/20)x2 and so on. The ideal column will show a linear progression from the first step to the last step.

Fill in the delta column. Subtract the Measured Position value from the Ideal Position value. This column tells you how far you’re off from the ideal.

The next column shows the Step Weight. The step weight is a relative amount that the shaft rotates per point of change in the PWM. Here is the formula for this column. It’s really very simple.

 

MP(n+1) – MP(n)

WT(n) =

---------------------------------------

 

PWM(n+1) – PWM(n)

 

As an example, take microstep (M-step) #3 in the above example.

 

MP(4) – MP(3)

WT(3) =

---------------------------------------

 

PWM(4) – PWM(3)

 

 

.802 - .675

WT(3) =

---------------------------------------

 

65 - 58

 

 

.127

WT(3) =

---------------------------------------

 

7

 

WT(3) = .0181

Or just call it 18.1

So, now we know that adjusting the PWM setting by one point will move the far projected spot by .018 inches. This is really approximate. The weighting actually changes for each point moved, but for this case is close enough.

Make the correction

For line #3, we show a delta of +68. This is really 0.068. Divide 68 by the weighted value for this line of .018 and we get 3.7. The PWM values are adjusted with integers only, so choose -3 or -4. I chose –4 in this case. Subtract 4 from the PWM setting of 58 and you get 54. 100 54 is the value we put in the config.dat file for PWM#3. When you are done figuring all of the steps, just re-start the scope program running in testmode-track, and insert the values there. Re-test if you want and then choose to save the settings when you exit. I always keep several well-labeled copies of my config.dat files.

So, how did it work?

In a second iteration of the test, only three microsteps had to be adjusted by one point value. That’s not too bad. If you have any luck with this method, let me know. I would be interested in hearing from you.

Comments

For the truly dedicated, more work could be done, I’m sure. As I mentioned at the beginning, Tom Krajci (found on the scope-drive list) is doing work on an Excel spreadsheet. Microstep jitter can probably be burried in the system noise by increasing the drive ratio. 

 

Bob Norgard, 26 April 2000

mailto:rnorgard@gci.net