Hello Guest it is April 28, 2024, 03:53:36 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 - mcardoso

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
221
Sorry guys!!!

Caught that I had uploaded an older version of the code with a few typos. Same concept, but use this instead:

Screen Load Script:

Code: [Select]
--------------------------------------
-- PDB Timer Code --
--------------------------------------

TimerPanel = wx.wxPanel (wx.NULL, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize )
--This line creates a Window which has properties exposed to Win10. This window will not appear on screen, but the Windows event will be tied to it.

Timer = wx.wxTimer(TimerPanel)
--This line creates the actual timer 'PDBTimer' which will be referenced throughout the code
TimerPanel:Connect(wx.wxEVT_TIMER,
function(event)
local PDBRetract, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT2) -- Is mapped to ESS PDB Retract

mc.mcSignalSetState(PDBRetract, 0)
mc.mcCntlSetLastError(inst, "PDB Retracted")
Timer:Stop()

end)

Signal Script:

Code: [Select]
    ---------------------------------------------------------------
    -- Power Drawbar Pushbutton
    ---------------------------------------------------------------
    if (sig == mc.ISIG_INPUT3) and (state == 1) then
    local PDBExtend, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
    mc.mcSignalSetState(PDBExtend, 1)
    mc.mcCntlSetLastError(inst, "PDB Retracted")
    end
   
    if (sig == mc.ISIG_INPUT3) and (state == 0) then
    local PDBExtend, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
    local PDBRetract, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT2)
    mc.mcSignalSetState(PDBExtend, 0)
    mc.mcSignalSetState(PDBRetract, 1)
    Timer:Start(500)
    mc.mcCntlSetLastError(inst, "PDB Timer Started")
    end

222
Hi All,

I purchased my copy of Mach 4 today!  ;D

I am finishing up the rebuild on the machine and have run into a few issues. They all seem to be unrelated but I figured I would save some space and ask for help for all of them in the same place...

System Setup:
Motion Controller: Ethernet Smoothstepper
Computer: Allen Bradley VersaView 5400 PC, 4 core Intel Atom E3845 chipset @ 1.90GHz, 4.0Gb of memory and runs Win 10.
Computer #2: HP Omen laptop, Intel i7 6700HQ 3.5GHz, 32Gb memory, running Win 10
Mach 4 version: 4.2.0.3804
Warp 9 Tech ESS plugin version: 232 (1.0.1.232)

1) When exiting the "Configure" -> "Control" menu, two general purpose outputs energize for a brief moment (regardless of machine state). These are tied to my power drawbar solenoid and emits a loud exhaust noise (although the cylinder doesn't move since both sides end up pressurized). I have these outputs tied to a screen load script and a signal script, but neither should do anything unless an external pushbutton is pressed.

2) When approaching my limit switches, some of the time when the switch is triggered I get a message in Mach 4 that says something to the effect of "ESS: Motor 0++ Limit triggered" and all axes become disabled. This is fast and very repeatable in position even when jogging at a good clip. Other times I get a message (from Mach I think) that says something like "X++ limit Active". It reacts very slowly and does not disable the axes or stop jogging (it does allow me to crash the machine). If I let go of the jogging key and press it again, it won't let me start jogging saying something like "Can't jog towards X++ limit", but again it doesn't stop the machine motion.

This issue also manifests itself when using "Ref all Home". When things seem to be working right, my axes home until the switch triggers, then reverse until the encoder marker is found. This gives home values repeatable to the .0001 mark on the DRO. However when mach is only showing the "X home switch active" message, the axis drive past the switch and contact the end of machine travel. The switch is energized and visible in the mach diagnostic window, but does not register to stop the homing.

It seems to me that Mach only registers the limit/home signals as a courtesy and relies on the ESS to stop motion or home an axis. It seems like sometimes my ESS is not registering the limit or home event even though the input signal is being received and transmitted to mach. Bu that is just an uneducated theory based on my observations.

3) When I enter M03, M05, and S#### commands into the MDI, my Step/Dir servo spindle often emits loud clunks when starting or changing speeds. This occasionally generates a bus overvoltage fault on my servo drive indicating the motor was requested to make some kind of instantaneous deceleration.

This behavior is NOT seen when clicking the spindle CW button on the Spindle section of Mach. I have not yet tried running the same code segments from a gcode file.

4) When exiting the Configure -> Control menu, keyboard jogging is disabled even though the button remains illuminated. I have to toggle the button to reenable keyboard jogging.

Looking for any thoughts. All these issues might be user error, but I would like to find a resolution.

Thanks!

223
Mach4 General Discussion / Re: Problem saving Screen Scripts
« on: March 08, 2019, 11:53:54 AM »
I think this may have happened to me too. Had me scratching my head.  I do all my scripting outside of Mach and copy/paste it in, so I was never too upset. Not sure why it happens?

224
Happy to! I've found most of the code posted here is people asking for help with non-working code. I'll try to post anything I get working even if it is silly.

225
Mach4 General Discussion / Mach 4 Profile Settings Reset/Lost
« on: March 08, 2019, 09:14:36 AM »
Thought I would share an experience that I had.

I run Mach 4 on an industrial PC which powers down when the electrical cabinet is shut off. Last time I turned it on, I got some weird messages when opening Mach 4. Turns out that my custom profile I have been using got completely reset to defaults (ESS plugin disabled, all I/O deleted, screen set changed, etc.). I think that my practice of powering the PC off without performing a full Windows shutdown may have corrupted my Mach 4 profile (even though Mach 4 was closed and I had given it a minute or so to save its settings).

I have daily backups, so this is no big deal, but I thought I would post as a word of caution to others. I will now be shutting down Windows before powering off the PC and continuing to save backups before any script/screen/settings edit.

226
Mach4 General Discussion / Re: pay for help
« on: March 07, 2019, 10:08:07 AM »
It seems like to me that the most difficult part of this deal would be programming the decision making part of the channel letters into mach 4. Going from "I want the letter F in this font and size" over to Gcode is likely where all their custom programming is. Mach 4 can easily handle the motion control and I/O (probably even the encoder error checking), but writing scripts to interpret a simple customer facing graphic interface where the letter, font, size, and quantity can be input would be a tremendous task.

If there is already other software doing this, then it seems like Mach 4 would be a perfectly capable candidate. If not, Mach 4 likely still has more than enough capability, but it will not be an overnight conversion and would require someone with intimate knowledge of LUA to program it.

227
Finally broke the ice and made my first LUA script (I have several others that don't work right now). Thought I would share. If you see anything that could be made cleaner, please let me know.

Description of Operation: Power drawbar is a 2 position air cylinder connected to a 5 port, 4 way, 3 position, center exhausting valve. The operator interface is a momentary N.O. pushbutton. While the pushbutton is pressed and held, the drawbar is extended and the tool released. When the button is released, the cylinder retracts and once the cylinder is retracted all outputs turn off to depressurize the cylinder.

In the Mach 4 screen load LUA script, I added the following code:

Code: [Select]
--------------------------------------
-- PDB Timer Code --
--------------------------------------

PDBTimerPanel = wx.wxPanel (wx.Null, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize )
--This line creates a Window which has properties exposed to Win10. This window will not appear on screen, but the Windows event will be tied to it.

PDBTimer = wx.wxTimer(PDBTimerPanel)
--This line creates the actual timer 'PDBTimer' which will be referenced throughout the code
PDBTimerPanel:Connect(wx.wxEVT_TIMER,
function(event)
local PDBRetract, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT2) -- Is mapped to ESS PDB Retract

mc.mcSignalSetState(PDBRetract, 0)
mc.mcCntlSetLastError(inst, "PDB Retracted")
PDBTimer:Stop()

end)

In the Signals LUA script, I added the following code:

Code: [Select]
---------------------------------------------------------------
-- Power Drawbar Pushbutton
---------------------------------------------------------------
if (sig == mc.ISIG_INPUT3) and (state == 1) then
local PDBExtend, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
mc.mcSignalSetState(PDBExtend, 1)
mc.mcCntlSetLastError(inst, "PDB Retracted")
end

if (sig == mc.ISIG_INPUT3) and (state == 0) then
local PDBExtend, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
local PDBRetract, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT2)
mc.mcSignalSetState(PDBExtend, 0)
mc.mcSignalSetState(PDBRetract, 1)
PDBTimer:Start(500)
mc.mcCntlSetLastError(inst, "PDB Timer Started")
end

The basis for this code was DazTheGaz's Youtube video on wxTimer (Thank you!):

https://www.youtube.com/watch?v=nkCx2xdoPEw&feature=youtu.be


Future modifications will be to automatically retract the cylinder when Mach 4 loads, to save the position of the cylinder to a register, and to interlock spindle operation so the spindle cannot start while the drawbar is extended.

228
Using mach 3, I used an arduino Mega (Uno would be fine too) running a modbus slave program. Made it very easy to bring in a ton of I/O (including analog) and get it into Mach at around a 50ms update rate. Getting the modbus to talk was the hardest part, and that still wasn't bad.

229
Mach4 General Discussion / Re: hybrid servo motor, Pockeys57cnc and mach4
« on: February 15, 2019, 10:51:37 AM »
Timing belt reduction is not necessary if your motor has enough torque to move the machine. That goes beyond the scope of a wiring and configuration discussion. Velocity will be limited just as if it were a normal stepper motor.

I would say set the max to 500rpm to start (5000mm/min) and see how it runs. You might be able to go much faster but understand your torque requirements go up the faster you move and your motor's available torque drops. You want to set the speed low enough that your drive will never stall and fault.

Acceleration is another one you will need to determine with testing. With the closed loop drive, it should be able to get some high accelerations, but the motor may lag behind the command if going too fast causing positioning issues. High accelerations are probably more important than high speeds on a CNC, but just start with a reasonable value and test as you go higher.

230
Mach4 General Discussion / Re: hybrid servo motor, Pockeys57cnc and mach4
« on: February 15, 2019, 10:45:32 AM »
Lets try these settings...

Assuming you want your units in metric (mm) and your motor is directly mounted to your ballscrew.

On the driver (setting 1600 steps/rev):
SW3: ON
SW4: OFF
SW5: ON
SW6: ON

Mechanically you have 1600 steps per 1 rev which moves 10mm. Therefore you have 160 steps/mm. This should be your setting in Mach 4.

One concern I have is that I saw in the PoKeys manual that the outputs are rated for 5mA max, but the drive will draw between 7-20mA. Hope that doesn't cause issues.


Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »