4th Axis rotation angle limit problem
www.linuxcnc.org/docs/html/man/man9/mux_generic.9.html
So there is now no need to re-configure pins on the fly, the mux-can to it.
Please Log in or Create an account to join the conversation.
How can I find out how this works, the link you give doesn't mean a lot to me.
Regards John
Please Log in or Create an account to join the conversation.
How can I find out how this works, the link you give doesn't mean a lot to me.
It's hard to guess where to start the explanation. Are you familiar with the HAL layer in LinuxCNC which is where all the signals are "wired" together so that signals go to where they are needed?
linuxcnc.org/docs/html/hal/intro.html
Please Log in or Create an account to join the conversation.
I am a hobby LinuxCNC user with a home built machine and have just added a rotary axis, for my first project I made a ball. I was surprised to find that the only way I could find to turn the A"a axis was to was to move it a specific number of degrees which made my gcode complicated and then at the end of the program had to wind it back to home position. I now know that I could have changed the way the A axis is homed.
I then searched for a way to make the A axis moved continuously and came across this tread and have spent a couple of weeks getting it to work.
Judging by this thread getting the A axis to turn continuously is not a common request.
As regards to my knowledge of HAL its is only what I have learnt following this thread and working through the errors.
I only asked the question about the mux_generic HAL component thinking I could have just added a line to my HAL file and all would have worked, and this would be useful for other users
When I first started trying to get the Axis to rotate I saw you mention mux_generic HAL component in this thread and could find very little on the internet on how to use it.
Andy thankyou for all the help you have given me and other users over the years.
Thankyou
John
Please Log in or Create an account to join the conversation.
Another way would be to use G10 L20 : linuxcnc.org/docs/html/gcode/gcode.html#sec:G10-L20at the end of the program had to wind it back to home position. I now know that I could have changed the way the A axis is homed.
Or, possibly, to define WRAPPED_ROTARY in the INI file: linuxcnc.org/docs/html/config/ini_config.html#sub:AXIS-section
I only asked the question about the mux_generic HAL component thinking I could have just added a line to my HAL file and all would have worked, and this would be useful for other users
To use mux_generic instead of the user-Mcodes and on-the-fly hal re-wiring you would need to first decide how to switch modes. One simple (but not very obvious) way to do this would be to re-purpose the coolant-mist output as that is a pin easily toggled from G-code and the GUIs.
Then instead of the M-codes you would add the following to suitable places in the HAL file:
loadrt mux_generic config="bb2,bb2"
...
addf mux-gen.00 base-thread
addf mux-gen.01 base-thread
...
#step mux
net pos-step mux-gen.00.in-bit-00 stepgen.3.step
net vel-step mux-gen.00.in-bit-01 stepgen.4.step
net a-step mux-gen.00.out-bit parport.0.pin-32-out # This needs to be an actual pin that exists
#dir mux
net pos-dir mux-gen.01.in-bit-00 stepgen.3.dir
net vel-dir mux-gen.01.in-bit-01 stepgen.4.dir
net a-step mux-gen.01.out-bit parport.0.pin-33-out # This needs to be an actual pin that exists
# And this is what toggles the multiplexer.
#Other options include lube, or a generic M62 digital output
net a-mode iocontrol.0.coolant-mist mux-gen.00.sel000 mux-gen.01.sel000
This is typed from memory, so some pin names may be miss-speled.
Please Log in or Create an account to join the conversation.
I'm going round in circles trying to get this to work.
I am assuming that I change pins 32 &33 to 5&6 my A axis pins on the parallel port.
If I leave this line in net a-step mux-gen.01.out-bit parport.0.pin-06-out # This needs to be an actual pin that exists I get a error Hal 128 Signal 'a-step can not add Out pin 'mux-gen.01.out-bit, it already has Out pin 'mux-gen.00.out-bit.
If I leave this line in net a-mode iocontrol.0.coolant-mist mux-gen.00.sel-bit-00 mux-gen.01.sel-bit-01 I get the error ' Hal 130 Pin 'mux-gen.01.sel-bit-01 does not exist'. I modified this line after reading the mux -generic man page.
I have enclosed my Hal file. I would be very grateful if you could point me in the right direction.
Many thanks
John
Please Log in or Create an account to join the conversation.
If I leave this line in net a-step mux-gen.01.out-bit parport.0.pin-06-out # This needs to be an actual pin that exists I get a error Hal 128 Signal 'a-step can not add Out pin 'mux-gen.01.out-bit, it already has Out pin 'mux-gen.00.out-bit.
Sorry, copy and paste error on my part.
The mux-gen.01 output line needs to be
net a-dir mux-gen.01.out-bit parport.0.pin-33-out # This needs to be an actual pin that exists
I don't have a LinuxCNC machine here at the moment. But here is a way to find out what the pins are really called.
With linuxCNC not running open a Terminal window.
halrun
loadrt mux_generic config="bb2,bb2"
show pin
exit
You will get a list of all the actual pin-names that bb2,bb2 creates, which is probably better than guessing. Then use those ....sel.... pin names in the HAL file.
Please Log in or Create an account to join the conversation.
First I want to thank you all for this thread and supplied files, as I have succesfully added continuos rotation to my 4th Axis.
I still have one question.
How do I make smooth stop with M101, as when command is executed, motor
goes to immediate stop?
I'm using "pietvr" M100.zip as base.
Please Log in or Create an account to join the conversation.
halcmd setp stepgen.5.velocity-cmd 0
sleep 2.0
halcmd setp stepgen.5.enable FALSE
halcmd unlinkp stepgen.5.step
halcmd unlinkp stepgen.5.dir
halcmd net astep stepgen.3.step
halcmd net adir stepgen.3.dir
exit 0
Please Log in or Create an account to join the conversation.
- eFalegname
- Offline
- Elite Member
- Posts: 254
- Thank you received: 30
guys I really need your help please, without you I couldn't get the cnc running,I can't find my mistake...mux is making me crazy.
I attached my configuration bellow. Thanks
Floris
Please Log in or Create an account to join the conversation.