Arduino based USB Pendant for Linuxcnc

More
10 years 9 months ago #68979 by ymilord
Hrmm. But me manually sending values @ 115200 works. So that means the the arduino side (the sketch and the libraries) is working correctly?

I changed both ends to 9600 and same deal.

Please Log in to join the conversation.

More
10 years 9 months ago #68982 by ArcEye
What does tail -f /var/log/messages show when you plug in the pendant?

What does the pendant LCD display when you plug it in?

Please Log in to join the conversation.

More
10 years 9 months ago #68984 by ymilord
Jan 23 17:25:19 beaglebone kernel: [ 4244.066373] usb 1-1: new full-speed USB device number 3 using musb-hdrc
Jan 23 17:25:19 beaglebone kernel: [ 4244.186197] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523
Jan 23 17:25:19 beaglebone kernel: [ 4244.186207] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
Jan 23 17:25:19 beaglebone kernel: [ 4244.186217] usb 1-1: Product: USB2.0-Serial
Jan 23 17:25:19 beaglebone kernel: [ 4244.187133] ch341 1-1:1.0: ch341-uart converter detected
Jan 23 17:25:19 beaglebone kernel: [ 4244.188609] usb 1-1: ch341-uart converter now attached to ttyUSB0

Just 'X:*'

Please Log in to join the conversation.

More
10 years 9 months ago #68985 by ArcEye

Just 'X:*'


It should display
Code:
X: * 0000.000 Y: 0000.000 Z: 0000.000

If that is all you get, there is something wrong the arduino end

Please Log in to join the conversation.

More
10 years 9 months ago #68986 by ArcEye
No sorry, that is after the first cycle

Should be
Code:
X: * Y: Z:

Please Log in to join the conversation.

More
10 years 9 months ago #68987 by ymilord
The sketch is unaltered. I've installed the IDE (separate install from my main copy) on my local machine then this morning I created a VM with only the libraries in the ZIP.

Well All three axis. But when it connects it places a "*" after the ":".

What is the prefix that HAL is sending to the AVR? via screen /dev/ttyUSB0 I can do "Y-0.1234" it populates the X: axis field with value specified.

Please Log in to join the conversation.

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

Please Log in to join the conversation.

More
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

Please Log in to join the conversation.

More
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

Please Log in 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.

Please Log in to join the conversation.

Time to create page: 0.151 seconds
Powered by Kunena Forum