is there 5 axis

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: is there 5 axis

Post by adamLange »

harshmacwan,

Is the modelIKa python module on your python path? Maybe it's segfaulting because I didn't do any error checking after trying to import modelIKa and it's not on your python path.

You can add it by adding this to your ~/.bashrc script and then closing all open terminals.

export PYTHONPATH=$PYTHONPATH:/path_to_wherever_you_installed_modelIKa/modelIKa/python

Run an interactive python3 terminal from the same directory where you run modelica and make sure you can import modelIKa.

Adam
harshmacwan
Posts: 12
Joined: Sun May 30, 2021 3:03 pm

Re: is there 5 axis

Post by harshmacwan »

adamLange wrote: Thu Jun 03, 2021 2:33 am harshmacwan,

Is the modelIKa python module on your python path? Maybe it's segfaulting because I didn't do any error checking after trying to import modelIKa and it's not on your python path.

You can add it by adding this to your ~/.bashrc script and then closing all open terminals.

export PYTHONPATH=$PYTHONPATH:/path_to_wherever_you_installed_modelIKa/modelIKa/python

Run an interactive python3 terminal from the same directory where you run modelica and make sure you can import modelIKa.

Adam

Thank you for your input. I have path setup correctly in pythonpath. I can also import modelIKa in interactive python3 terminal. attached screenshots for reference.
Trying to figure out any environment issue related to that.. If you have any other way to check or other suggestions, I should try please let me know.

Seems something wrong with libControlInterface.so, I used same Makefile you provided in git - https://github.com/adamLange/modelIKa/b ... l/Makefile
I even tried to create sample c program which calls controlinterface library built in my system from above Makefile and faced segfault.
Is it possible to share libControlInterface.so file if you have built for ubuntu 18?
Attachments
import_works.png
import_works.png (16.14 KiB) Viewed 4057 times
python_path.png
python_path.png (10.38 KiB) Viewed 4057 times
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: is there 5 axis

Post by adamLange »

This is the entire makefile. python3.6 is hardcoded everywhere, and it looks like you have python 3.7. Can you try replacing all the 3.6 with 3.7?

Code: Select all

libControlInterface.so: ControlInterface.c
	gcc -c -Wall -Werror -fpic ControlInterface.c -I/home/adam/projects/OpenModelica/build/include/omc/c $$(python3.6-config --includes) 
	gcc -shared -o libControlInterface.so ControlInterface.o $$(python3.6-config --ldflags)
harshmacwan
Posts: 12
Joined: Sun May 30, 2021 3:03 pm

Re: is there 5 axis

Post by harshmacwan »

adamLange wrote: Fri Jun 04, 2021 2:32 am This is the entire makefile. python3.6 is hardcoded everywhere, and it looks like you have python 3.7. Can you try replacing all the 3.6 with 3.7?

Code: Select all

libControlInterface.so: ControlInterface.c
	gcc -c -Wall -Werror -fpic ControlInterface.c -I/home/adam/projects/OpenModelica/build/include/omc/c $$(python3.6-config --includes) 
	gcc -shared -o libControlInterface.so ControlInterface.o $$(python3.6-config --ldflags)
Hi Adam,

Thanks for the rply again

I have python3.6 installed with all packages so it should work but I tried with python3.7 as well.. No luck.
After that I tried with fresh system without any extra packages and seems at least controlinterface is no more giving segfault. thank you for your help to solve this error.

Now, with my test program when I use libControlInterface.so, it opens 8826 PORT. So, I assume it has no more build issue now.
But when same libControlInterface.so file used in Open Modelica for simulation, PORT 8826 is not opened, which eventually results in failure of pass_1.py.

We are no more getting segfault error, that is good and progress at our end. But still some other errors are there as attached screenshot. Do you think those errors may be the reason openmodelica can not open PORT 8826? Any clue ?
Attachments
error-5-6-21.jpg
error-5-6-21.jpg (279.49 KiB) Viewed 3936 times
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: is there 5 axis

Post by adamLange »

Can you please check the hard coded port numbers with grep like this?

Code: Select all

~/projects/modelIKa$ grep -iP '88' --include=*py -R
python/ModelIKa/__init__.py:    PORT = 8826
python/ModelIKa/IKClientTest001.py:client = ModelIKa.IKClient("127.0.0.1",8822)
python/ModelIKa/IKClient.py:  def __init__(self,host="124.0.0.1",port=8822):
python/ModelIKa/ikTestClient.py:PORT = 8822
python/toolpathGeneration/simple_5_axis_example/pass_2.py:ik_client = IKClient("127.0.0.1",8826)
python/toolpathGeneration/simple_5_axis_example/pass_1.py:ik_client = IKClient("127.0.0.1",8826)
python/toolpathGeneration/helixTurningTest.py:    iksolver = IKClient("127.0.0.1",8826)
Change the port numbers so they are all the same.
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: is there 5 axis

Post by adamLange »

harshmacwan wrote: Fri Jun 04, 2021 6:35 pm
Hi harshmacwan,

I pushed a new commit. I added a helloWorld:

/python/toolpathGeneration/simple_5_axis_example/helloWorld.py

Can you please try it?

I also fixed some socket options and homogenized the port numbers.

Adam
harshmacwan
Posts: 12
Joined: Sun May 30, 2021 3:03 pm

Re: is there 5 axis

Post by harshmacwan »

adamLange wrote: Sun Jun 06, 2021 2:34 am
harshmacwan wrote: Fri Jun 04, 2021 6:35 pm
Hi harshmacwan,

I pushed a new commit. I added a helloWorld:

/python/toolpathGeneration/simple_5_axis_example/helloWorld.py

Can you please try it?

I also fixed some socket options and homogenized the port numbers.

Adam
Amazing, This worked and GCODE was generated.

I have attached the code here.

Thanks a ton Adam for your help and contribution towards Open source CAD/CAM. Now me and my friends are on the track towards making a freecad work bench and seamless 5 axis generation. I will be very happy if you provide your suggestions.

Harsh

Code: Select all

(add tool offset moves from home ect...)
G43 H2
G21 G90 G93
G0 Z50
M3 S21390
G0 X-0.002905 Y0.010889 Z0.029513 A94.831881 B1.287190
G01 X-0.001804 Y0.011125 Z0.029510 A94.935841 B0.798657 F324.124272
G01 X-0.000680 Y0.011250 Z0.029508 A94.990894 B0.300746 F324.124272
G01 X0.000450 Y0.011261 Z0.029505 A94.995955 B-0.200153 F324.124272
G01 X0.001576 Y0.011160 Z0.029503 A94.951004 B-0.698973 F324.124272
G01 X0.002686 Y0.010946 Z0.029500 A94.856515 B-1.190664 F324.124272
G01 X0.003768 Y0.010622 Z0.029498 A94.713469 B-1.670248 F324.124272
G01 X0.004812 Y0.010192 Z0.029495 A94.523341 B-2.132890 F324.124272
G01 X0.005806 Y0.009660 Z0.029493 A94.288087 B-2.573943 F324.124272
G01 X0.006742 Y0.009032 Z0.029490 A94.010121 B-2.988992 F324.124272
G01 X0.007610 Y0.008314 Z0.029488 A93.692288 B-3.373917 F324.124272
G01 X0.008401 Y0.007514 Z0.029485 A93.337841 B-3.724909 F324.124272
G01 X0.009108 Y0.006639 Z0.029483 A92.950220 B-4.038673 F324.124272
G01 X0.009725 Y0.005698 Z0.029480 A92.532487 B-4.312639 F324.124272
G01 X0.010245 Y0.004701 Z0.029478 A92.089632 B-4.543422 F324.124272
G01 X0.010662 Y0.003657 Z0.029475 A91.626090 B-4.728820 F324.124272
G01 X0.010974 Y0.002578 Z0.029473 A91.146452 B-4.867080 F324.124272
G01 X0.011176 Y0.001474 Z0.029470 A90.655499 B-4.956891 F324.124272
G01 X0.011268 Y0.000355 Z0.029468 A90.158091 B-4.997413 F324.124272
G01 X0.011248 Y-0.000767 Z0.029465 A89.659176 B-4.988272 F324.124272
Last edited by harshmacwan on Mon Jun 07, 2021 10:42 pm, edited 2 times in total.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: is there 5 axis

Post by chrisb »

harshmacwan wrote: Mon Jun 07, 2021 4:00 pm I have attached the code here.
It's better to attach such gcodes in code tags than as an image.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
harshmacwan
Posts: 12
Joined: Sun May 30, 2021 3:03 pm

Re: is there 5 axis

Post by harshmacwan »

chrisb wrote: Mon Jun 07, 2021 7:43 pm
harshmacwan wrote: Mon Jun 07, 2021 4:00 pm I have attached the code here.
It´s better to attach such geodes in code tags than as an image.
Thanks, It's done
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: is there 5 axis

Post by chrisb »

harshmacwan wrote: Mon Jun 07, 2021 10:43 pm Thanks, It's done
thumbsup!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply