How to use LinuxCNC to control slave

More
7 years 2 months ago #141162 by cheng

Grotius wrote: 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.

Please Log in to join the conversation.

More
7 years 2 months ago #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
Code:
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

Attachment not found



liuxcnc_debug.txt and linuxcnc_printf.txt

Attachment not found


Attachment not found



ini xml hal file

Attachment not found


Attachment not found


Attachment not found



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

Please Log in to join the conversation.

More
7 years 2 months ago #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 to join the conversation.

More
7 years 2 months ago #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 to join the conversation.

More
7 years 2 months ago #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 to join the conversation.

More
7 years 2 months ago #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.

Please Log in to join the conversation.

More
7 years 2 months ago #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.

Please Log in to join the conversation.

More
7 years 2 months ago #141429 by Dinuka_Shehan
Use a hex inverter to connect a slave motor

Please Log in to join the conversation.

More
7 years 2 months ago #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.

Please Log in to join the conversation.

More
7 years 2 months ago #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.

Attachment not found



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

Attachment not found



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

Please Log in to join the conversation.

Time to create page: 0.106 seconds
Powered by Kunena Forum