Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Nabil Imam on August 27, 2017, 11:53:40 AM

Title: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: Nabil Imam on August 27, 2017, 11:53:40 AM
 Hey everyone,

I'm new to the forum and new to Mach software. I have one question that has been racking my brains for a week and I can't seem to find the answer.

A little background first, if you want to know my question, skip to the next paragraph. 1 year ago I designed and built a CNC router from scratch. XYZ spindle, nothing special, but a hell of a lot of fun. I used a cheap planetcnc controller and got tired of it quick.  About a month ago I started reading on what I should upgrade to and it was between UCCNC and Mach. Through the reading I concluded I should get hardware to do both and play with the demos before I buy. SOOO I bought a UC100 and a HDBB2 from cncdrive. They now control a Hitachi WJ200 and 4 microstep driver cw230 that I originally bought. As soon as i got them I installed UCCNC it ran as fast as molasses (i knew then this was going to be battle). So I installed Mach3 and began reading forums and watching youtube videos and after a week I was able to get all axis moving, and control the spindle speed and direction, (WOOHOO THIS FORUM), I was about to buy mach3 and though; why buy a software that won't be growing with the times. Mach3 is great from what I've read, but if I can, why not mach4?

So i installed Mach4. I've been able to translate everything I learned from Mach3 to Mach4 as far as the setup. I have XYZ moving, and I have the spindle turning on and off and spinning fwd and rev. Problem: it is either at the low speed, or high speed and changing the RPM in the spindle box does nothing (only the directional buttons work) Question: Can mach4 and the UC100 be setup to control the speed of the spindle? AKA, can MACH4 output a 0-10V signal?

I have tried just about every combo of pins and setups and tabs (except for the correct one) and I just can't get it. if this is possible, can someone point me to the correct thread, or give me some insight?

If you need more information of the setup, let me know and I'll do my best to get what you're asking.

Thanks for the help guys!

-Nabil
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: ger21 on August 27, 2017, 01:21:37 PM
The UC100 can output a PWM signal, and the HDBB can convert it to a 0-5V signal. You setup the PWM in the UC100 plugin.
If you need 0-10V, you'll need a breakout board or speed control to convert PWM to 0-10V.
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: joeaverage on August 27, 2017, 02:49:54 PM
Hi,
another question to be asked is 'do you need speed control?' Most of my jobs I turn the spindle on set the speed manually, not always but
often, as fast as it goes and leave it like that all day. Easy to get hooked into the notion 'I need speed control' and spend a lot of time and
money which doesn't get used much.

Craig
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: Nabil Imam on August 27, 2017, 05:14:30 PM
Hi,
another question to be asked is 'do you need speed control?'

Craig

I understand the question, and mostly the answer is no i dont need it control the speed. But the way the VFD its not easy to setup it up that way. When it is powered down it forgets the speed it was at. I don't know if there is a way to hold that memory, but with my current knowledge it doesn't seem possible. I don't want to "trick" the thing either, in the case I do need to change the speed I don't have to trick it more.

It would be convenient to setup the speed when I'm setting up the gcode and just let it run from there.  

The UC100 can output a PWM signal, and the HDBB can convert it to a 0-5V signal. You setup the PWM in the UC100 plugin.
If you need 0-10V, you'll need a breakout board or speed control to convert PWM to 0-10V.


I can't even get it to output 0-5V. I'd be happy with that for now. Do you know where I can get the info to set that up? an example or anything?

Thanks!

edit: grammar
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: joeaverage on August 27, 2017, 08:38:14 PM
Hi,
manual speed control can be as simple as a pot. Doesn't come much simpler than one knob and one
glance tells you where its set.

Craig
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: joeaverage on August 28, 2017, 04:03:19 AM
Hi,
irrespective of whether it is easy or desirable to have a manual speed control it should be possible to get your combination going simply
and cheaply. It is well worthwhile doing so just to learn about your system.

Unfortunately I don't have a UC100, I use an ESS, but hopefully some of the same ideas will work.

On page 3 of the HDBB manual it states that Output #3 is hooked to screw terminals 36 and 37. Pin 36 is low pass filtered and is highly suitable as PWM output.
On page 4 of the same manual it says that Output #3 is pin #1 in the 36 pin centronics connector and in Appendix A pin #1 in the centronics is the same pin#1
in the DB25 or IEC26 pin connector. If pin #1 of the LPT is toggled on and off then screw terminal 36 will be the lowpass filtered result.

You now need to setup Mach4 to produce spindle PWM on pin #1 port #1.
On Configure/Mach/Output Signals scan down the list until you find Output #3. Check the enable mark, select UC100 from the drop down list in the Device column
and select Port1 Pin1 from the drop down list in the Output Name column.
On Configure/Plugins/UC100/Spindle Settings chose Pin1 from the drop down list for the Spindle PWM setting. Suggest the frequency be set to 1kHz until youre
comfortable enuf to experiment with it.

If (that's a BIG IF) I'm correct now you can control your spindle speed by toggling Output #3 on and off in Mach4. I'm going to have to take a spell while I figure
out how to get Output #3 to be PWM from the S*********x in Gcode.

Craig
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: Nabil Imam on August 28, 2017, 10:43:18 PM
Hi,
irrespective of whether it is easy or desirable to have a manual speed control it should be possible to get your combination going simply
and cheaply. It is well worthwhile doing so just to learn about your system.

Unfortunately I don't have a UC100, I use an ESS, but hopefully some of the same ideas will work.

On page 3 of the HDBB manual it states that Output #3 is hooked to screw terminals 36 and 37. Pin 36 is low pass filtered and is highly suitable as PWM output.
On page 4 of the same manual it says that Output #3 is pin #1 in the 36 pin centronics connector and in Appendix A pin #1 in the centronics is the same pin#1
in the DB25 or IEC26 pin connector. If pin #1 of the LPT is toggled on and off then screw terminal 36 will be the lowpass filtered result.

You now need to setup Mach4 to produce spindle PWM on pin #1 port #1.
On Configure/Mach/Output Signals scan down the list until you find Output #3. Check the enable mark, select UC100 from the drop down list in the Device column
and select Port1 Pin1 from the drop down list in the Output Name column.
On Configure/Plugins/UC100/Spindle Settings chose Pin1 from the drop down list for the Spindle PWM setting. Suggest the frequency be set to 1kHz until youre
comfortable enuf to experiment with it.

If (that's a BIG IF) I'm correct now you can control your spindle speed by toggling Output #3 on and off in Mach4. I'm going to have to take a spell while I figure
out how to get Output #3 to be PWM from the S*********x in Gcode.

Craig


Craig! That explanation helped a ton! There was one small difference. I have the HDBB2 instead of the HDBB. SO I traced your logic and applied it to what I had.

Here is the setup i ended up with.

Output #3 is connected to terminal 30 on the HDBB2.

From there Out3 is connected to pin 30 on the centronics which is pin 14 on the DB25

in Configure/uc100/spindle setting: I set it to pin 14 and through some trial and error 3 khz seem to make it happy

in Configure/Mach4/output signals: I set output #3 to UC100 and Port1pin14

Now when I toggle #3 the spindle speed is set.

BUT: here is the kicker. damn thing didn't change.. or does it..
On the main screen: I thought the bottom right corner spindle box was the spindle control. link of example http://www.themakersguide.com/wp-content/uploads/2013/07/mach4.2_Main_screen.png. mine doesn't say "current speed" it is just an input box. for ********* and giggles I bumped the SRO to 150 and it changed speed. It wasn't until I went to the diagnostics pages and played with those values that I was able to get the spindle to go from 60hz to 400 hz on the VFD

So there we have it. With a little guidance and a happy accident i have spindle speed.

Thanks a bunch man!

-Nabil
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: Nabil Imam on August 28, 2017, 10:50:55 PM
One more bit of information:

I know you can edit the screens and customize stuff. So i turned edit screen and made the spindle box bigger and hidden randomly off to the side was the "input" box for the speed. I moved it to be with the rest of the items and adjusted the screen back down to the correct size and saved the edit.

NOW i can control the speed of the spindle from the front screen!

now its time to buy mach4!
Title: Re: Mach 4 UC100 HDBB2 Spindle Speed setup (last piece to the puzzle)
Post by: joeaverage on August 29, 2017, 02:36:01 AM
Hi,
kool, glad you got it worked out. Because I don't have a UC100 I believe part of the plugin is unavailable to me to edit.

The smoothstepper plugin was like that, if you don't have it plugged in and communicating the plugin didn't show up. A more recent release
has changed that, not that it makes much sense to edit the firmware when the device isn't plugged in but its good to see it so you can plan/scheme/
understand.

Craig