How to use LinuxCNC to control slave

More
02 Aug 2019 00:50 #141162 by cheng

Hi Cheng,

How is life in your beautifull city?

Relating to your post :

Machine configuration file is 'cpd17_x.ini'
Starting LinuxCNC...
.
emc/iotask/ioControl.cc 768: can't load tool table. If you add a tool.tbl file and a ini connection you are fertig with this one.
Found file(REL): ./cpd17_x.hal
HAL: ERROR: function 'not.0' not found You have a action to a "not" function somewhere in hal or your component's...
the "not" can be a little line statement somewhere that say's... I will not do this if you do that... So it looks like a if-else function.
www.linuxcnc.org/docs/devel/html/hal/basic-hal.html#_not
the bit inverter function is not found.
./cpd17_x.hal:12: addf failed Here it relates the "not" (bit inverter function) to cpd17_x.hal, line 12...
Shutting down and cleaning up LinuxCNC... Goodbye linuxcnc
LinuxCNC terminated with an error. You can find more information in the log:
/home/mg123/linuxcnc_debug.txt
and
/home/mg123/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

You are going good !



thanks Grotius
I am experiencing tropical storms here. So I saw the impact of bad weather on the city. This is also an alternative life.
I don't know how long it will take to use the LinuxCNC to control the motor, but I will do it when I have time.
The following user(s) said Thank You: cola wonton

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

More
02 Aug 2019 03:15 #141167 by cheng
hi everyone
A new problem arose after I changed the system.
I'm now running a xml ini hal file written by roschi.

error
user@debian:~/examples/ethercat_3axis_CIA402$ linuxcnc basic_3_CIA402.ini 
LINUXCNC - 2.7.14
Machine configuration directory is '/home/user/examples/ethercat_3axis_CIA402'
Machine configuration file is 'basic_3_CIA402.ini'
Starting LinuxCNC...
Found file(REL): ./basic_3_CIA402.hal
./basic_3_CIA402.hal:1: lcec_conf exited without becoming ready
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/user/linuxcnc_debug.txt
and
    /home/user/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

dmesg file

File Attachment:

File Name: a.txt
File Size:49 KB


liuxcnc_debug.txt and linuxcnc_printf.txt

File Attachment:

File Name: linuxcnc_d...8-01.txt
File Size:0 KB

File Attachment:

File Name: linuxcnc_print.txt
File Size:1 KB


ini xml hal file

File Attachment:

File Name: basic_3_CI...8-01.ini
File Size:2 KB

File Attachment:

File Name: basic_3_CI...8-01.xml
File Size:4 KB

File Attachment:

File Name: basic_3_CI...8-01.hal
File Size:1 KB


I think we're pretty close to successfully controlling the motor.
Attachments:

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

More
02 Aug 2019 04:26 #141168 by cheng
The good news.
I successfully used linuxcnc to control the motor.Thanks to everyone, especially Grotius, for their help.
Next, I'm going to control the motor to draw a square. I need to modify it.

cheng

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

More
02 Aug 2019 17:58 #141213 by Grotius
@Cheng,

Good news....
You are quite quick in writing a new ethercat motor driver.

Important is the next item :

To post your source code over here on the forum, when you are ready.
Motivated like a short how to tutorial, with the type motor drives, the c code, etc. In one zip file would be nice if that fit's to upload.

Thanks to everyone, especially Grotius, for their help.
You are welcome. Maybe one day i could ask you for help...

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

More
03 Aug 2019 05:42 #141252 by cheng
No, the driver code is not what I wrote. The model of the drive I just used is the same as the roschi. I am using the middle code of lece_generic.c.

Still need to ask a question. Now I am using the code for a generic type drive. Next I need to control the motor is it only need to modify the hal file?

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

More
03 Aug 2019 19:59 - 03 Aug 2019 20:00 #141294 by Grotius
Hi Cheng,

I am using the middle code of lece_generic.c.

it's lcec, no lece.
Just be more specefic about the "middle code"

Otherwise give a link to the Roschi code with some explanation. And more info what you exactly mean with "middle code"

Next I need to control the motor is it only need to modify the hal file?
If it's a pid, you don't need a very high update time. So in fact you can leave your xml update time quite slow.
The rest you can do in hal. Just as you say my friend.
Last edit: 03 Aug 2019 20:00 by Grotius.
The following user(s) said Thank You: cheng

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

More
05 Aug 2019 00:46 #141380 by cheng
t is my spelling mistake. The correct one should be "lcec_generic". The link to the code I am using.
xml,hal and ini file link .



If it's a pid, you don't need a very high update time. So in fact you can leave your xml update time quite slow.
The rest you can do in hal. Just as you say my friend.

Thank you. I understand what to do next.
The following user(s) said Thank You: Grotius

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

More
05 Aug 2019 15:36 #141429 by Dinuka_Shehan
Use a hex inverter to connect a slave motor

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

More
06 Aug 2019 23:46 - 06 Aug 2019 23:50 #141552 by Grotius
Cheng,

The link is not working....

Please post your own working files over here. does not matter if it's not up to date.
We must stay up to date with working config's over here.

Dinuka,
Use a hex inverter to connect a slave motor
Hmmm.... A motor has no need for a hex connector... Where did you get this info?
forum.arduino.cc/index.php?topic=161783.0

This is for Dinuka to provide more info the next time :
If you say something, please provide info for how and why... Otherwise it looks like crap.
Last edit: 06 Aug 2019 23:50 by Grotius.
The following user(s) said Thank You: tommylight

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

More
07 Aug 2019 01:04 - 07 Aug 2019 01:18 #141557 by cheng
hi Grotius

The link is not working....

Please post your own working files over here. does not matter if it's not up to date.
We must stay up to date with working config's over here.


Sorry, there's something wrong with the link I provided. I packed the file and uploaded it.

File Attachment:

File Name: file.rar
File Size:2 KB


Now it's just passing the servo motor through the slave of the estun. I can only use the left and right arrows on the keyboard.

My description may not be clear. I intercepted a picture to illustrate. After executing "Linuxcnc basic_3_CIA402.ini", I can only control the movement of the motor through the arrow of the keyboard

Next, I want to generate the Gcode, from the picture and drive the motor according to the Gcode.

Can you give me some advice and examples?

For example, what files do I need to modify?

Thanks.

By cheng
Attachments:
Last edit: 07 Aug 2019 01:18 by cheng. Reason: Problem description error
The following user(s) said Thank You: Grotius

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

Time to create page: 0.581 seconds
Powered by Kunena Forum