Home                Bob Norgard's page

SETTING UP THE SOFTWARE

 

Tuning the HalfStep Parameters

1. Get into the HsParms menu and set MaxDelay and MinDelay to fairly low numbers such as 500 and 100.
2. Using the handpad slew the motor, you will probably find that the motor will not start but just sit there vibrating away.
3. Gradually increase MaxDelay until you find that the motor starts reliably. A MaxDelay below 2000 is quite respectable for 1.8 deg step motors.
4. You now will probably find that the motor will stall as it nears max speed.
5. Gradually increase MinDelay until you find that the motor no longer stalls before reaching max speed. A MinDelay below 700 is quite respectable for 1.8 deg step motors.
6. You can then reduce the rampup speed, HsRampX, to the lowest possible without stalling the motor.

 

Tuning the Microstep Parameters

There are three stages to setting the microstep parameters: setting the PWMRepsTick and % current, adjusting the microstep sizes via the PWM array values, and applying quarterstep (QSC) correction.

PWMRepsTick and % Current

Setting the PWMRepsTick and % current is the same as manually adjusting MsDelayX and MsPause but it is more simply done through the AutoMsParms menu. Just enter the PWMRepsTick and % current required and it will calculate the required values to achieve this. Setting these values will have an impact on the setting of PWM array values to get the equal microstep sizes. As a general rule, increasing the % current makes it easier to adjust the microstep sizes. The % current also effects the vibration of the motor with increasing current generally increasing vibration. Increasing the PWMRepsTick increases the frequency of the vibrations. As such, setting these values is a compromise between the reducing the current drawn, reducing vibration and being able to set equal microsteps. My experience has mostly been with motors that are above 11 V, with coil resistances above 50 ohms, and a power supply of 18V. For these motors I have found the best results have been achieved with a current % above 80% and PWMRepsTick values above 100. For motors of lower voltages and with less resistance I would expect the % current could be reduced substantially.

Microstep Sizes

The method I used is as follows:

1. The easiest way to measure the microstep size is to attach a small piece of mirror to the output shaft of the motor, shine a laser at it, and observe the reflected laser dot on a wall. It is important that the wall you are taking the measurements on is reasonably perpendicular to the path of the reflected laser beam to avoid errors due to a changing path length. The path should be long enough to give at least a 10mm gap between microsteps. For a 200 step motor and 20 microsteps this equates to a path length of 10mm x 20 microsteps x 200 steps / 2pi / 2 (for reflecting path) = 3183mm. A side advantage of using a laser for measuring is that by looking at the laser dot on the wall you can see if a microstep is oscillating about a central point by elongation of the laser spot. If you get this then you should look at altering the PWMRepsTick and % current values.

2. In the config.dat file edit the PWM array so you have the required number of steps and don't forget to change the Ms parameter to the number of steps you have. Don't worry too much about the values in the array, use the default array of 20 PWM values and either add or delete values from it. Just make sure that the first value is PWM[] 100:0, the mid value is PWM[] 100:100 and the last value is somewhere around PWM[] 30:100. Also change the MsPowerDownSec parameter to something large like 100 seconds so the motor will not power down while you are taking a measurement.

3. Connect the azimuth motor, attach the mirror and set up the laser and fire up the scope program.

4. Go into the 2MotorTrack menu and set all values to 0. The motor should start pulsing but is not moving.

5. Go into the MsParms menu and you should be able to microstep step the motor using the + and - keys.

6. Let us assume you have 20 microsteps. Advance the motor to position a0 using the + key and mark the laser position on the wall, then advance it halfway to a10 and place another mark, and then advance it to b0 and place another mark. You will probably find some difference between the halfstep sizes but this can be compensated for using QSC.

7. Divide the distance between each halfstep mark equally by half the number of microsteps, in this case 10, and place marks on the wall.

8. Now to adjust the PWM array values. Step back using the - key to past the a0 position and then advance it to the a1 position. Adjust the PWM[1] value until the laser hits the mark. Check the position by stepping back a few microsteps and then advancing it to the all position. Adjust again if necessary and then repeat the process. This process of stepping backwards and always making a measurement when moving the motor forwards is essential as I always found that there was always some stickiness in changing the motor direction.

9. Repeat the above process for the rest of the microsteps noting you should not change the middle microstep from PWM[10] 100:100. If you find that adjusting the PWM array values between 0 and 100 does not allow you to adjust the microstep sizes with enough resolution you can try two things. The first is to increase the allowable range to something like 200 by changing the MaxPWM value to 200. The second is to increase the % current.

10. You have now completed a basic tuning of the microsteps which is good enough for most visual uses and you can stop here.

11. The next level of refinement is to write down the PWM array values you got for coil a and then repeat the process for coils b, c, and d. You then take an average of the values you get and plug that average value back into your PWM array. If you are going to do QSC, do this for the azimuth motor now.

12. Next you can repeat the whole process for the altitude motor. To do this first edit config.dat and create another PWM array called PWMZ and place your values for your azimuth motor in that array. The values in the PWM array will now control the altitude microsteps and can be set accordingly.

Quarterstep Correction

My personal opinion on QSC is that it is not really needed if you are using the scope visually and the difference between halfsteps is less than 10%. Taking a typical fullstep size of about 8 arcsec, a 10% halfstep variation equates to 8 / 2 x 10% = 0.4 arcsec which is a hard variation to observe visually. Also, QSC does not change the microstep sizes so they become uniform, the microstep sizes remain the same and the rate of microstepping is varied slightly to make the rotation speed constant. Anyway if you do want to be a perfectionist this is how I recommend doing it.

1. Once again, set up your laser and mirror arrangement, turn 2MotorTrack on, get into the MsParms menu and set it up so that when you are at microstep c0 the beam path is perpendicular to the wall. This will ensure that errors due to the changing path length will be minimised. You can make corrections for the difference path lengths at the extremities if you are a perfectionist.

2. Once again step the motor in one direction only and mark on the wall the points for each quarterstep which will be at microsteps a0, a5, a10, .., d15, a0.

3. Now work out what the average fullstep size, which is simply the distance from a0 to a0 divided by 4. As an example lets say the total distance is 800mm, so that means the average fullstep is 200mm.

4. Measure the actual position of each quarterstep, lets say the first five quartersteps are at 0mm (a0), 48mm (a5), 95mm (a10), 148mm (a15) and 203mm (b0).

5. Work out the required position of each quarterstep so they are equal. In this case for the first five quartersteps it should be 0mm, 50mm, 100mm, 150mm, and 200mm.

6. The QSC factor for each quarterstep is then calculated by the difference between actual position and the required position divided by the average fullstep distance. Thus for the first five quartersteps it is (0-0) / 200 = 0.00, (48-50) / 200 = -0.01, (95-100) / 200 = -0.025, (148-150) / 200 = -0.01, and (203-200) / 200 = 0.015.

7. The process is then repeated to get the values for the altitude motor.

If you have now completed this whole process of setting up microstepping, go and have a drink. You will need it!

Working Out the Fullstep Sizes

Azimuth Drive

1. Roughly work out what the azimuth step size should be and plug it in (say 6.2 arcsec).

2. Attach the laser to the base of the scope and point it at some point on a wall and reset the altaz coordinates to 0.

3. If you have a roller drive slew the scope 360 degrees until the laser returns to the same point. Record the number of degrees slewed as reported on the display. Do this several times in each direction and work out the average. Let us say it was 365 degrees. The correct step size is then old step size (6.2) x actual degrees moved (360) / measured degrees (365) = 6.11507 arcsec.

4. If you have a geared drive you can count the number of teeth and work out the value but this can be a bit tedious if you have 1000 plus teeth like I did. Given that I knew the gear had about 1020 teeth, I commanded the motor to turn 1000 times via the move a certain number of halfstep command. For my 200 step motor this was 1000 x 200 x 2 = 400 000 halfsteps. I then commanded the motor to turn 1 turn (400 halfsteps) at a time until the laser returned to the mark. I had to do this 18 times. This told me I had 1018 teeth and thus the step size was simply number of arcsec in 360 deg (1296000) / number of teeth (1018) / number of step per turn (200) = 6.36542 arcsec.

Altitude Drive

Unless you have a 360 degree gear on this drive then it is a bit more difficult to work out the step size as you cannot turn the scope through 360 degrees. This the best method I found.

1. Attach the laser to the scope tube and also a spirit level with two vials at 90 degrees to each other.

2. When the spirit level indicates the scope is horizontal place a mark on the wall where the laser is pointing. Then slew the scope until the spirit level indicates the scope is vertical and place a mark on the ceiling where the laser is pointing. Do this several times and place final marks where the averages are.

3. Roughly work out what the altitude step size should be and plug it in (say 6.2 arcsec).

4. Remove the spirit level as I found that for a roller drive it would unbalance the scope and cause slippage.

5. Slew the scope so the laser points at one of the marks and reset the altaz coordinates to 0.

6. Slew the scope until the laser points to the other mark. Record the number of degrees slewed as reported on the display. Do this several times in each direction and work out the average. Let us say it was 95 degrees. The correct step size is then old step size (6.2) x actual degrees moved (90) / measured degrees (95) = 5.87368 arcsec.

Backlash

Best method I found for calculating backlash was to mount the laser on the scope tube. Put a mark on a wall a few metres away. Step the scope so that the laser spot is on the mark. Reset the alt-az coordinates so they read 0 degrees. Step the scope a few degrees in the same direction as you did to put the laser on the mark. Step the scope back so that the laser is again on the mark. Read the alt-az coordinates and this is your backlash. Repeat the process for both axis several times in both directions to get a good average for each axis.

Site Parameters

A note for those of us in Australia that the time zone should be a negative number to get the sidereal time right and that the longitude should be positive. Thus for my location in Melbourne at 145.06855E, 37.81029S the values are: Longitude 214.93145, Latitude -37.81029, TZ -10.

Z1, Z2, Z3 and other error corrections

The only thing I have done in this area is to try and evaluate if there is any non-orthagonality between the axis caused by the altitude supports being lower on one side than the other. I have found that there is small problem but I have not been able to characterise it properly yet. I believe the problem is that the two semicircular bearings attached to the scope are slightly offset from each other. This means that there is some non-orthagonality but it is not a constant and varies with the altitude of the scope. The program will allow for corrections of this type but I have not done enough analysis to determine the required corrections.