How to write HAL logic with Motion and Offset pin?

More
09 Aug 2016 13:47 #78530 by giantstone
Hi everyone, I’m planning to make my standard 4-axis(X Y Z A) workstation cut a series of lines(curves) according to my inputs. The non-trivial part of my goal is that while cutting curves in the X-Y plane I need to use a visual sensor to control the Z axis in real-time. The work-flow(path) of my end tool will be: go to the start point of the first curve in an open space, start spinning the blade(always tangent to the cutting point) , go down until visual sensor feedback says ok, follow the first curve (while my visual sensor adjust the height of the tool in real-time) to the last point, then cut the next curve the same way and so forth.

The control board I’m using is a BeagleBone-black with Cramps 2.2. There is a config file available from Machinekit(see attachment). And I’m instructed to use HAL pins (motion and offset in particular to achieve my goal.

Here is the plan I came up with: Design a HAL logic which includes motion pins (to parse the cutting movement) and offset pins( to control the Z axis), integrate the HAL logic into a python script, say main.py, that imports linuxcnc( and may use pygtk). ( The main.py will receive the cutting-curves in the machine coordinate system from ROS (robotics operating system) topics, either in the form of a series of sets of coordinates or an depth image, I can do this part myself.) After receiving the cutting-curve, the Linuxcnc will start generating G-codes, and start cutting the curves in the way I described above.

Unfortunately I find it hard to write the HAL logic and integrate everything to my main.py ( I have 0 experience with linuxcnc and HAL, I’m looking for someone who find this easy please help me with some sample scripts or help me to write the frame of my main.py (without the ROS part) .

I’m really grateful for your time and help, and I’m willing to pay some cash for your help.
Please leave a message if you would like to do me a favor.
Attachments:

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

More
09 Aug 2016 20:41 #78542 by tommylight
Use the plasma THC config, instead of connecting the UP/DOWN/ARC OK signals, connect the outputs from BBB as needed.
So signal from BBB "ok to move" to "ARC OK", signal "go higher" to "UP, signal "go lower" to "DOWN". That would basically be it, assuming you have those signals or something similar.
Regards,
Tom
The following user(s) said Thank You: giantstone

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

More
10 Aug 2016 06:16 #78560 by giantstone
Hi Tommy, I found the plasma THC config, but my linuxcnc does not run with it, it reports an config error, axis not found etc.
I attached the config files from linuxcnc.
maybe I need to fully understand everything and make some neccesary changes before I can make use of it.
Attachments:

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

More
10 Aug 2016 08:55 #78563 by giantstone
Hi, Tommy, Do you know how I can generate Gcode from a series of coords or a depth image from a python script?
I have a python script that stores a series of coords/ a depth image, I want to generate Gcode acoording to my coords/depth image, and make LNC start working with my coords.

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

More
10 Aug 2016 11:54 #78570 by tommylight
That config has a missing ">" se link for more info how to fix it.
forum.linuxcnc.org/forum/46-francais/312...-plasma?limitstart=0
As for depth map, you can use image2gcode that comes with linuxcnc and has a lot of settings that you can adjust to get the needed results, or use dmap2gcode that is a lot easier to use and produces nice clean gcode that you can easily edit if needed.
Here is a link to a post that deals with dmap2 gcode that i used for some of my machines
forum.linuxcnc.org/forum/10-advanced-con...e-superimosing-a-pic
Regards,
Tom
The following user(s) said Thank You: giantstone

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

More
11 Aug 2016 14:18 #78615 by giantstone
Thanks for the config instructions =)
I'm planning to use image2gcode or dmap2gcode, but I'm not clear how to use them.
In my plan,
I will import linuxcnc in a python script,
and generate G codes from a series of coordinates or from a depth image within the script,
then I start running G-codes while using linuxcnc.stat().poll() to read the starts and use linuxcnc.command to control the motion mode.

but from the python interface documentation page I didn't find a command like dmap2gcode. so, I don't know how to generate Gcodes from an image or from a series of coords in a python script and start running the G-codes.

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

More
11 Aug 2016 16:18 #78628 by tommylight
www.scorchworks.com/Dmap2gcode/dmap2gcode.html
Download it from the link, make it executable if it already isn't and double click on it. If it does not work and you get a text editor, close it and right click on it, choose >open with>other application, there under "use a custom command" type "python".
Now you can open an image and set the parameters for it like dimensions and max depth etc and that will generate the ready to use gcode.
Tom

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

More
20 Aug 2016 02:34 - 20 Aug 2016 05:05 #79112 by giantstone
Hey Tom, I spent quite some time to try linuxcnc, i think it's really useful,
the hardware I'm using changed to a desktop with ASUS Z170-AR board and an iI6700K CPU, I bought a PCIe to Parallel and a PCI to Parallel card(MOS 9865) , the stepper controller board is a TB6560 board (AL-ZARD)
however Im having another problem, I failed to make ROS and Linuxcnc run together.

<edit> problem being solved, hhaha, i was building a wrong ros version with debian wheezy;


I tried to install ROS in a Debian system (Debian Jessie and Debian Wheezy, and Ubuntu Precise ) with linuxcnc already installed, I failed, because " the system holds broken packages ,,, can not install package xxx etc"
I tried to install Linuxcnc alongside with ROS in a Ubuntu system (ubuntu 14.04 trusty, ROS already installed) , I succeeded installing Linuxcnc and I was able to start it, but it can't be run in a non-simmulation mode (some errors such as command timeout and configuration errors occured that stopped linuxcnc; however I was able to run non-sim mode with the same configuration in Debian systems with the same desktop).
I tried to change my ubuntu 14.04 's kernel to RTAI kernel, but the system didn't boot properly, an error says INIT file not found.

Could you tell me how to make ROS and Linuxcnc run together?

The machine I'm building is to cut fur coats etcs. not skinning cats btw. :S
The gears haven't been installed properly, what I have is only a frame right now. see my picture.


Attachments:
Last edit: 20 Aug 2016 05:05 by giantstone.

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

More
20 Aug 2016 13:26 #79124 by tommylight
That looks neat !
I have not used ROS, so i can not help with that, although i can not figure out why you would use that for a 3 axis machine.
As far as i understood you, there is no need for ROS, you need a normal 3 axis machine, the only difference being that you need to change the Z axis values during work, all that is already implement in several versions of THC control for plasma cutters.
Moving on :laugh:

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

More
21 Aug 2016 14:57 - 22 Aug 2016 03:22 #79202 by giantstone
how do i delete my comments
Last edit: 22 Aug 2016 03:22 by giantstone.

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

Time to create page: 0.098 seconds
Powered by Kunena Forum