Arduino based USB Pendant for Linuxcnc

More
10 years 9 months ago #68988 by ymilord
Yeah exactly.

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

More
10 years 9 months ago - 10 years 9 months ago #68989 by ArcEye
From serialcon2.comp
Code:
bzero(buffer, 50); sprintf(buffer, "X%08.03fY%08.03fZ%08.03f", xposition, yposition, zposition); write(fd, buffer, sizeof(buffer));

So if you send "X1000.999Y2000.888Z3000.777"

That should populate those axes with those values
Last edit: 10 years 9 months ago by ArcEye.

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

More
10 years 1 month ago - 10 years 1 month ago #80554 by Tchefter
Hi @all :)
can someone tell me what USB Device i put in the serialcon?

Sep 18 13:10:45 v3 kernel: [ 434.312142] usb 7-1: new full-speed USB device number 4 using uhci_hcd
Sep 18 13:10:46 v3 kernel: [ 434.518175] usb 7-1: New USB device found, idVendor=2341, idProduct=0043
Sep 18 13:10:46 v3 kernel: [ 434.518183] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
Sep 18 13:10:46 v3 kernel: [ 434.518190] usb 7-1: Manufacturer: Arduino ( www.arduino.cc )
Sep 18 13:10:46 v3 kernel: [ 434.518201] usb 7-1: SerialNumber: 5543131373735170A212
Sep 18 13:10:46 v3 kernel: [ 434.521254] cdc_acm 7-1:1.0: ttyACM0: USB ACM device
Sep 18 13:10:46 v3 mtp-probe: checking bus 7, device 4: "/sys/devices/pci0000:00/0000:00:1d.1/usb7/7-1"
Sep 18 13:10:46 v3 mtp-probe: bus: 7, device: 4 was not an MTP device

After reboot my PC this changes ever +1 usb 7-1: i.e. usb 5-1 / usb 6-1 etc...

I'm using LinuxCNC 2.7.7 on Wheezy.
I want to use only the DRO output no Key Functions or anything.
I changed the Arduino sketch without Keypad. Baudrate i d'ont changed.

Is this Installation from serialcon correct? (i'm not a Linux spec :unsure: )

[strike]fh@v3:~/linuxcnc/configs/CNCV3$ sudo comp install serialcon2.comp[/strike]
[strike]sudo: comp: command not found[/strike]
fh@v3:~/linuxcnc/configs/CNCV3$ sudo halcompile --install serialcon2.comp
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o serialcon2 /tmp/tmpLNBXUM/serialcon2.c -Wl,-rpath,/lib -L/lib -llinuxcnchal

Or must there a lot more?
I put this in my costum_postgui.hal

loadusr -W serialcon
....
net Xposition halui.axis.0.pos-relative serialcon.xposition
net Yposition halui.axis.1.pos-relative serialcon.yposition
net Zposition halui.axis.2.pos-relative serialcon.zposition

No more Files where attached...

Greetings Fritz
Last edit: 10 years 1 month ago by Tchefter.

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

More
10 years 1 month ago #80555 by andypugh
I seem to recall that USB devices also show up somewhere else on /dev by serial number.
That might be less mutable.
The following user(s) said Thank You: Tchefter

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

More
10 years 1 month ago - 10 years 1 month ago #80560 by Tchefter
well, i installed the last Arduino IDE to see what port is used,
it shows /dev/ttyACM0
So i changed this in serialcon to this
#define DEVICE "/dev/ttyACM0"
Should this be ok?
while nothing happens after:

fh@v3:~/linuxcnc/configs/CNCV3$ sudo halcompile --install serialcon2.comp
[sudo] password for fh:
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o serialcon2 /tmp/tmp40WBeb/serialcon2.c -Wl,-rpath,/lib -L/lib -llinuxcnchal

Greetings Fritz

EDIT: i test the Port with the simple Blink-Example, that works...
Last edit: 10 years 1 month ago by Tchefter.

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

More
10 years 1 month ago #80564 by ArcEye

So i changed this in serialcon to this
#define DEVICE "/dev/ttyACM0"
Should this be ok?


If that is the device port you are using, then it is correct.
/dev/ttyUSB0 is more normal, but depends on the board.

while nothing happens after:
fh@v3:~/linuxcnc/configs/CNCV3$ sudo halcompile --install serialcon2.comp
[sudo] password for fh:
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o serialcon2 /tmp/tmp40WBeb/serialcon2.c -Wl,-rpath,/lib -L/lib -llinuxcnchal


Don't understand what you are trying to say.

The print just shows you have compiled the component and installed it to /usr/bin probably.

However please be aware you have compiled a component called serialcon2, but your hal file is loading a component called
serialcon

loadusr -W serialcon


The name of the file and the component must be the same as each other
github.com/LinuxCNC/linuxcnc/blob/master...ls/halcompile.g#L958
because otherwise halcompile would fail.

So you probably are trying to load a component which does not exist, albeit you haven't actually said what the problem is.
The following user(s) said Thank You: Tchefter

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

Time to create page: 0.177 seconds
Powered by Kunena Forum