Hi Henrik,
thanks a lot for the advice.
in order to send for example 200 pulses for one revolution, do i need to give for i = 200 to do the revolution label so many times as the i ?
Hi Henrik,
thanks a lot for the advice.
in order to send for example 200 pulses for one revolution, do i need to give for i = 200 to do the revolution label so many times as the i ?
Yes, exactly!
By the way, you seem to have your TRIS settings backwards, a set bit makes the pin an input, a cleared bit makes it an output.
I haven't actually tested the following so please see it as an overall idea and not verified/working code:
/Henrik.Code:DEFINE OSC 4 StepCount VAR WORD ' Distance to move Delay VAR WORD ' Time, in us, between each step-pulse i VAR WORD ' General purpose index/counter variable But VAR PortB.2 Dir_Pin VAR PortB.4 Step_Pin VAR PortB.5 CW CON 0 CCW CON 1 CMCON = 7 ANSEL = 0 TRISB = %11001111 ' PortB4-5 outputs, rest are inputs. Main: If But = 0 THEN StepCount = 200 ' Distance to move motor Delay = 2000 ' 2000us between each step Dir_Pin = CCW Gosub MoveMotor ENDIF Goto Main END MoveMotor: For i = 0 to (StepCount - 1) Gosub StepIt PauseUs Delay NEXT RETURN StepIt: Step_Pin = 1 ' Generate a 10us wide pulse on the step pin. PauseUs 10 Step_Pin = 0 RETURN
ops my bad, you are right, TRISB must be otherway round.
1 is inpupt and 0 is output.
Apart from than i will compile the code and try to run it and test it tomorrow.
will keep you updated. Let me print first the jig and fixture models so i can test the steps easier.
thanks a lot.
today i will try to build the models but will be ready for testing tomorrow. So please give me some time. thanks a lot.
I have promised you to show you the jig and fixture Mode for the stepper Motor with 1.8* degree and 200 steps per revolution. I have ONLY built 2 parts from the assembly.
For your reference checking the design on the Page 2.
Please find attached pictures. The other 2 parts which is the Base and the columns will be ready tomorrow.
Last edited by astanapane; - 4th March 2013 at 19:56.
Wow! I don't know much about 3d-printing but those pieces looks very profesional, nice work!
What's the end application, is it only for experimenting/learning about step-motors or are these pieces going to be used for some specific application?
Again, nice work indeed!
/Henrik
hi Henrik,
thanks a lot. the models are from a Fortus 400mc system designed in a 3D CAD.
The specific model is only a jig and fixture part. I designed it for helping me to learn how to move step by step the motor.
But the end application will be based on the following.
a small gear is attached on the small gear and will drive the big gear.
Bookmarks