Configure Control Pendant P4-S - iMach3

More
28 Oct 2015 01:47 #64366 by jstoquica
Good Day,

Recently I buy a Control Pendant to use with my retrofitting project. The robot is not yet operating, but I would use the pendant for teaching, in the vismach simulation for now.

I want to configure the pendant for working with linuxcnc. This is the descrption of the device:





At the developer site, I can download config files for linuxcnc (99-vistacnc-pendant.rules, Makefile, vc-p4s, vc-p4s.hal). And some instructions for install the files. I attached them.

When I want to test with a some linuxcnc config example like Puma560, but some errors was generated:
libusb couldn't open USB deivce /dev/bus/usb/008/002: permission denied.
libusb requires write access to USB devices nodes.
vc-p4s.hal:74: Pin 'halui.mdi-command-05' does not exist

I did my config simulation in RIP mode, therefore I have to work in root mode. Will I try to work in my config folder (RIP mode) for test the pendant, or I can test and configure in normal user mode?

Thanks and regards.
Attachments:

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

More
28 Oct 2015 05:09 - 28 Oct 2015 11:14 #64374 by dgarrett

I did my config simulation in RIP mode, therefore I have to work in root mode. Will I try to work in my config folder (RIP mode) for test the pendant, or I can test and configure in normal user mode?


You should not need to run as root if udev is configured for the device (running LinuxCNC as root can cause numerous hard-to-debug problems later).

for example, for the xhc-hb04 pendant, the udev rule is:
ATTR{idProduct}=="eb70", ATTR{idVendor}=="10ce", MODE="0666", OWNER="root", GROUP="plugdev"

Change the idProduct and idVendor as required for the device. You will then need to trigger udev
or reboot.

Ref:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...0d;hb=refs/heads/2.7


the man page for udev gives some info on location for udev rules files:
$ man udev
...]
RULES FILES
       The udev rules are read from the files located in the system rules directory /lib/udev/rules.d,
       the volatile runtime directory /run/udev/rules.d and the local administration directory
       /etc/udev/rules.d. All rules files are collectively sorted and processed in lexical order,
       regardless of the directories in which they live. However, files with identical filenames
       replace each other. Files in /etc have the highest priority, files in /run take precedence over
       files with the same name in /lib. This can be used to override a system-supplied rules file with
       a local file if needed; a symlink in /etc with the same name as a rules file in /lib, pointing
       to /dev/null, disables the rules file entirely. Rule files must have the extension .rules; other
       extensions are ignored.
...
Last edit: 28 Oct 2015 11:14 by dgarrett. Reason: add udev man page info
The following user(s) said Thank You: jstoquica

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

More
25 Nov 2015 23:32 #65805 by jstoquica
Thanks for your answer.

I had to update the firmware of the pendant, and as you said copy the rules at right locations. After that the simulation was a success, with cnc machines and Puma configuration.

Now for my own manipulator (Run In Place Mode) configurations I have doubts:

In normal LinuxCNC mode I did the next:


2. Copy and move files to LinuxCNC PC

Makefile
vc‐p4s
vc‐p4s.hal
99‐vistacnc‐pendant.rules

3. Put Makefile, vc‐p4s and 99‐vistacnc‐pendant.rules to “src” under home directory ~/src$. If

there is a Makefile in that directory, name that make file to different name, like Makefile_old.

4. Run make install , this will install vc‐p4s to /usr/bin and 99‐vistacnc‐pendant.rules to

/lib/udev/rules.d

5. Put vc‐p4s.hal to your config directory, the same directory as .ini file.

6. add lines to .ini files:

[HAL]

HALFILE = my­mill.hal
HALFILE = vc­p4s.hal
POSTGUI_HALFILE = custom_postgui.hal

HALUI = halui
[HALUI]
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=G10 L20 P1 X0
MDI_COMMAND=G10 L20 P1 Y0
MDI_COMMAND=G10 L20 P1 Z0
MDI_COMMAND=G0 X0 Y0 Z0
MDI_COMMAND=G10 L20 P1 A0
MDI_COMMAND=G10 L20 P1 B0
MDI_COMMAND=G10 L20 P1 C0


o Makefile has:
CFLAGS=-I/usr/include/linuxcnc

all:    vc-p4s

vc-p4s: vc-p4s.cc
        g++ $(CFLAGS) vc-p4s.cc -o $@ -lusb-1.0 -lm -llinuxcnchal -llinuxcncini
        
install:
        sudo install -m 0755  -g root -o root vc-p4s /usr/bin
        sudo install -m 0755  -g root -o root 99-vistacnc-pendant.rules /lib/udev/rules.d

Then, how can I control my own manipulator configs in RIP mode compatible with the pendant? When I talking about RIP mode is when I have the source file and I add kinematics files for a new manipulator conf like Puma560 and some folders are diferents like /lib/.... or usr/include ....

RIP envioroment with source file Linuxcnc 2.5.0:
cd src

In the source directory, build LinuxCNC:

./autogen.sh  (this builds the configure script)
./configure --enable-run-in-place
make clean
make
sudo make setuid

to run the software go back to the top level directory, and issue:

scripts/. rip-environment
linuxcnc

Thanks a lot.

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

More
26 Nov 2015 00:08 #65807 by dgarrett
I'm not sure i understand the question but:

CFLAGS=-I/usr/include/linuxcnc


presumes that LinuxCNC is installed (a DEB install) on the system.

This might work with a RIP build if you have _both_ a git tree for RIP
and a _compatible_ DEB installed simultaneously. If you ever get the
RIP install and the DEB install out-of-sync, there will be some
hard-to-identify problems.


For use exclusively with a RIP install, the line would probably be
something like:
CFLAGS=-I/the_path_to_your_top_git_dir/include
The following user(s) said Thank You: jstoquica

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

More
22 Mar 2016 20:37 - 22 Mar 2016 20:37 #72052 by jstoquica
Hi,

It's true, I compile the entire Linuxcnc without rip mode, directly at /usr/.
cd src
.autogen.sh
./configure --prefix=/usr
make clean
make
sudo make setuid

Thanks.
Last edit: 22 Mar 2016 20:37 by jstoquica.

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

More
21 Jan 2017 03:23 #86333 by Jake
Have you gotten to where you can use the pendant yet? How do you like it?

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

Time to create page: 0.143 seconds
Powered by Kunena Forum