Author Topic: Mach4 Printer Port Discussions  (Read 853496 times)

0 Members and 1 Guest are viewing this topic.

Offline dude1

  • Active Member
  • Posts: 1,251
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #150 on: July 23, 2014, 08:09:05 PM »
art I did what you suggested to do it did not work, in the mean time a wire broke and when I was fixing it I checked the connections on the super pid it was not connected to pwm it was contended to the pot line, set it up to run that way and it worked.
Also Darwin does fix the M4 problem with metric what cool.
I just need to get my M codes correct as I cant change speeds, just on and off might changes to the pwm line to see if that makes a differences.
so everything with Darwin works very well on my machine just a couple of M4 problems.

Offline ART

  • Administrator
  • *
  • Posts: 1,691
  • Tough as soggy paper.
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #151 on: July 23, 2014, 08:38:08 PM »
Dan:
 
   You just need an S word for speed changes... M3S500 for example...

Art


Offline dude1

  • Active Member
  • Posts: 1,251
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #152 on: July 23, 2014, 08:43:48 PM »
its not working its just turning spindle on or of no matter what I put in.
I was playing with the M3 macro brook it some how so only can toggle on/off.
could I ask if I can see the M3 macro you are using please.
this is what i am useing.
Code: [Select]
function m3()
    local inst = mc.mcGetInstance();
    local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON);
    local sigState = mc.mcSignalGetState(sigh);

    if (sigState == 0) then
        mc.mcSpindleSetDirection(inst, 1);
        --dir =,  -1=ccw, 1=cw, 0=off   
    end

    local dummy = 1;
end
 
if (mc.mcInEditor() == 1) then
   m3();
end

Offline Ya-Nvr-No

  • Active Member
  • Posts: 971
    • View Profile
    • Ya-Nvr-No
Re: Mach4 Printer Port Discussions
« Reply #153 on: July 23, 2014, 08:52:16 PM »
this might work better for you

    --Get the hReg handle for Spindle direction
    hReg = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEFWD); --get the handle
    mc.mcSignalSetState(hReg, true); --set the state of the signals handle


    --Get the hReg handle for Spindle on
    hReg = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON);
    mc.mcSignalSetState(hReg, true);

« Last Edit: July 23, 2014, 08:55:51 PM by Ya-Nvr-No »

Offline ART

  • Administrator
  • *
  • Posts: 1,691
  • Tough as soggy paper.
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #154 on: July 23, 2014, 09:06:39 PM »
I use the unmodified one you get with the installation of Mach4. But you DO need to set a frequency in the spindle signal in Darwins setup. If you dont set a frequency as the PWM base frequency, it will act only as an on/off control...

Art

Offline dude1

  • Active Member
  • Posts: 1,251
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #155 on: July 23, 2014, 10:07:30 PM »
thanks art/Ya-Nvr_No, will give that a crank see what happens.
Also I have not changed wiring yet.
I have SpindleFreqLo set to 0 and SpindleFreqHi set to 5000.
I will set it at 50 in darwin

Offline Ya-Nvr-No

  • Active Member
  • Posts: 971
    • View Profile
    • Ya-Nvr-No
Re: Mach4 Printer Port Discussions
« Reply #156 on: July 23, 2014, 10:15:38 PM »
I set one pin #6 in my case to 10hz also set mux on and set mux low
then wired pin 6 and a ground wire to the spindle drive
m3s100 turned on spindle and set speed and the pulse width was spewing out pin6, nice clean signal
change speed and signal changes to suit.

Offline ART

  • Administrator
  • *
  • Posts: 1,691
  • Tough as soggy paper.
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #157 on: July 24, 2014, 07:20:36 AM »
Hi Guys:

  Just to correct some things I haven't explained well.

SpindleFreqHi and Lo are only used when the PWM selection is zero. In other words those values are for
frequency spindles only, not PWM. When you use PWM the FREQ box in Darwin sets the base frequency
of the PWM and your S word creates a ratio between your SpindleLowSpeed in Mach4's settings and its mate
SpindleHiSpeed to derive the PWM output frequency.
 
   The MUX setting should always be off. MUX'ing is a way to double IO , if you have an input pin..lets call it
Input#1 on Pin 11 say.. and you select MUX, you can then create an Input#2 also on Pin 11. You set one to
MUX-LO and the other to MUX-HI. This means when the charge pump is low, Input#1 is read from pin 11,
when the charge pump is high, Input#2 is read.  This means the breakout baord must be special and must switch
two signals back and forth to pin11 when the charge pump level dictates. ( in this case).

   Muxing was used in Mach3 by some THC kits to get more inputs and outputs in a printer port. I put in the
capability just in case it was needed. Generally, leave the MUX turned off. For PWM one needs only to set a base
frequency in the Darwin FREQ box. TO use a frequency based spindle it doesnt matter if Darwin has any entry
in that box, the frequency put out will be ratioed to the min and max frequency set in the registers..

 Ill explain all this in docs for Darwin and in a final setup video when we all agree Darwin is working OK. :)

  Again, my thanks for all the testing, Im pretty pleased so far with the results. 

Thx
Art

Offline alcwell

  • Active Member
  • Posts: 37
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #158 on: July 24, 2014, 05:46:39 PM »
Not sure if this should be posted here or in the bug thread.

I downloaded Mach4 build 1914 and found that I was unable to run a GCode file with Darwin.

No problems jogging even with the speed cranked way up. Trying to run a file resulted in missed steps and horrible sounds from the motors. It is the same affect I get if I don't use a stretched pulse width. Is it possible that the pulse width setting is being ignored when running a GCode file? Went back to build 1900 and GCode files run without any problems.

Alastair

Offline dude1

  • Active Member
  • Posts: 1,251
    • View Profile
Re: Mach4 Printer Port Discussions
« Reply #159 on: July 24, 2014, 05:55:27 PM »
art I found what the problem was it was the macros, I remove the M3 macro from the macro folder and the screen.
I can now type in a M3S5000 command in the mdi it will turn on at 5000 rpm but cant get it to go faster it try`s to go faster then goes back to 5000 rpm.
there is a problem in M4 that is making this to happen.
I am going to do a complete reinstall of m4 and Darwin to see if it clears up the problem.
other than that there are no other problems