Stepper as a spindle

More
02 Nov 2019 04:48 #149406 by vedatech
I am a trying to set up a stepgen to drive a stepper motor as a spindle
My required configuration is:
4 stepgen axes - X B C W and a 5th stepgen used like a spindle (not in kinematics)
The spindle is a rotation about W and therefore not associated with any Axis or Joint.
The XBCW axes are working after getting help in a previous topic but I do not know
how to connect the spindle control signals to the 5th stepgen.

Currently I have:
1. A Mesa 6i25 running modified 5i25 firmware with 7 stepgens
mesaflash --device 5i25 --readhmid - finds card and shows correct stepgens configured
There are no attached breakout boards in this machine.

2. LINUXCNC - 2.9.0~pre
Linux 5.0.21-rt16 #1 SMP PREEMPT RT

3. RIP in ~/linuxcnc-dev
System runs examples like 'configs/sim/axis_9axis.ini' without any problems

4. I used pncconf to create a basic HAL/INI file set for XYZA and a mesa 5i25+7i76x2 -With One 7i76 as a starting point.
After editing the HAL/INI files to have my XBCW axes working.

With the attached HAL file I can run Gcode for XBCW.

Using the HAL meter in AXIS I can see the speed, direction and other spindle inputs changing but can't get the stepgen (in velocity mode) to generate any output. All of the examples I have seen have repurposed an Axis like A but I don't see how I can do that since there is no Axis defined for rotation about W. Any suggestions?
Attachments:

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

More
02 Nov 2019 18:42 #149435 by Todd Zuercher
Replied by Todd Zuercher on topic Stepper as a spindle
The hardware stepgens are already in velocity command mode, That is why they need the PID loops for position control. You should not need to have closed loop for the spindle command so comment out all the pid stuff for the spindle stepgen, then directly connect the spindle velocity command output to the stepgen's velocity input.
comment out these lines and add this one in your hal file, and I think it may work.
#addf pid.s.do-pid-calcs       servo-thread

#setp   pid.s.Pgain     [SPINDLE_0]P
#setp   pid.s.Igain     [SPINDLE_0]I
#setp   pid.s.Dgain     [SPINDLE_0]D
#setp   pid.s.bias      [SPINDLE_0]BIAS
#setp   pid.s.FF0       [SPINDLE_0]FF0
#setp   pid.s.FF1       [SPINDLE_0]FF1
#setp   pid.s.FF2       [SPINDLE_0]FF2
#setp   pid.s.deadband  [SPINDLE_0]DEADBAND
#setp   pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
#setp   pid.s.error-previous-target true
#setp   pid.s.maxerror  [SPINDLE_0]FERROR

#net s-index-enable  <=> pid.s.index-enable
#net s-enable        =>  pid.s.enable
#net s-pos-cmd       =>  pid.s.command
#net s-pos-fb        =>  pid.s.feedback
#net s-output        <=  pid.s.output

net s-output  <= spindle.0.speed−out

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

More
02 Nov 2019 22:48 #149452 by vedatech
Replied by vedatech on topic Stepper as a spindle
Thanks Todd,
Its working now. I did have to add:
s-output => spindle.0.on to get M3 to start it.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum