- Posts: 245
- Thank you received: 0
Working XYZA positional 4th axis system: how to modify to make A a velocity axis
I intend to have my spindle operate simultaneously with A.
The axis is too long to sit under the X-axis gantry so it sits along Y-. I redd here on the forum that that means it's really a B-axis. Off I went to change the wires on my 5-axis "Mach3" parallel-port-interface board from A- to B- pins, only to find out that the Bdir pin (17) is already in use to activate the spindle-on relay. So unless I figure out how to provide that spindle-power-on another way, I'll be addressing the 4th axis along Y as the A-axis.
My questions are:
1. After making a carbon copy of the working linuxcnc/config/xyza/ directory to xyzl/ ('ell' as in 'lathe'), and renaming the .ini and .hal files to match, how do those two files need to be modified to run the A-axis in constant-velocity mode? [1]
2. What G-code commands will I need to address the A-axis, as a lathe spindle? For example, how would I command it to rotate at 10rpm?
I'll attach the, working, xyza.ini and xyza.hal, files, and my thanks for your looking them over.
[1] the only thing I think I know is that I have to change the 4th/A axis control_type to 'v', velocity. After that, cluelessness closes over me.
--
CluNC
Please Log in to join the conversation.
xyzl.ini
* change 'xyza' to 'xyzl' everywhere (2 places)
xyzl.hal
* change 'p,p,p,p' in the "loadrt stepgen" line to 'p,p,p,v'
* comment-out "net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd" because of error thrown:
("stepgen.3.position-cmd does not exist")
* add new line "net apos-cmd axis.3.joint-vel-cmd => stepgen.3.velocity-cmd"
Result:
* after homing, G1 A5 F10 moves A-axis to 5 degrees, so A-axis positioning still works
* this reflects my confusion about how to command A to rotate at a particular angular velocity (as well as my confusion about whether signal 'names', like 'apos-cmd' are signficant; after it was defined by the 'net' command, I found no other reference to 'apos-cmd' in the .hal and guessed that it might be tied, somehow, to the G-code "A" command), so I left it rather than rename it to, say, 'avel-cmd'.
EDIT: I also tried renaming it with no change in behavior of the "A" command.
Please Log in to join the conversation.
Configuring LinuxCNC->Basic Configuration?
I apologize to have paid no attention to this at the outset.
Thank you.
CluNC
Please Log in to join the conversation.
forum.linuxcnc.org/forum/49-basic-config...-a-2nd-spindle#33080
I've tried another version of the xyzl_2ndpwm.hal [attached] creating a second pwmgen to connect to the A-axis.
I now get a buzzing sound[1] on the A-axis stepper, which is either the sound of steps too fast to be acted on, or alternate steps being in opposite directions.
I have tried:
setp pwmgen.1.scale 1000.0
to
setp pwmgen.1.scale 0.001
I have
setp pwmgen.1.pwm-freq 100.0
simply duplicated from the cutting spindle's entry.
[1] e.g., with M68 E0 Q50
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22012
- Thank you received: 4
To put it in velocity mode, there should be an entry in the hal file with something like:
stepgen_mode = p,p,p,v
after the
stepgen_type = 0,0,0,0
or something similar, i can not recall as it has been over 5 years since i used it.
Please Log in to join the conversation.
Please Log in to join the conversation.
I'm still puzzling over what seems to be changing meaning of "velocity" when I switch between "position" and "velocity" modes on the A-axis. For example, I can issue "G1 F21000 A300" in position mode with no problem, but a similar "M100 P21000" (using the associated M100 (bash-shell script) to poke values into the .HAL file while the machine is running, causes a joint-3-following error.
I suspect it's in the units: steps/second for position-mode? degrees/sec for velocity-mode?
I'm also looking into replacing the M100/M101 pair of user-m-code scripts with a single, M133, (3 for axis_3) using two arguments, P<mode> Q<dps>, <dps> to set velocity in degrees/sec(?), <mode> to toggle between position and velocity.
Please Log in to join the conversation.
Save it to your macros directory, rename it back to M133.pl and make it executable, and make a symlink there with no file extension (LinuxCNC expects M commands to be named "Mnnn").
Usage:
M133 P1 Q30 ; set velocity-mode and rotation to 30deg/sec
M133 P0 ; set position mode--abruptly stops rotation, may be preferable to lower velocity first, for fast rotations; e.g.,
M133 P1 Q0
M133 P0
Please Log in to join the conversation.
clunc wrote: I'm still puzzling over what seems to be changing meaning of "velocity" when I switch between "position" and "velocity" modes on the A-axis. For example, I can issue "G1 F21000 A300" in position mode with no problem, but a similar "M100 P21000" (using the associated M100 (bash-shell script) to poke values into the .HAL file while the machine is running, causes a joint-3-following error.
I suspect it's in the units: steps/second for position-mode? degrees/sec for velocity-mode?.
F21000 probably means 21,000 degrees/minute or 58 rpm. M100 P21000 might mean 21000 rpm...
Please Log in to join the conversation.
Please Log in to join the conversation.
