Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: fatmanming on April 19, 2019, 10:06:41 AM

Title: Step pulse duty cycle
Post by: fatmanming on April 19, 2019, 10:06:41 AM
I'm running Mach 4 with an ESS smoothstepper. I'm having issues running a closed loop Nema23 at anything like a speed I expected. I've been advised by the supplier to change the duty cycle to 1:1. Can anyone advise how to check / change this in Mach 4 ?
Title: Re: Step pulse duty cycle
Post by: ger21 on April 19, 2019, 10:09:28 AM
My guess is that would be a setting in the drive?
Title: Re: Step pulse duty cycle
Post by: fatmanming on April 19, 2019, 10:49:14 AM
The supplier said change duty cycle of mach 4 to 1:1, And keep it below 125k. Not sure if mach 4 dictates the duty or the ESS. I need to check it with a scope later.
Title: Re: Step pulse duty cycle
Post by: ger21 on April 19, 2019, 10:51:15 AM
Oh, he's talking about the pulse width.......
Title: Re: Step pulse duty cycle
Post by: fatmanming on April 19, 2019, 10:54:46 AM
The duty cycle is the portion of the pulse that is high and lo. A 1:1 should be 50% high and 50% lo. The pulse width is the hi and lo combined. Thats my understanding anyway 😊
Title: Re: Step pulse duty cycle
Post by: joeaverage on April 19, 2019, 04:02:37 PM
Hi,
the duty cycle of the ESS step outputs is fixed by the ESS and is not able to be programmatically controlled.
I have observed the step outputs of my ESS/BoB combo on occasion with an oscilloscope and they are already nearly
bang-on 50% duty cycle as is.

The ESS can produce pulse streams up to 4MHz, so 125kHz is scarcely a crawl for the ESS.

The limitation here is the ability of the driven device, in your case the stepper driver. The manufacturer specifies a max
of 125Hz, but you would be advised to stay well below that.

What microstepping regime have you in place?. Its not uncommon for inexperienced CNCers to specify a way to high
microstepping regime on the misunderstanding that it is better and gives better resolution. It does not.
With a two phase stepper (ie normal) resolution beyond half step microstepping is fallacious. The real advantage
of microstepping is smooth motion thereby avoiding mid-band resonance.

I would recommend a microstepping regime of about 8 micrsteps per full step or 1600 pulse per rev.
If you wanted your stepper to spin at 1200 rpm (ambitious for a stepper) then the pulse rate will be:
pulse rate=1200 / 60 X 1600
   =32kHz

That is comfortably within the spec of your drive.

If however you choose an unrealistic microstepping regime of 64 microsteps per full step or 12800 steps/rev
the calculation becomes:
pulse rate = 1200 / 60 x 12800
   =256kHz

Which is well outside of the spec.

What voltage power supply have you provided the drivers? The general rule is that it should be as high as the drivers
will stand because the steppers will run fastest.

Craig
Title: Re: Step pulse duty cycle
Post by: fatmanming on April 19, 2019, 05:51:50 PM
Thanks for the response.

Warp 9 tell me the pulse width is 10us below 50k then it's 50% duty cycle up to the 4m max.

I'm running on 36v, i've tried 45 but it didn't make a massive difference.
I have the driver set to 800 steps/rev, and was trying to run at a feed rate that worked out at 360rpm. The motor was stalling but not alarming, without load just running on a bench.
I workd it out at a 4.8k pulse, way below the 125k they said was max.

I'm trying to get a feedrate of 3000mm/min, but to do that i had to set to 400 pulses per rev, way below the accuracy i wanted on a 5mm pitch screw.

I think a refund may be whats called for and try a different supplier.





Title: Re: Step pulse duty cycle
Post by: ger21 on April 19, 2019, 06:42:33 PM
Motors laying on a bench will tend to stall easily, due to resonance. Set your microstep to 1/8 (1600 steps/rev), and it should stall less. If possible, bolt the steppers to a board while testing, and that should also help.
Title: Re: Step pulse duty cycle
Post by: joeaverage on April 19, 2019, 06:50:02 PM
Hi,
well it certainly sounds like you have experimented enough and have the calculations well in hand.

As I stated in my previous post that it is unrealistic to expect better that 400 step/rev resolution from an open loop
two phase stepper. You can set a microstepping regime with apparently far better resolution but that theoretical
resolution is not actually obtained. There is a sound explanation for that....but I would not, unless you require it,
regurgitate the reason for it.

A closed loop stepper is still a stepper with all the limitations of a stepper, reducing/vanishing torque at high speed.
A closed loop control system does not prevent that. For this reason I do not recommend that the premium paid
for closed loop steppers as opposed to well engineered open loop steppers and drivers.

One area where closed loop steppers do offer an advantage is resolution.
An open loop stepper can reliably be at either a full step position or a half step position. A half step position occurs when
both phases are energized and the resulting magnetic field 'drags' the rotor to a position midway between the two
full step magnetic poles on either side.

A closed loop stepper enjoys a distinct advantage in this regard. Should your required motor position required  to be
14% CW of the last full step position (therefore 86% away from the next full step position). As a guess you would reduce the
phase current in the 'leaving' phase  to 86% of max and increase the current in the 'arriving' phase to 14% of max.
It is almost inevitable that the rotor will not achieve its 14% position as required. However it actual position is measured by
the encoder and therefore signaled to the driver. Thus the driver will adjust the current balance between its two phases
such that the rotor indeed achieves its desired position. It may require a current distribution of 84% and 16% respectively.

This constitutes the sole major benefit of a closed loop stepper. The question obtains 'does the increase in resolution
justify the expense'

Lets compare open loop resolution vs closed loop.

Open loop at half step, resolution = 400 step/rev, with a 5mm leadscrew resolution = 0.0125mm or 12.5um
Closed loop (Leadshine encoder 6000ppr encoder) =6000 step/rev, with a 5mm leadscrew =0.833um

Clearly close loop has an advantage....but the minorest amount of backlash or flexure and that resolution is wasted.
Unless you have the need, and are prepared to build a sufficiently rigid machine with backlash free components, I would
recommend open loop steppers and drivers.

If you go that way you absolutely MUST buy steppers with low inductance, its as important as holding torque. With
23 size steppers you should aim to get steppers of 1mH or less inductance. Pair those with a good highvoltage
stepper driver like Gecko or AM882 drivers from Leadshine and you in business.

You should, excepting very heavy loadings, achieve 1000 rpm or with a 5mm leadscrew 5000mm/min.

Craig
Title: Re: Step pulse duty cycle
Post by: fatmanming on April 20, 2019, 05:15:18 AM
Craig,

Thanks very much for that comprehensive answer.
I've seen videos of closed loop working far faster than what I am achieving, and set to a 1000 steps, I don't think any on the ESS though. I'm only looking for about 3000mm/min, at the moment I'm getting to about 1800. The drivers default, and lowest division is 400, so I've set it to that and got to 4000mm/min, I was hoping to keep to the 10um accuracy, so it's not that far off.
My current open loop drives are set to a 1000 and I'm getting a stall free 1800 out of those.
The closed loop is certainly smoother sounding and feeling and much cooler.

I think the problem is the signal to the driver, I think the driver is just not getting the faster signal from the ESS. I'm going to experiment a bit and generate my own signal to see if it performs as the vendor describes with a 1:1 square wave, then look at my options.

Many thanks

Carl.



Title: Re: Step pulse duty cycle
Post by: joeaverage on April 20, 2019, 05:33:42 AM
Hi,
you say you are using an ESS but what BoB are you using?. I'm beginning to wonder if the buffer/output circuit of
your BoB is not fast enough. Do you have a scope or access to one? I think to resolve whether the ESS or the BoB
or the driver is responsible is going to require a scope to diagnose.

The second issue is the inductance of the steppers. Certainly at no or low loads you would expect a stepper to spin quickly
but at higher loads the same stepper will stall or lose steps. Without a close comparison of the rotational load it
not really possible to compare one installation to another.

Do you have a torque and inductance spec for your steppers? What brand/make/model are they?

Craig
Title: Re: Step pulse duty cycle
Post by: fatmanming on April 20, 2019, 10:38:09 AM
Thanks Craig,
I think that may be my issue !!
I couldn't get a BOB in the UK when I first built my machine so I made my own Opto pcb for the inputs for 36v Inductance switches, the outputs are direct to the ESS. I'll have to see what I can buy now or I need to look at output buffer design to make my own  :( :( :(.

regards

Carl
Title: Re: Step pulse duty cycle
Post by: joeaverage on April 20, 2019, 04:16:21 PM
Hi,
I think you are right. Opto-isolators can be as slow as a wet week depending on the model and how you set them up.

I have attached a pic of two very common optocouplers. Note that the phototransistor in one has no external base connection.
Thus the sole way it can turn on is light from the photodiode, thus the photodiode needs to brightly illuminate the phototranistor,
commonly 10mA or more. Typically the time response is slow, 10-20us with these devices and you would struggle to
pass a 100kHz signal through it.

The other optocoupler pictured has an external connection to the base. That is typically biased to about 0.6V such that the
phototransistor is on the threshold of conduction. Thus the light from the photodiode need be very much less intense
to cause the phototransistor to conduct, less than 1mA photodiode current. Response time is likewise much
improved, of the order of 1us.

The extra biasing circuitry, especially being so heat sensitive, means that the biased photocouplers are used only as needed
in comparison to the simpler non-biased optocoupler.

The question is why are you so hung up on optoisolators? Firstly its common for the input of stepper driver to have optocouplers
built in already. There is no need to isolate at the ESS/BoB end and THEN AGAIN at the driver end.

I use:

https://www.homanndesigns.com/index.php?main_page=product_info&cPath=54_22&products_id=59&zenid=n2f38qp4ho6mv9eb9rm7hhp7a0 (https://www.homanndesigns.com/index.php?main_page=product_info&cPath=54_22&products_id=59&zenid=n2f38qp4ho6mv9eb9rm7hhp7a0)

from Homann Designs in Australia, I live in New Zealnd so they are kind of local to me. These are very simple and plain
bi-directional BoBs WITHOUT optoisolators. I've been using them for over five years and have not blown anything
up yet, and I can blow stuff up real easy!

If fact I did a poll a while back:

https://www.machsupport.com/forum/index.php?topic=39723.0 (https://www.machsupport.com/forum/index.php?topic=39723.0)

Only five people replied, a bit disappointing, but none of those five people (100%) have blown up a PC because they did
not use opto-isolators. I'm not saying you can't blow up a PC but it doesn't happen much either.

The advantage of the Homann BoBs is that without the opto's they are as fast as the TTL buffers used, ie tens of MHz.

The C10 is cheap enough, $23USD and bi-directional. Note it has no bloody opto's . Neither does it have any relays
for the spindle nor a PWM to analog circuit for a VFD, you would have to make and add those as required.

https://cnc4pc.com/c10-bi-directional-parallel-port-interface-card.html (https://cnc4pc.com/c10-bi-directional-parallel-port-interface-card.html)

Craig

Title: Re: Step pulse duty cycle
Post by: fatmanming on April 20, 2019, 04:34:33 PM
Thanks, ive ordered a C10,  dont know how long shipping will take. I'll update when its arrived and tried out. Im only using the opto's on the inputs for the 36v switches.
Carl.
Title: Re: Step pulse duty cycle
Post by: joeaverage on April 20, 2019, 04:42:49 PM
Hi,

Quote
Im only using the opto's on the inputs for the 36v switches.

OK, that makes sense. I suppose then that you do not have any buffering between the ESS and your drivers?

According to the specs the ESS should source or sin 24mA, surely that would be enough to drive the input optocouplers
of your stepper drivers. Do you have a circuit diagram of the input circuits of the drivers? I'm wondering if they are 24V
tolerant, in which case they are likely to have a series current limit resistor but may then reduce the current to borderline
or below when driven with the 5V outputs of the ESS.

Craig

Title: Re: Step pulse duty cycle
Post by: fatmanming on April 20, 2019, 05:09:04 PM

All I have is the below from e-bay, not the most helpful support, may be the language barrier.
 
1, Stepper Driver Specifications :


Model
HBS57
Type
32Bit DSP Closed loop stepper drive
maximum peak current
5A/Pha
Impulse response frequency
Max. 200KHz
Micro-stepping driver
2-256  subdivision, Max 51200ppr
Voltage
DC24V-60V
Protective function
Over voltage, over current, tracking error, overproof
Signal input
Support PUL/DIR and CW/CCW modes (difference)
Compatible 5~24V signal (Don’t need a resistor)
Advantage
no step to lose, Low noise, little vibration and high efficiency, low heat
Continuous overload
Output an alarm signal
Type of cooling
Natural cooling
Alarm, position signal
Yes
Impulse type
Single impulse (Default), double impulse (need modify by soft)
Size
118*75*34(mm)
2, Stepper Motor Specifications :


Step angle/phase
1.8 degree
Rated voltage/current
4.52V/4A
resistance
1.13ohm
Inductance
3.6mH
Hold torque
3NM
Encoder
1000line
Class of insulation
B
Rotor inertia
800 g.cm2

Carl
Title: Re: Step pulse duty cycle
Post by: joeaverage on April 20, 2019, 06:00:52 PM
Hi,
that's made by Leadshine. Manual attached.

Craig
Title: Re: Step pulse duty cycle
Post by: fatmanming on April 21, 2019, 04:34:06 AM
Thanks Craig,

My drive is not labelled as Leadshine, though it looks the same.

I'll sort the rs232 leads out to check the parameters with the Pro-Tuner software, if it works.

I'm going to sort my wiring as well as I've daisy chained the supplies to the drivers, in fact I'm going to just run this drive on it's own with the ESS without the rest of my hardware to try it.

The set up time for the step signals is 2.5us and the current requirement is 10ma, so the ESS should be ok if I read and understand that right.

Anyway i'm getting the barbie out for easter Sunday, unbelievable for Manchester in April !!

Thanks for your help.

Carl.


Title: Re: Step pulse duty cycle
Post by: joeaverage on April 21, 2019, 04:56:24 AM
Hi,

Quote
My drive is not labelled as Leadshine, though it looks the same.

Man.... a Leadshine copy???....the Chinese getting ripped off by whom....some other Chinese outfit??

So what brand is it?

Quote
The set up time for the step signals is 2.5us and the current requirement is 10ma, so the ESS should be ok if I read and understand that right.

I think that the current limit resisitor is such that with the low input voltage (5V) that the current is insufficient to reliably
and quickly signal the drive.

Craig

Title: Re: Step pulse duty cycle
Post by: fatmanming on May 04, 2019, 06:51:01 AM
I finally got the C10 BOB for Port 1 of the ESS. This has not made any difference to this issue.

The motor is strong up to the point when it just stops, no loss of torque, so it's definitely just not responding to the faster signal.

On the plus side 'Fast to Buy' gave me a 70% refund and let me keep the motor and driver becaus they could solve my issue, so i've used it on my X Axis anyway as it is a lot smoother and quieter and than the open loop drives.

I'll have to post and see if anyone has any recommendations for motors and drivers to use on the ESS.

Carl. ;)

Title: Re: Step pulse duty cycle
Post by: joeaverage on May 04, 2019, 04:15:19 PM
Hi,
I am of the opinion that closed loop stepper drivers offer too few advantages over open loop drives to justify the extra expense.

It is my opinion that the manufacturers of these things play on the insecurity of customers with phrases like 'never lose steps'.
If an open loop stepper loses steps because of overload (too high accel or too high velocity or too high inertia) then a closed loop
stepper will lose steps as well, and for exactly the same reason. A closed loop stepper is still a stepper, it has the same torque/speed
characteristics as an open loop stepper. Its true that the closed loop stepper will try to recover....but if its overloaded it will
fail. If it gets too far behind its commanded position it will fault 'following error', ie warning you that its lost steps. That is an
advantage over an open loop stepper.

The better path is to select a stepper, it matters not whether its open loop or closed loop, that can do the job required
WITHOUT losing steps, ie operate WITHIN its torque/speed area. This requires a certain minimum holding torque but more
importantly places an upper limit on the inductance of the stepper.

In experienced stepper buyers look at the holding torque only reasoning that the higher the torque the better the motor.
What they don't realize is that a high inductance motor will lose all its torque at speed whereas a low inductance stepper
retains more of its holding torque.

If a manufacturer or supplier cannot provide you with an inductance specification or torque/speed diagram.....walk away,
they are trying to hoodwink gullible buyers.

The second issue is the voltage of the supply/driver driving the stepper, the higher the voltage the faster the stepper will go
without undue loss of torque. Gecko drives are typically capable of 72V-80V and Leadshine AM882' are 80V capable.
Leadshine AM882's are pretty good value. Pair that with a low inductance (2mh or less) stepper and 80V power supply
and that stepper will sing!

The other alternative is genuine servos. Over recent times the price of genuine, good quality AC servos have come down in price.
Have a look at DMM:

http://www.dmm-tech.com/ (http://www.dmm-tech.com/)

They are a Canadian company but manufacture in China. Good quality at a very good price. There are cheaper 'no brand'
Chinese servos...don't go there!

Servos still command a premium over steppers (open or closed loop) but they are EXCEPTIONALLY CAPABLE.
Once you have used them you'll never go back to steppers.

Craig
Title: Re: Step pulse duty cycle
Post by: fatmanming on May 05, 2019, 02:40:41 AM
Craig,

Thanks again for the reply.
I'll have an experiment with power supplies I think and see how good I can get my current motors working.

I've also asked DMM for a quote to replace my X and Y axis motors, might be a bit to pricey for me though.

regards

Carl.
Title: Re: Step pulse duty cycle
Post by: fatmanming on July 27, 2019, 09:26:51 AM
Got servo's from DMM only to find the same issue with those ?
Finally found it was my laptop that was a bit to old for the job, used my new laptop and they work fine, even the closed loop one.

Can't believe how good the servo's are, quiet, cool and can go way faster than I could use :-)
Title: Re: Step pulse duty cycle
Post by: joeaverage on July 27, 2019, 07:45:19 PM
Hi,

Quote
Can't believe how good the servo's are, quiet, cool and can go way faster than I could use :-)

That sums up my experience also. It was not until I tried using a servo to realize just how much superior thay are.

Craig