4th Axis rotation angle limit problem

More
10 May 2015 18:14 #58533 by andypugh
Since this thread started the mux_generic HAL component has been added to LinuxCNC.
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.

More
11 May 2015 02:06 #58540 by joneb
Hi Andy
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.

More
11 May 2015 02:13 #58541 by andypugh

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.

More
11 May 2015 14:11 #58558 by joneb
Hi Andy
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.

More
11 May 2015 19:29 #58561 by andypugh

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.

Another way would be to use G10 L20 : linuxcnc.org/docs/html/gcode/gcode.html#sec:G10-L20
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.
The following user(s) said Thank You: eFalegname

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

More
20 May 2015 19:28 #58891 by joneb
Hi Andy
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
Attachments:

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

More
20 May 2015 19:51 #58892 by andypugh

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
(note, a-dir not a-step)

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.
The following user(s) said Thank You: joneb

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

More
29 Sep 2016 08:05 - 29 Sep 2016 12:41 #81076 by toplakd
Hi.

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.
Last edit: 29 Sep 2016 12:41 by toplakd.

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

More
29 Sep 2016 10:25 #81078 by toplakd
Solved it by adding sleep 2.0 into M101 file :)

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.

More
07 Nov 2017 18:40 - 07 Nov 2017 18:42 #101503 by eFalegname
Hi Jonh, Hi Andy!
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

File Attachment:

File Name: XYZA-T.ini
File Size:3 KB

File Attachment:

File Name: XYZA-T.hal
File Size:5 KB

File Attachment:

File Name: custom.hal
File Size:1 KB
Last edit: 07 Nov 2017 18:42 by eFalegname.

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

Time to create page: 0.123 seconds
Powered by Kunena Forum