Arduino based USB Pendant for Linuxcnc

More
12 Feb 2017 14:00 #87869 by anda
Hello, I am new to Linuxcnc, and i need some help. I tried to make the arduino pendant but I have a problem. You can see in picture 1(Linuxcnc is not started)

and in picture 2( that's what appear on the lcd when I start linuxcnc). I think it's a connection problem. Any advice? Thank you

Arduino pendant when I start linuxcnc
Attachments:

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

More
12 Feb 2017 16:34 #87875 by ArcEye
Without a lot more information I can only guess.

At the most basic level, make sure that the #define DEVICE= definition in serialcon2.comp is correct for your board, it needs to be whatever port you used to upload the arduino script arduinopendant.ino

Failing that, you need to attach all your config files (ini and hal), run with DEBUG=7 in your ini file and attach the debug output from stderr and linuxcnc.log

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

More
13 Feb 2017 16:51 #87916 by ArcEye

Hello Mr ArcEye. I tried a fresh install for arduino pendant, and I got: " Pin 'halui.axis.0-pos-relative' does not exist" .

In custom_postgui.hal I have to put only
"loadusr -W serialcon2
net Xposition halui.axis.0.pos-relative serialcon2.xposition
net Yposition halui.axis.1.pos-relative serialcon2.yposition
net Zposition halui.axis.2.pos-relative serialcon2.zposition" ? Thank you


Please don't send me personal emails, I am not going to answer them

halui.axis.0-pos-relative is a valid pin, but without your config files I am not going to guess whether you have even enabled HALUI
www.linuxcnc.org/docs/devel/html/gui/halui.html

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

More
15 Feb 2017 17:11 #88005 by anda
Hello. I'm sorry for the personal email. Here are the config files

File Attachment:

File Name: anda.hal
File Size:4 KB

File Attachment:

File Name: anda.ini
File Size:2 KB

File Attachment:

File Name: custom_postgui.hal
File Size:0 KB

File Attachment:

File Name: custom.hal
File Size:0 KB

File Attachment:

File Name: custompanel.xml
File Size:0 KB

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

More
16 Feb 2017 14:30 #88051 by ArcEye
For starters, you are trying to load the component twice

Once right at the start of adna.hal, before any rt components have been loaded
loadusr -W serialcon2
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
loadrt pwmgen output_type=1

and then again in custom_postgui.hal

It should only be loaded once in custom_postgui.hal, after everything else is loaded.

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

More
19 Feb 2017 12:28 #88256 by andypugh
It looks to me like the brightness might just be turned up way too high.

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

More
15 Apr 2017 13:21 #91414 by travis036
New to CNC (researching to build my first CNC router), but i am not entirely new to Arduino. i spotted this thread, and it instantly got my brain thinking about what i could build for a pendant. My first thought was to use an Xbee i have to make a wireless pendant.
Very neat project!

~Travis

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

More
21 Apr 2017 22:05 #91813 by travis036
ArcEye, have you considered using a Nextion display for more advanced pendant display features?
I have a 4.3" Nextion display i was thinking of incorporating into a wireless (Xbee) pendant.

I haven't started building my CNC router yet, but my brain is still churning at the idea. :woohoo:

~Travis

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

More
15 Feb 2018 09:05 #105972 by JDona
Thank you ArcEye for the serialcon code.

I do have a question though; would the same structure work on a TCP/IP socket in HAL? Basically, include socket and open a port, wait for connection and process. Or while running loadusr, the component tries to establish a TCP/IP connection to a hard-coded IP, and if not found then exit otherwise stay in the loop to send the HAL signals to that address?

Maybe what i am trying to check if HAL support TCP/IP binding in C (not Python). If so, any source example of such component available?

Thank you.
Jim.

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

More
26 Dec 2018 22:03 #122929 by jmr
Hi,
I hope no one will be upset about an old topic coming up.
There was a question about HID implementation. I have recently found (and tested!) on Arduino UNO the modified bootloader, called HoodLoader2. There are some examples included. Once it is (finally) installed and working, it allows easy reprogramming of BOTH MCUs, with usb cable just as easy as normal programming.
It can be easily turned into HID keyboard, with functional LEDs (I believe up to 8 - with 5 of them other than caps/num/scroll lock) - like they should function in keyboard - they can be set up from PC side, or one keyboard can set the led on the other. There is no display, but that should not be a problem since there can be parallel usb usart configured and may be used for display only operation.
That should be good for some kind of button+led panel, but remember it has its own set of pros and cons:
- it is a keyboard. May be easy to bind interface to keyboard based app or mimic the relevant axis hot keys, or not easy as those are not hal pins but keypresses. It will stop working when you switch to console terminal (out of X), while the serial version will work all the time.
- E-STOP is not real - it will fail - as in above warning, but then again it is still usb based and should be considered unreliable.
- the leds can be set with linux program "setleds" from console or a script. I need to do some more testing on that as it seems to fail currently on my XFCE and works well in console.

This is just some info, as it requires some experienced programming to handle. If anyone is interested I can provide my working capslock example.

I shall try the latest ArcEye code found in the thread when I find it, or maybe there are some updates? I think I will work on that,at least the python side as I might try C without all the arduino layers if it is too slow. Arduinos test program with graphical wg12864 seems to get around 14 fps drawing some stuff and some text, there should be some time for keys processing.

questions of the day:
Is the unreliable key response the main problem when using faster refresh rate?
Does NICENESS (man nice) affect the userspace thread response time?
The following user(s) said Thank You: andypugh

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

Time to create page: 0.162 seconds
Powered by Kunena Forum