LinuxCNC + Mesa 7i43 – Axis A stepper (stepgen), error

More
28 Dec 2025 13:54 #340620 by manny
Hello,

I am using LinuxCNC with a Mesa 7i43 card.
Axes X, Y and Z are working correctly.

I need help with configuring Axis A (4th axis),
which I use as an auxiliary axis and want to control
with a stepper motor using STEP/DIR signals.

Hardware:
- LinuxCNC
- Mesa 7i43
- Stepper driver – blue digital stepper driver, Leadshine DM542 / DM556 type
  (or compatible clone) with PUL+, PUL-, DIR+, DIR-, ENA+, ENA- inputs
- 2-phase stepper motor

Stepper driver wiring:
- PUL+  -> Mesa P3 pin 25
- PUL-  -> Mesa P3 pin 26
- DIR+  -> Mesa P3 pin 27
- DIR-  -> Mesa P3 pin 28
- ENA+  -> Mesa P3 pin 29
- ENA-  -> Mesa P3 pin 30

The driver is configured by DIP switches for microstepping
(e.g. 3200 pulses per revolution).

Axis A is configured in the HAL file as a stepper axis
using hm2 stepgen (stepgen.00).

I need advice on how to correctly modify the HAL file
so that Axis A works properly as a stepper axis
with the Mesa 7i43.

I am attaching my complete HAL file.

Thank you.


#*******************
#  AXIS A
#*******************

setp   pid.a.Pgain     [AXIS_3]P
setp   pid.a.Igain     [AXIS_3]I
setp   pid.a.Dgain     [AXIS_3]D
setp   pid.a.bias      [AXIS_3]BIAS
setp   pid.a.FF0       [AXIS_3]FF0
setp   pid.a.FF1       [AXIS_3]FF1
setp   pid.a.FF2       [AXIS_3]FF2
setp   pid.a.deadband  [AXIS_3]DEADBAND
setp   pid.a.maxoutput [AXIS_3]MAX_OUTPUT
setp   pid.a.error-previous-target true
setp   pid.a.maxerror .0005

net a-index-enable  <=> pid.a.index-enable
net a-enable        =>  pid.a.enable
net a-pos-cmd       =>  pid.a.command
net a-vel-cmd       =>  pid.a.command-deriv
net a-pos-fb        =>  pid.a.feedback
net a-output        =>  pid.a.output

# Step Gen signals/setup

setp   hm2_7i43.0.stepgen.00.dirsetup        [AXIS_3]DIRSETUP
setp   hm2_7i43.0.stepgen.00.dirhold         [AXIS_3]DIRHOLD
setp   hm2_7i43.0.stepgen.00.steplen         [AXIS_3]STEPLEN
setp   hm2_7i43.0.stepgen.00.stepspace       [AXIS_3]STEPSPACE
setp   hm2_7i43.0.stepgen.00.position-scale  [AXIS_3]STEP_SCALE
setp   hm2_7i43.0.stepgen.00.step_type        0
setp   hm2_7i43.0.stepgen.00.control-type     1
setp   hm2_7i43.0.stepgen.00.maxaccel         [AXIS_3]STEPGEN_MAXACCEL
setp   hm2_7i43.0.stepgen.00.maxvel           [AXIS_3]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net a-pos-cmd    <= axis.3.motor-pos-cmd
net a-vel-cmd    <= axis.3.joint-vel-cmd
net a-output     => hm2_7i43.0.stepgen.00.velocity-cmd
net a-pos-fb     <= hm2_7i43.0.stepgen.00.position-fb
net a-pos-fb     => axis.3.motor-pos-fb
net a-enable     <= axis.3.amp-enable-out
net a-enable     => hm2_7i43.0.stepgen.00.enable

# ---setup home / limit switch signals---

net a-home-sw     =>  axis.3.home-sw-in
net a-neg-limit     =>  axis.3.neg-lim-sw-in
net a-pos-limit     =>  axis.3.pos-lim-sw-in



 
Attachments:

Please Log in or Create an account to join the conversation.

More
28 Dec 2025 16:40 #340623 by PCW
What is the actual error?

Please Log in or Create an account to join the conversation.

More
28 Dec 2025 21:45 #340632 by manny
I meant it as an error — I’m not sure how to configure it, what I’m doing wrong, and why the AXIS_A code is written incorrectly. please

Please Log in or Create an account to join the conversation.

More
28 Dec 2025 21:50 #340633 by PCW
By error I mean:

What does LinuxCNC report?

Can you post the complete hal file?

Please Log in or Create an account to join the conversation.

Time to create page: 0.101 seconds
Powered by Kunena Forum