Hello Guest it is April 24, 2024, 08:05:00 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mark4

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
11
Mach4 General Discussion / ok lua lost on screen button
« on: March 17, 2020, 10:28:09 PM »
Hello
I am just confused and have read so much that I am even more lost. LOL
Can somebody help
I want a screen button to read input 9 and if input 9 is off then turn on output 8
until input 9 is on. then turn off output 8. seemed simple

The object is a tool changer manual button to go to the spindle so you click the button and
if the tool holder is at park then the switch "input 9" is off so turn the motor on "output 8"
when the "input 9" turns on turn the motor "output 8" off.

This is what i have so far notice their are two different as not sure which signal get handle are the proper form.
And the signal get state if then loop just has to be all kinds of wrong

local inst = mc.mcGetInstance()
local ToolDrumAtSpindle = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT9)
local ToolDrumToSpindle = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT8)

   if mc.mcSignalGetState(ToolDrumAtSpindle ==1 )  then
      mc.mcSignalSetState(ToolDrumToSpindle,0)
   else
      mc.mcSignalSetState(ToolDrumToSpindle,1)
end

--local inst = mc.mcGetInstance()
--local ToolDrumAtSpindle = mc.ISIG_INPUT9
--local ToolDrumToSpindle = mc.OSIG_OUTPUT8

--   if mc.mcSignalGetState(ToolDrumAtSpindle,1)  then
--      mc.mcSignalSetState(ToolDrumToSpindle,0)
--   else
--      mc.mcSignalSetState(ToolDrumToSpindle,1)
--end

Never did a button before except to just turn on or off an input.
Thank you
Mark

12
Mach4 General Discussion / Re: Mach 4 Motor Configuration problem
« on: January 25, 2020, 11:09:02 PM »
Have you tried clicking on the motor 0 and 1 and 2 on the right side of the motor configuration tab.
They are grayed out until you click.

13
Mach4 General Discussion / Re: Lua confusion simple switch spindle range
« on: January 22, 2020, 10:14:59 PM »
Hello I just checked the machine.ini from mach4 and it has reverse in the spindle. However i also checked the csmioconfig.xml and it does not have reverse.  So even thought i sent allot of emails I need to finish this machine and what am i to do? It just came to me.
I have a switch that changes the range from 0 to 1 and it changes the motor speed accordingly i just cannot reverse the motor rotation. what if i add a double pole double throw relay and reverse the relays going to the vfd.
then program input 6 to turn this relay on when reverse is required. That will solve a problem that likely wont get solved quickly and i can finish my machine.
This is my last hurdle testing remains then the 4sale sign goes up.
thank you
Mark

14
Mach4 General Discussion / Re: Lua confusion simple switch spindle range
« on: January 22, 2020, 07:37:34 AM »
Hello
No, that is not quite correct. Mach4 has output signals SpindleOn, SpindleFwd, and SpindleRev.
Whenever your Gcode has a m3, m4 or m5 one or more of the signals will change.

But note, the are SIGNALS only, they don't do anything. If you want them to turn your spindle on and off they must, with
the motion control plugin, be connected to output pins of your motion controller. A signal becomes an input or output ONLY
when the signal is connected to a pin.

I am with you and the fwd signal and rev signal are working they go through the controller to a relay then to the vfd. so my issue is the reverse checkmark in control config/ spindle. no matter what i do with the checkmark the motor does not reverse. I thought since it is the signal that changes its change will be in mach. Are you saying it could be the plug in that handles the reverse checkmark?
In the plug in that is not mentioned at all. but i am thinking an email to poland might be in order.

Thank you for your help and that information on sig lib
Mark

15
Hello
Have you looked at the history bar across the bottom of the screen. It likely will tell you why it wont go home. Have you homed the machine first?

16
Mach4 General Discussion / Re: Lua confusion simple switch spindle range
« on: January 21, 2020, 11:04:51 PM »
Hi the plug in does not mention range so i think they are plugged into the range in mach4. The spindle changes speeds fine in range one and range two. I need to check but it seems correct. I was thinking of having two outputs turn on and using them for the screen led. like this.

[mc.ISIG_INPUT6] = function (state)
    if (state == 1) then
      mc.mcSpindleSetRange(inst,1)
    --set output here the question is do i have to get state first or can i just turn it on   
   else
      mc.mcSpindleSetRange(inst,0)
    -- I want it to stay on until the input changes state
   end
end,
the thing that has me most concerned is the spindle does not change direction. regardless of what reverse i have checked. since this function is just switching the fwd and rev relays to rev and fwd. it is really a mach4 function
and it does not work. I was hoping you or somebody knew about it. as i hate to be the first lol.
Thank you for your help

17
Mach4 General Discussion / Re: Lua confusion simple switch spindle range
« on: January 21, 2020, 05:03:11 PM »
Thank you I put that in and got the results I was looking for. Except for some reason
the spindle relays do not reverse when the checkbox is checked. this machine has a
bullgear and fwd and rev need to be swapped. I am using a cslabs csmio/ip-a but it seems more like a mach4
problem. any advise
I will also start a help ticket with artsoft

18
Mach4 General Discussion / Lua confusion simple switch spindle range
« on: January 21, 2020, 01:02:25 PM »
Hello
Lua continues to be a struggle. Every time I learn something. i need to change the spindle range from 0 to 1. The machine I am retrofitting has a high/ low gear switch. so i thought use screen load script and when the switch is activated then low gear and not activated high gear. I also wanted to have two leds on the screen to tell you which gear you are in. Thought I had it figured out. But it doesnt seem to work.
I started with this
[mc.ISIG_INPUT6] = function (state)
    if (state == 1) then
      mc.mcSpindleSetRange(inst,1)
   else
      mc.mcSpindleSetRange(inst,0)
   end
Thought it would work in one go.
Then I went to this

[mc.ISIG_INPUT6] = function (state)
    if (state == 1) then
      GearHiLow()
   
---------------------------------------------------------------
-- Gear Hi / Low
---------------------------------------------------------------
--function GearHiLow()
--   local hSig = mc.mcSignalGetHandle (inst, mc.ISIG_INPUT6)
--   local Gear = mc.mcSignalGetState (hSig)
--   if (Gear == 1) then
--      mc.mcSpindleSetRange (inst,0)
--      mc.mcCntlSetLastError (inst,"range 0")
--   else
--      mc.mcSpindleSetRange (inst,1)
--      mc.mcCntlSetLastError (inst,"range 1")
--   end

This is the final so far and there have been a few versions.
If anybody can point me in the right direction. Thank you

19
Mach4 General Discussion / Re: Homing stopped working
« on: January 18, 2020, 09:57:13 PM »
so the light on the sensor went on. that says the sensor is reading it. however the sensor might not be putting it out to the controller. You can go into mach4 diagnostic screen and activate the sensor manually and see if the led lights up. If you dont see it there you can go into ESS diagnostics and see if it shows there. you can do all input checking with the machine not enabled for safety.

20
Mach4 General Discussion / Re: Mach 4 vfd help needed
« on: January 18, 2020, 09:17:51 PM »
Hello I am far from an expert but i will help. first you need to provide forward and reverse signals to the vfd page 2 of the manual shows which relays. you want normally open and common these wires need to go to the corresponding terminals on the vfd its manual will tell you which two usually fwd reverse and common. i use a shielded wire with the shield grounded on one side because vfds are noisy. Now if you can command forward and reverse successfully. outputs

Now tackle the 0-10v speed control. That is just a matter of connecting the wires to the right place and making sure the vfd is set for 0-10v not 4 to 20 milli amp. both manuals should dial you into that.

Cnc4pc has some wire examples. for the vfd mach programming check out warp nine they are really good for setup help. saved my bacon a time or two.
 

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »