Test LinuxCNC without motors and encoders connected

More
7 years 4 months ago #137212 by Peterdeleu
Hi Bevins,

It is a Rover 18. This one has a spindel and a drill bank.
Both have a separate motor.
But yes, my problem is how to energize the correct motor relay and the correct relay of the pneumatic cilinder depending on de tool that is request (T).
I use Fusion 360, and I was hoping that I didn't have to change the G-code generated by the postprocessor.
So, if T10 is asked in the G-code, something (but what??) must activate the motor relay and the correspondending relay to lower the drill bit.

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

More
7 years 4 months ago - 7 years 4 months ago #137215 by bevins
I reread the thread. ROver 18.one spindle, no toolchanger and gang drills. This should be no problem.
You have regular spindle and one drill motor.

What I did was modify post processor to when you get end of program I remapped an mcode and that raised all drills and spindles. Also first thing to do in remap is make sure spindle is stopped and raise all drills and spindles. Then during remap drop the spindle or the selected_tool drill.

I would use NGC remap.

Logic should go something like:

M6
raise all drills and spindle,
Make sure spindle is stopped,( I did this because of tool changer, you may not need it)
check selected_tool
If selected_tool is tool in spindle tool #1, then drop tool
else if selected_tool is tool 2-10 deselect spindle 1, select and energize drill motor
if selected_tool is #2 drop tool
continue for each drill

exit remap
G43

M400 (raise all spindles and drills, turn off drill motor)
M2

That should just about do it.
Last edit: 7 years 4 months ago by bevins.

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

More
7 years 4 months ago - 7 years 4 months ago #137246 by HueyHQ
Hi Peter,

I have recently done similar to a Busellato (which seems to be similar to the Biesse), that has 3 spindles and ganged drills.

All credit goes to Bob (Mr bevins) who shared his config, which I managed to copy and modify to suit my machine - if he hadn't done that, I might still be trying to figure it out! So I'd like to repay the favour, and try provide the bits that make it work.

First, modify your machine.ini file RS274NGC parameter:
Code:
[RS274NGC] PARAMETER_FILE = linuxcnc.var USER_M_PATH = nc_subroutines SUBROUTINE_PATH = nc_subroutines:../../nc_files/remap_lib/common_nc_subs ON_ABORT_COMMAND = O <on_abort> call REMAP= M6 modalgroup=6 prolog=change_prolog ngc=tool_change epilog=change_epilog REMAP= M200 modalgroup=10 ngc=m200 #raise all tools
I have my /nc_subroutines folder in the same directory as the .ini file, and in that folder are the tool_change.ngc and m200.ngc files.

From memory, the prolog and epilog are derived from the Python std-glue routines, and are referenced as:
Code:
[PYTHON] PATH_PREPEND= ./python PATH_APPEND= ../../nc_files/remap_lib/python-stdglue TOPLEVEL= python/toplevel.py
(toplevel.py is in the config /python folder but only contains the line "import remap" in my case - remap.py is in the same folder.)

Next, the HAL connections are made between the physical output pins and the motion.digital output pins, which are the pins accessed by the M64 and M65 G-codes in the subroutines. In my case, I added this to custom.hal, along with other stuff:
Code:
### Drill Tools ### net drillmotor_on hm2_5i25.0.7i77.0.0.output-03 motion.digital-out-00 net drill01drop hm2_5i25.0.7i71.0.2.output-00 motion.digital-out-01 net drill02drop hm2_5i25.0.7i71.0.2.output-01 motion.digital-out-02 net drill03drop hm2_5i25.0.7i71.0.2.output-02 motion.digital-out-03 net drill04drop hm2_5i25.0.7i71.0.2.output-03 motion.digital-out-04 net drill05drop hm2_5i25.0.7i71.0.2.output-04 motion.digital-out-05 net drill06drop hm2_5i25.0.7i71.0.2.output-05 motion.digital-out-06 net drill07drop hm2_5i25.0.7i71.0.2.output-06 motion.digital-out-07 net drill08drop hm2_5i25.0.7i71.0.2.output-07 motion.digital-out-08 net drill09drop hm2_5i25.0.7i71.0.2.output-08 motion.digital-out-09 net drill10drop hm2_5i25.0.7i71.0.2.output-09 motion.digital-out-10 net drill11drop hm2_5i25.0.7i71.0.2.output-10 motion.digital-out-11 net drill12drop hm2_5i25.0.7i71.0.2.output-11 motion.digital-out-12 net drill13drop hm2_5i25.0.7i71.0.2.output-12 motion.digital-out-13 net drill14drop hm2_5i25.0.7i71.0.2.output-13 motion.digital-out-14 net drill15drop hm2_5i25.0.7i71.0.2.output-14 motion.digital-out-15 net drill16drop hm2_5i25.0.7i71.0.2.output-15 motion.digital-out-16 ### Spindle Tools ### # --- SPINDLE-AT-SPEED --- net spindle-at-speed motion.digital-in-22 <= hm2_5i25.0.7i77.0.0.input-22 net spindle-at-zero motion.digital-in-21 <= hm2_5i25.0.7i77.0.0.input-21 net spindle20relay hm2_5i25.0.7i77.0.0.output-00 motion.digital-out-17 net spindle21relay hm2_5i25.0.7i77.0.0.output-01 motion.digital-out-18 net spindle22relay hm2_5i25.0.7i77.0.0.output-02 motion.digital-out-19 net spindle20drop hm2_5i25.0.7i77.0.0.output-05 motion.digital-out-20 net spindle21drop hm2_5i25.0.7i77.0.0.output-06 motion.digital-out-21 net spindle22drop hm2_5i25.0.7i77.0.0.output-07 motion.digital-out-22

I have attached my tool_change.ngc (derived from included examples manual_toolchange.ngc) and m200.ngc (copied directly from Bob!) files for reference. Also in the /nc_subroutines folder are restore.ngc and on_abort.ngc, copied from the manual_toolchange examples, and on_abort is modifed to include M200 (raise all tools).

As Bob has said, the only modification to the post-processor is to add M200 before the M2 - not even strictly necessary as it will be done on the next run, but does tidy up the machine state.

I hope this helps, and that I haven't missed anything.
Last edit: 7 years 4 months ago by HueyHQ. Reason: Added remap.py
The following user(s) said Thank You: bevins, ross_dev

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

More
7 years 4 months ago #137277 by Peterdeleu
Whooww.. this is a lot of information :)
I'll try to understand everything in the coming days.
This is all new to me, so it will take some time.
Tx all !!

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

More
7 years 4 months ago #137283 by Peterdeleu
I have a error message during startup.

Error message in toplevel.py > import remap
Importerror : No module named remap

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

More
7 years 4 months ago #137286 by bevins

Peterdeleu wrote: I have a error message during startup.

Error message in toplevel.py > import remap
Importerror : No module named remap


Have a long read here . This is something you need to understand to make work. There is alot of little parts that have to be in place. We can help but, it wont do any good unless you can at least see the structure.

Study the example remaps also in linuxcnc.

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

Moderators: cmorley
Time to create page: 0.070 seconds
Powered by Kunena Forum