Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Buggalugs on May 23, 2012, 06:05:21 AM

Title: Newbie Help Please to Stupid Question Number 2
Post by: Buggalugs on May 23, 2012, 06:05:21 AM
Well, so far so good, No broken bits or broken fingers/arms/legs.   :o  I am now trying to set up my Spindle Motor which is a 200W Brushed Mains Motor. The Label reads ‘TM Multi-Use Heavy Duty Power Tool’ 200W Model No.99319   500 – 20,000 R/M and to all intents and purposes it looks and behaves much the same as a Sewing Machine Motor.

Poking about in the Engine Configuration | Ports and Pins Settings | Spindle Setup under the motor Control Options, I have checked the ‘Use Spindle Motor Output and set the PWM Base Freq. at 10Hz and the  Minimum PWM percentage at 20%

Using the Spindle CW F5 Button on the Mach3 Dashboard I can start and Stop the Motor running at about 600R/M but I cannot control the Motor Speed i.e. increase or decrease the speed with the up/down buttons. The Green slider goes up and down, but the motor speed remains the same - What am I doing wrong???

Once again, Not a jot of information in my useless Chinglish User Manual. Not even a mention that it has a Spindle Motor.   >:(
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Hood on May 23, 2012, 06:20:29 AM
I dont have any experience of setting a spindle with PWM etc as I use servos on my machnes, however have you got the correct pin set in Ports and Pins, Motor Setup for the spindle?

Hood
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Hood on May 23, 2012, 06:22:38 AM
Just looked at tyour previous xml and you have spindle setup set as Step/Dir, have you tried that as PWM instead?
Hood
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Buggalugs on May 23, 2012, 06:49:48 AM
The Motor appears to be responding to the PWM Mack3 is delivering. the Dialogue Panel on Mach3 says it is running at 300RPM yet it is running about 1,200 RPM. I cannot make the Motor Run faster or slower. I can Stop and Start it. It respond to 'M3' in the G Code. Does that make any sense to you?
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Hood on May 23, 2012, 07:41:54 AM
Not really, as I said I have never used PWM so not sure how its meant to be set up, hopefully someone else will have and chime in.
Hood
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Buggalugs on May 23, 2012, 07:45:31 AM
Thanks again buddie... That's another drink I owe you!
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Hood on May 23, 2012, 08:56:44 AM
Do you definitely have the setting for PWM chosen, see pic.

Hood
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Buggalugs on May 23, 2012, 09:10:19 AM
Yep.. That is set as is in your drawing. As I have said I can control the motor, Power On and Off but there is just no control over the spindle speed. One peculiar thing which happens when I change the Minimum PWM percentage say to 90% the motor runs flat out at 23,000 RPM (I have a tacho) and my Mouse Locks up, My display freezes and I have to manually disconnect the Spindle Motor to recover.....

The last puzzle which may give an indication as to what is going on is on my Mach3 Panel below the Spindle CW F5 Button where the Spindle RPM is, I cannot increase the speed beyond 300 RPM   :-\ 
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Hood on May 23, 2012, 11:02:53 AM
Computer freezing sounds like the motor is pumping out plenty noise and will likely give you issues.
The lowest DRO is the requested spindle speed so you would need to enter a RPM in that or command a speed from MDI line or code. The Middle DRO is spindle override and will only go to a maxof 300% above whatever spindle speed you have in the DRO below. The top DRO is the True spindle speed DRO and would only have a number in it if you had an index pulse feedbak to Mach.
Hood
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: stirling on May 23, 2012, 11:44:38 AM
I'm no expert on this but AFAIK you need to set up ports n pins/spindle setup - which I think you've done. You also need to set up the spindle pin in ports n pins/motor outputs AND you need to configure your pulley(s) in config/spindle pulleys.

Thing is Mach has no idea how the mark/space ratio relates to an actual speed of a motor unless you tell it via pulleys.

So I think you'd create a single pulley def. with whatever min speed and 23000 max and select that pulley.

Ian
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Buggalugs on May 24, 2012, 06:50:15 AM
Well, here is today's idiot update.  ???
Following what Mr Stirling had posted yesterday, I created a pulley, called it Pulley 1 set my Minimum and Maximum Motor speeds as 500 and 23,00 RPM respectively. I could then vary the Motor speeds from the MDI interface, i.e. M3 followed by S500 would run the Motor at about 1,200 RPM where as S3000 would peak the motor at maximum RPM

Wonderful I thought, so then I found the Spindle Calibration Routine which I thought would put my Motor RPM somewhere nearer the on screen speed. I ran the routine which started the Motor running about 800RPM and gradually as the on screen RPM increased, and so did the Motor - All going great I thought.

When it finished the routine, it reported something to the effect that the Spindle Motor was now calibrated and all was fine... GREAT...  8)

How wrong I was, the spindle speed on the Mach3 Main panel reads -1 (Minus 1) and the motor revs its little @$$ off whenever I switch it on without any control over the speed, then the RFI from the Motor Spitting and F@rting kills my Mouse.....  >:D

To top it all, I have just had my once per day two line four word e-mail form the little yellow people. Yesterday I asked them for the Mach3 Settings for the Spindle Motor, as there is no mention in their Chinglish Manual about it. Their reply was, "Dear friend, ‘Our specification:3040Z and 6040, Thank you so much!, Have a Nice day" Whatever that is supposed to mean…… :-\
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: stirling on May 24, 2012, 10:54:08 AM
I just checked the PWM output by Mach and it's relationship to what is entered in config pulleys and all is as it should be - spot on. I'd start to wonder about the quality/linearity of your kit in how good it is at converting the PWM into the control voltage needed by your spindle controller. Also - do you actually have an index pulse from your spindle? I haven't seen you mention one if you have. Without an index pulse I can't see how Mach can calibrate the spindle.

Maybe this is worth a read http://www.cjh.com.au/PWM%20Spindle%20Control%20using%20Mach3.pdf (http://www.cjh.com.au/PWM%20Spindle%20Control%20using%20Mach3.pdf)

Ian
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: JohnHaine on May 25, 2012, 04:42:43 PM
And I think you need to smooth the PWM output with an RC filter...
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Buggalugs on May 26, 2012, 06:27:13 AM
Well another day (or two and I am very pleased to report that my Machine is now up and fully operational  ::) I would really like to thank all you Guys who have given me the time to reply with hints, tips and encouragement to resolve some of the mountainous problems I have had to resolve with a piece of kit in many years.

To report back on what I found to be the cure for my runaway delinquent Spindle Motor.
Firstly the RFI problem had to be addressed. That with the associated ‘Shock’ when for no apparent reason the Spindle Motor would instantly start up and rev its testicles off was rectified. Remembering back to my early days when as a TV Engineer to test the Line Output Stage, we would disconnect the Line Output Transformer and replace it with a 60W incandescent light bulb.
This would put sufficient load onto the drive circuit to simulate a load and allow you to determine if the line was oscillating at 15,625Hz  This did the trick as not only could I see any changes and variations in the Motor Speed Controller, it no longer killed my rodent  >:D which was making progress impossible.
To shorten this I went back over my settings and lo and behold this beast does not respond to Pulse Width Modulation (PWM) but prefers to work quite happily with Step/Dir signalling.


I can now control my Spindle Motor Speed infinitely from 800RPM to 20,000RPM with the maximum deviation of about 400RPM from the onscreen settings (DRO?? if that is the right terminology) to the actual Motor Speed when I test with my Tachometer.  8)

 The Rodent Problem has gone also, probably with the absence of the PWM in the Spindle Motor Supply…..   
   
I have attached a screenshot of my Spindle Setup for anyone finding themselves in the same dilemma.

Once again THANK YOU ALL for your help, hints, tips and encouragement, and finally sorry for making this such a lengthy post.

p.s. Watch out for the next Newbie Stupid Posting (or beware!)  >:D   
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: Hood on May 26, 2012, 08:53:55 AM
Good to see you got there in the end, hopefully things will run a bit more smoothly from now on :)

Hood
Title: Re: Newbie Help Please to Stupid Question Number 2
Post by: stirling on May 26, 2012, 11:31:18 AM
nice one - good you got it sorted and thanks for coming back and posting the solution.

Ian