Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: BarryB on December 31, 2009, 10:37:30 PM

Title: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on December 31, 2009, 10:37:30 PM
Hello, I've got a mill I'm building using a smooth stepper, C23 BOB, Hitachi X200 VFD.  I've gotten the spindle to turn on and off just fine, but when I set the VFD to get speed from the control terminals, instead of the potentiometer on the front of the VFD, it only spins about 10% of full.  I can have Mach control the on/off, and then use the potentiometer by hand each time, just thought, there would be a way for Mach3 to control on off, and the speed.  Am I off my rocker?  I haven't found a setting that will work for this.

Do others use Mach 3 just to control on/off, and they do the speed by hand too?

Barry
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ger21 on December 31, 2009, 11:25:47 PM
You need to use the analog output of the C23 to provide 0-10V to the VFD. See page 4 of the manual, "Configuring the Analog Output: "
http://cnc4pc.com/Tech_Docs/C23-Dual_Port_Multifunction_CNC_Board_Rev2.pdf
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 01, 2010, 01:00:17 PM
Thanks, I missed that section, thought it was just a brochure/marketing doc;)

Is there an advantage to controlling the speed through Mach3?  Do you commonly change the speed of something mid job?  How does your CAM software know when to insert a speed change?

It might be my newb-ness, but isn't having it external preferred, so you can adjust on the fly if need be.  For instance differing densities in wood, etc.

Barry
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: Overloaded on January 01, 2010, 01:08:45 PM
Hi Barry,
 The CAM will automatically change the speed but by what is entered for that tool in CAM itself when it spits out the gcode.
Other than that, the SRO and FRO on the RUN screen are for changing speeds on the fly.
Russ

Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: Sam on January 01, 2010, 02:43:20 PM
Quote
Do you commonly change the speed of something mid job?
pretty much 90% of the time.
Quote
How does your CAM software know when to insert a speed change?
Some CAM software calculates the chip load and all that stuff for you, so it will output the correct (recommended) feeds and speeds, based on the tool selection, like Russ stated.  Some will even make changes for arcs and other stuff. The parameters can really get advanced with high speed machining. The way my CAM tells what feed and speeds to use are....by me telling it what to use. Just from experience. This usually gets it in the ball field, or at least inside the stadium. Then I can use the overrides to dial it in. If I have several parts to cut, I go back and edit the feed in the code to what it needs to be.
Quote
isn't having it external preferred, so you can adjust on the fly if need be
Preferred may be a bad way of looking at it. More suitable would be...ability to control externally.
Quote
Is there an advantage to controlling the speed through Mach3?
Absolutely. Say for instance you run a large quantity of parts, that require changes in speed for different tools. You wouldn't want to have to change the speeds and feeds manually for every tool change, for every part.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 01, 2010, 02:48:37 PM
Thanks, I'll change the input back to sink and get the speed controlled via Mach.  I just got homing to work, I'm so excited;)

Barry
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 01, 2010, 08:16:58 PM
Hmm, now that I've changed back to 'sink' and I thought these things are hooked up right it is crashing Mach3 right after you toggle the spindle on.

I've got a couple questions though, as maybe I'm setting Mach3 up incorrectly for this.  It looks like there is a setting that is missing according to the pdf from CNC4PC.  According to:

http://cnc4pc.com/Tech_Docs/C23R2toVFD.pdf

You are still supposed to use pin 1 and 16 for fwd/stop and rev/stop.
Then there is pin 14 for (0-10v), which I assume is step and subsequently, for velocity.

This leaves out another pin for direction.  It wouldn't be 1 or 16, since this would limit the machine to only spin in one direction, would it?  The PDF shows using both, so I assume it's a 4th pin that we don't see on this pdf somewhere.  Guidance would be apppreciated, if anybody has an idea.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 02:02:23 PM
.....
You are still supposed to use pin 1 and 16 for fwd/stop and rev/stop.
Then there is pin 14 for (0-10v), which I assume is step and subsequently, for velocity.

....

You've got those right but set also the Dir Pin# to 0 for the spindle in Motor Outputs. I'm wiring the relays 1 & 16 as in the pic below to get them control both ON/OFF and CW/CCW. This works for Chinese Huanyang VFDs so you need to modify it according to your VFD

I'm using CNC4PCs C11 card and so far haven't got the 0-10V output give more than 9.3V and that happens about 15% under the max 24000 rpm. If I give a higher S value than the 20500 rpm then the voltage drops again. So I have to say that I'm not too pleased with the card at the moment. If you encounter similar problems and can solve them please let me know.

/Risto



Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 02:34:09 PM
setting the direction pin to 0, throws an error in Mach 3, saying the only valid numbers are 1,2,3, etc.  As soon as I click the spindle on, it starts to spin, then crashes Mach3.  I'm not a happy camper at the moment.  The Smooth Stepper I'm using is set to Step/Dir for spindle control, and 40 for pulse width.  In Mach, spindle tab is set to enable output 1 and 2, which is set to pin 1 and pin 16.  For spindle output control, it's set to step/dir.  In spindle motor outputs I've got it set to 14, and any number, tried 0, 17, etc, and each time, it starts, then crashes mach3.  Lovely.

Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 02:43:13 PM
setting the direction pin to 0, throws an error in Mach 3, saying the only valid numbers are 1,2,3, etc.  As soon as I click the spindle on, it starts to spin, then crashes Mach3.  I'm not a happy camper at the moment.  The Smooth Stepper I'm using is set to Step/Dir for spindle control, and 40 for pulse width.  In Mach, spindle tab is set to enable output 1 and 2, which is set to pin 1 and pin 16.  For spindle output control, it's set to step/dir.  In spindle motor outputs I've got it set to 14, and any number, tried 0, 17, etc, and each time, it starts, then crashes mach3.  Lovely.

I certainly do have the Spindle Dir Pin# as 0 and this is how it is written in the Mach manual (Using Mach3Mill) for spindle control from where i got it. Can't help with the Smoothstepper, sorry.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 03:01:33 PM
Hmmm, I'm looking at the manual right now, and I don't see where it says to set it to pin zero.  I believe you got it from there, just don't see where.  I think I'll just wire this as a simple trigger to turn on/off my spindle, and control the speed externally by hand.  I can't get it to work the way it's showing in the documentation.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 03:27:31 PM
It's there in the chapter "Pulse width modulated spindle control", page 5-16 in manual beta rev 7-57. Works for STEP/DIR control mode as well. I'm using latest Mach version. Beside, you can set most output pins to 0.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 03:33:36 PM
Ah, it's my understanding that we are doing Step and Direction spindle control, no?, not PWM.  I didn't even look at the PWM section for this.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 03:59:25 PM
Yes we are, but in C11 card the step pin# in Motor Outputs/Spindle delivers a step pulse of which FRQ is turned into an analog voltage, like a charge pump. The FRQ and the ON TIME of that pulse determines the voltage seen at the analog output. So the step pin in the Motor Outputs/spindle determines the analog voltage and you set the Dir pin on the right to it to 0 (=nothing). The motor ON and OFF & CW and CCW can then be operated with the relays.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 04:03:56 PM
Yes we are, but in C11 card the step pin# in Motor Outputs/Spindle delivers a step pulse of which FRQ is turned into an analog voltage, like a charge pump. The FRQ and the ON TIME of that pulse determines the voltage seen at the analog output. So the step pin in the Motor Outputs/spindle determines the analog voltage and you set the Dir pin on the right to it to 0 (=nothing). The motor ON and OFF & CW and CCW can then be operated with the relays.

PS. So same arrangement is/can be used in Spindle setup for PWM and STEP/DIR.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 04:31:29 PM
Alright, I'm setting it to that, dir pin 0 and I'm getting the same result.  The spindle spins, but it then crashes mach3.  I decided to go back and just go to the single on/off trigger, and disregard speed.  Now, this is also crashing Mach3.  I had that working before.  Argh, something is really wrong here.

Barry
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 04:44:03 PM
A friendly warning, you should measure and check all outputs to see that everything is working perfectly before connecting to and running the actual machine.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 04:48:27 PM
Oh, I've checked and rechecked everything else, all motors, and switches, e-stops function correctly.  It's only the spindle at this point.  I'll disconnect all that portion and start over after lunch.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: ftec on January 02, 2010, 08:12:35 PM
And be sure to understand how your VFD is operated, mine has 24V outputs which must be grounded and Reset must be activated in between when changing spindle direction.

Another option for the CW/CCW + ON /OFF would be to use the Motor Outputs/Spindle Dir pin# to drive the first relay to change direction and then M3 and M4 both set to use the other relay for Spinde enable by setting a same output # for both. In this concept whether you choose M3 or M4 the enable goes on. When you program M5 the relay goes off.  The problem in this is IMO that you can change direction on the fly while the spindle still is enabled, but this may not be a problem to someone else.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 09:27:49 PM
Argh, I'm not any closer, I can get it the spindle to turn on, but Mach immediately crashes.  For the life of me, I can't seem to figure this out.  I did notice one thing.  If I have my VFD turned off.  Mach3 doesn't crash.  I can select to turn on and off the spindle, and you can hear the relays turning off and on, this won't carsh.  However, when the VFD is turned on, and I do the same thing, this crashes Mach3.

From your last comment, I can see how it would be a problem to change directions.  This will also set off an alarm on my VFD.  I haven't seen the VFD error out this whole time though, so I don't think that's the issue I have.

This is so frustrating.  You have no idea how cool it is to have this giant machine begging to be used, and be held back by this!

Barry
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: BarryB on January 02, 2010, 10:47:55 PM
I've about had it.  I can't seem to turn on/off the spindle using Mach3 and the c23 board without crashing Mach3 at all.  Right now, I have my spindle wired for turning on/off, and using it's own potentiometer as a speed control.  I can take those leads, one is forward, the other is 24volt, and connect them together, and the spindle turns on as you'd expect.  I connect those to output #1, which is defined as port 1, pin 1, and the 24 volt lead to the shared voltage in.  Then when you click the spindle clockwise button, Mach3 tells the spindle to turn on, but then it crashes.  The output relays are enabled, the outputs are enabled.  The smooth stepper is set to spindle type 'relay/none' (although I've tried all settings).  I'm about to just rig up an external switch that turns off and on the spindle manually, not ideal, but damn, how many hours is it supposed to take to get these things working?
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: TOTALLYRC on January 03, 2010, 12:19:50 AM
Hi Barry,
Sounds like a noise issue more than a settings issue. Having the wrong settings shouldn't crash Mach3, It should just not work.
The real telltale is that when the VFD is not on it doesn't crash. You may have a grounding issue with the smooth stepper or some other component. Try a different computer temporarily to see if it helps or a p-port if you have one to eliminate the smooth stepper as a potential trouble spot just to see if it makes a difference.

I also realize that the learning curve is not a straight line, that is why it is called a curve.

When I was first setting up my DSPMC powered mill, it took several days to get the VFD to do what I wanted. There are so many variables involved such as Mach3 settings and VFD settings that it would be difficult to get it right on the first try.

Keep on going as you will figure it out in the end.

It may be in your best interests to in fact hook it up outside of Mach3 control and come back to it in a few days. A pizza and a few beers later, I always feel better and it puts me in the right frame of mind to give it another go. Remember that beer and machines don't mix so wait till the next day to get started.

Mike
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: Dorsal on January 03, 2010, 02:27:58 AM
Barry - I recently had a somewhat similar problem with a 3-axis router that uses a SmoothStepper and a Dremel for the router head (my PhlatPrinter (http://www.phlatboyz.com/phlatboyz-machines/)). Due to the low amp-load of the motor, I wired a micro-switch directly to the AC on the Dremel and have been using Z-axis moves to start / stop the motor.  It's been working fine for nearly a year, but suddenly Mach kept crashing, every time the switch would open to stop the motor.   
Fortunately, I had recently installed a sight-window in my controller box, so I could see the lights on the SmoothStepper when all was running.  What I noticed was that BEFORE Mach would finally signal that it had crashed (it was freezing up for a minute first) - anyway, before Mach would signal, the RED light on the SmoothStepper had gone out.  The RED light is the "data-transfer" light on the SmoothStepper.
Apparently, as the Dremel and the micro-switch have aged, they have become electrically noisy enough to interrupt the data-flow to the SmoothStepper, upon disconnect, every time.

So what might that mean to you?  Your problem might be electrical noise that is triggered by starting the motor.  Maybe you need some shielded cables, an opto-isolated relay, a better grounding circuit.
Title: Re: Mach Controls On/Off of spindle, not speed?
Post by: keithmech on January 03, 2010, 03:03:54 PM
Did you try a different lpt cable to the c23 board?I have found cables
mostly the newer ones that do not use all the pins.Easy enough to test or just grab
a different ones and try.