Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:01 22 Apr 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Stepper Project

     Page 4 of 4    
Author Message
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 278
Posted: 06:49am 21 Apr 2026
Copy link to clipboard 
Print this post

G'day Bryan,
Great to see you are making progress  

I think the command you are looking for is PEEK(STEPPER BUFFER)
' prog to test stepper functions

Option default integer

On Error skip
Stepper close

SetTick 200,Show_Pos

Stepper init 0.05,32,,1
Stepper axis x,gp0,gp1,gp5,,200,400,50,5
Stepper axis y,gp6,gp7,,,400,600,100,5
Stepper position home
Stepper run 0
Stepper gc g1 x100 y80 f500
Stepper gc g4 p1000
Stepper gc g0 x0 y0

Do
 Pause 100
Loop Until Peek(stepper active)=0 ' wait until motion complete

Pause 250 ' wait for final position update
Stepper close

End

Sub Show_Pos
 Print @(100,108),"X-POS  = " Str$(Peek(stepper x),-4,4)
 Print @(100,120),"Y-POS  = " Str$(Peek(stepper y),-4,4)
 Print @(100,132),"Buffer = " Str$(Peek(stepper buffer),4)
End Sub


Pretty sure this is the latest version of the Stepper Reference.
Stepper_Reference.pdf

Regards, Lyle.
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 1872
Posted: 07:16am 21 Apr 2026
Copy link to clipboard 
Print this post

Hi Lyle yea mate getting the DM556 working today was a huge step in the right direction for me so now I do have to get my head around coding all this up.

Now what I did find when I did those buttons to mimic the stepper limits it clearly states for the same axis the same pins can be used but when I did try that got an error so thats why 6 off in/out pins are used + one for the E-Stop.

As I do have my HDMIUSB board up in the shed now it's right next to the surface grinder so when those DM556's arrive I will have a go with that board as with the mouse and keyboard to go setting up the parameters for the grinder will be a breeze.  

Now I do think we can get away from using ball screw on the Y and Z axis and make an allowance in the code for the backlash. But with the Z axis I do think a ball screw should be used as we do want precision when we set the grinding wheel for the cut where just a few step pulses may be needed to get the depth. Also a damper could be installed to beef up the Z axis.

So basically the X axis is just going to going back and forth at a predetermined distance and when it changes direction the Y axis can move the required distance to keep the cutting going, also once the X axis has gone back and forth the Z axis can be incremented down to set the level to get a good cut.  

So getting this all my head is one thing now putting all this into code is certainly going to test the grey matter.

Regards Bryan
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1849
Posted: 01:07pm 21 Apr 2026
Copy link to clipboard 
Print this post

Don't know much about grinding; is there any benefit to variable speed on the X axis?
 
mozzie
Senior Member

Joined: 15/06/2020
Location: Australia
Posts: 278
Posted: 02:41pm 21 Apr 2026
Copy link to clipboard 
Print this post

G'day,

Phenix, variable speed on the x-axis is required, as the thickness of the job changes you have to take very light cuts and slow the feed rate, especially when making or thinning shims.

Bryan, pretty sure you can use the same limit input for both ends of an axis, but you need to specify all 3 axis even if not using them, IE:

STEPPER HWLIMITS GP20,GP21,GP22,GP20,GP21,GP22

Agree that the X and Y axis are not going to matter much regarding backlash, need to pass the ends of the job on the X and overlap the passes on the Y anyway, so should be all good. The Z-Axis on the machine here is a leadscrew driven by a wormgear, so can probably hook a motor almost directly to it. That's after I move a ton of other gear to gain access to it again  

I posted on the other thread regarding the enable signal being the wrong polarity, however from memory most of the stepper driver boards it is really a DISABLE signal so the current setup will work with the following circuit:



Transistor and resistor values are what I have most of, pretty much anything NPN and similar values should work.

Regards, Lyle.
 
     Page 4 of 4    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026