Basic two operations of a stepper motor are either full step or half step. To achieve this high accuracy(to reduce the step angle) do I have to use microstepping method of a stepper motor.If you consider above example, to cut a line with 45 degree angle, with 1mm accurate steppers, you will get the cut as on the top image. When accuracy is higher (step angle is lower)
Connecting Stepper Motors to Microcontrollers Tutorial
Re: Connecting Stepper Motors to Microcontrollers Tutorial
Re: Connecting Stepper Motors to Microcontrollers Tutorial
I don't think you can easily do microstepping. So it would be better to go on with full-step for now. When you are perfect with full-step, you can add microstepping circuitry.
Re: Connecting Stepper Motors to Microcontrollers Tutorial
If I need to do microstepping I have to change the circuitry as well right. I think I have to use a DAC for that. and some changes to the coding. is that correct
Re: Connecting Stepper Motors to Microcontrollers Tutorial
For microstepping, yes you will need extra circuitry which can generate a sine wave. A DAC would be ideal. You would need to do some experiments with this arrangements. And it will consume lot of time I'm sure. So on the easy way, I think it would be better for you to go with full-step. Try to find a stepper with very low step-angle. That will do the job.
Re: Connecting Stepper Motors to Microcontrollers Tutorial
what would be the correct way of calculating the number of steps required to move lead screw to a 1mm or 1inch,
L = ? × r (when ? is in radians)
L = (? × ?/180) × r (when ? is in degrees)
? - step angle
r - radius of the wheel connected to stepper motor
L - distance travelled
or
L = X × Y
X - lead screw revolutions per inch/mm
Y - motor steps per revolution
L = ? × r (when ? is in radians)
L = (? × ?/180) × r (when ? is in degrees)
? - step angle
r - radius of the wheel connected to stepper motor
L - distance travelled
or
L = X × Y
X - lead screw revolutions per inch/mm
Y - motor steps per revolution
Re: Connecting Stepper Motors to Microcontrollers Tutorial
r? is the length moved along the belt where r is the radius of the wheel connected to the stepper motor to drive the belt + height of the belt.
Remember, the actual movement on the belt could be slightly different due to mechanical errors such as uneven belt movements along the pulleys, belt play, etc... So to compensate with that, you must do calibration to the unit. Here is a simple procedure to do so.
1. Move Q1 mm by calculating the number of steps required using r?. Say it is A1 steps. The actual movement is say L1 mm.
2. Move Q2 mm by calculating the number of steps required using r?. Say it is A2 steps. The actual movement is say L2 mm.
3. Move Q3 mm by calculating the number of steps required using r?. Say it is A3 steps. The actual movement is say L3 mm.
....
....
10. Move Q10 mm by calculating the number of steps required using r?. Say it is A10 steps. The actual movement is say L10 mm.
Now calculate the error.
Total Error (P) = [(L1 - Q1) + (L2 - Q2) + (L3 - Q3) + ...... + (L10 - Q10)]
Total distance (T) = Q1 + Q2 + Q3 + .... + Q10
Error per millimeter (E) = P / T
Note that the error could be plus or minus.
Now we know, when we ask the machine to move L mm, it actually moves L mm + (L x E) mm.
Okay, so if you want to move L mm accurately, you need to instruct the machine to move L - (L x E) mm.
Note, It would be better to calculate forward and reverse error; Ef (forward) and Er (reverse) to apply for both directions separately.
Remember, the actual movement on the belt could be slightly different due to mechanical errors such as uneven belt movements along the pulleys, belt play, etc... So to compensate with that, you must do calibration to the unit. Here is a simple procedure to do so.
1. Move Q1 mm by calculating the number of steps required using r?. Say it is A1 steps. The actual movement is say L1 mm.
2. Move Q2 mm by calculating the number of steps required using r?. Say it is A2 steps. The actual movement is say L2 mm.
3. Move Q3 mm by calculating the number of steps required using r?. Say it is A3 steps. The actual movement is say L3 mm.
....
....
10. Move Q10 mm by calculating the number of steps required using r?. Say it is A10 steps. The actual movement is say L10 mm.
Now calculate the error.
Total Error (P) = [(L1 - Q1) + (L2 - Q2) + (L3 - Q3) + ...... + (L10 - Q10)]
Total distance (T) = Q1 + Q2 + Q3 + .... + Q10
Error per millimeter (E) = P / T
Note that the error could be plus or minus.
Now we know, when we ask the machine to move L mm, it actually moves L mm + (L x E) mm.
Okay, so if you want to move L mm accurately, you need to instruct the machine to move L - (L x E) mm.
Note, It would be better to calculate forward and reverse error; Ef (forward) and Er (reverse) to apply for both directions separately.
Re: Connecting Stepper Motors to Microcontrollers Tutorial
I have wrote code for above situation. I have a little problem. what happen when routing a circle (pad of a component) or a non 45 degree line. Can I use above method for these situations as well.To cut the 45 degree line as on above image, the instructions would be as below.
MoveX(1);
MoveY(1);
MoveX(1);
MoveY(1);
MoveX(1);
MoveY(1);
MoveX(10);
Re: Connecting Stepper Motors to Microcontrollers Tutorial
General equation of a circle which the centre is (a, b) is given as (x-a)2 + (y-b)2 = r2
With this, for every x location, you can have two y location which you have to plot. That's simple co-ordinate geometry. If you have questions you can ask.
With this, for every x location, you can have two y location which you have to plot. That's simple co-ordinate geometry. If you have questions you can ask.