Hello Guest it is January 22, 2020, 08:42:38 PM

Author Topic: Adding external push buttons  (Read 8457 times)

0 Members and 1 Guest are viewing this topic.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Adding external push buttons
« Reply #20 on: January 25, 2016, 11:14:17 PM »
in M4 you still have to map the controls sort of you can get the pokeys to do some of it, it's not that easy to do ( it crashes a lot so i gave up), as M3 is, that was plug and set steps vell and acc and that all I did with the 57CNC , I have there new one I am not sure if it's been released yet.

hossmachine use's a pokeys with M4 he has for quite sometime, look him up on youtube he has a control panel

Offline dah79

*
  •  35 35
    • View Profile
Re: Adding external push buttons
« Reply #21 on: April 04, 2016, 03:18:24 PM »
Have gotten my Pokeys 57U and have been trying to configure using Mach4 in Demo mode as I don't have my controller yet.  Am having a lot of issues with Mach crashing when hitting 'OK' or 'APPLY'.  Has anyone successfully got the Pokeys 57U to work with Mach4?  I am trying to use it to connect external remote jogging operations.
Re: Adding external push buttons
« Reply #22 on: April 06, 2016, 02:44:30 PM »
dah79,

I have a Pokeys 56U, which is listed as a 57U when you upgrade the firmware.  The latest plugin for MACH4 is 7.29.0.2914.  The plugin in getting better but still has numerous issues.  If all you have are dedicated switches and an MPG you will be able to get this to work.  I have several segments works for example a matrix keyboard, I can get keys on the keyboard to perform functions like Feedhold and that works perfect.  I can also get the LCD display to update if I write to the global registers under the Pokey plugin.  I have been able to output to LEDs which are in a matrix configuration from Mach4, which works fine as well.  The challenge is if you are using Matrix keyboard you can't access these and assign these inside the pokeys plugin, but if you use dedicated input pins or output pins that stuff seems to work.  One issue is enabling and disabling the MPG, that is not available by default in the plugin, they do have something called a deadman switch option which is for the MPGs that have a button you hold in while using the MPG.  My MPG does not have that style switch so getting it to work correctly has been a challenge.  I have hard coded that switch in the plugin saying always ON, and been able to jog a given axis with the MPG.  You have to use code inside of MACH4 in the PLC script and Signal Scripts and Screen Load scripts to get this stuff to work.  Unfortunately, there is no detailed step by step instructions available or video where someone setup a pokeys pendant.  I am trying to get this done, since moving over to MACH4 from MACH3 will not happen if I can't get the pendant stuff to work.  I opened tickets with Polabs of many issues they responded and said they would investigate and then never responded again.  The learning curve in MACH4 is pretty steep, there are a hand full of experts that have their machines working and they have been coding LUA to make things work. DazTheGas has posted many videos and honestly you will learn a great deal about how MACH4 works by watching his videos.  He does not have a Pokeys device as I asked him questions since he is an amazing resource who has shared far more about MACH4 and how to do things than the writers.  The manuals for MACH4 are very thin, nothing in comparison to MACH3 which have very detailed manuals.  rumor has it that Newfangled solutions was having them written professionally but MACH4 has been out more than a year now and nothing.  As I get the basics figured out I will post some instructions.

Russ
 

Offline dah79

*
  •  35 35
    • View Profile
Re: Adding external push buttons
« Reply #23 on: April 06, 2016, 04:39:42 PM »
Thank you Russ!  I will be in touch for sure.  I have gotten several buttons/switches working through the Pokeys without doing anything but configuring them (once I figured out how).  Have had lots of issues with Mach crashing while configuring, not sure why. I have been trying to 'practice' with the Mach Demo software, don't know if that is why.
What I can't figure out yet is how to use a pot for the feed override.  Any ideas?
I have purchased a MachMotion retrofit kit, in fact I just finished unloading it.  Nice looking stuff! 
MM said I would need some custom programming to get pot to work.  I am just trying to wrap my head around all of this Mach stuff as I am more versed in the Linuxcnc systems.
Need to open up all this stuff and see what I got and then continue reading more.
Thanks again!
Dave

Offline smurph

*
  • *
  •  1,187 1,187
  • "That there... that's an RV."
    • View Profile
Re: Adding external push buttons
« Reply #24 on: April 06, 2016, 11:30:42 PM »
A pot would most likely have to be hooked to an analog input on some hardware.  Not sure if pokeys does this or not.  Most devices will export the analog input as a register.  Depending on the analog input's resolution.  One might expect a 0 to 1023 value in the register from a 10 bit analog input.  You would then need to apply a ratio to that to make the values fall within the range of say the feed rate override settings.  So the task then becomes:

1. read the analog register.
2. convert to a proper value.
3. call the API function to set the value.

This is done in the screen's PLC script with the Mach API and LUA scripting.

Steve

Offline dah79

*
  •  35 35
    • View Profile
Re: Adding external push buttons
« Reply #25 on: April 07, 2016, 06:36:59 AM »
Thank you Steve.  My Pokeys does have analog inputs.  I can see a range from 0-3.3volts using their diagnostics.  I will see if I can figure out how to do the rest.
Dave

Offline Chaoticone

*
  • *
  •  5,634 5,634
  • Precision Chaos
    • View Profile
Re: Adding external push buttons
« Reply #26 on: April 07, 2016, 11:31:46 AM »
The Analog inputs via modbus video at http://www.machsupport.com/videos/ may prove to be helpful. The video is for Mach3 and modbus but it will show you basically what you will need to do in your PLC script.

I hope to get a chance to make a video on this soon. I know it doesn't help now but it is planned. 
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Adding external push buttons
« Reply #27 on: April 07, 2016, 07:19:35 PM »
Dave,
Look under global registers in Mach4.  The pokey plugin has several global registers amount them the analog reading.  You can check this is real time so moving the pop and checking the analog register.  If they follow you can built a series of if cases to control feed rate or spindle.

Russ

Offline dah79

*
  •  35 35
    • View Profile
Re: Adding external push buttons
« Reply #28 on: April 08, 2016, 02:14:54 PM »
Hey Russ,
I was able to create a screen dro and tie the Pokeys register to it, so I can see a value change on the screen.  The first issue is there must be a scaling problem as the range is 0-1 and in Pokeys it is 0-3.3.
I have no idea now what to do with this, but at least I know that Mach can see it.
Re: Adding external push buttons
« Reply #29 on: April 08, 2016, 02:45:21 PM »
Dave,
Can you post the code you used?  With maybe a couple of screenshots.  The voltage in my view does not really matter, since POKEYS is converting this to number.  When you say the range is 0-1 does this mean 0, .1, .2, .3 ..... 1  Or just binary "0" or "1".  If you are actually getting a range of values then you have something workable.  I have not played with the analog inputs in my POKEYS, but I have played with most everything else.

Russ