PDA

View Full Version : clunks / missing steps - DM856 and single pulse operation



dsc
13-10-2013, 04:35 AM
Hi everyone,

hoping someone can suggest things to try as I'm a bit lost as to why this is happening.

I have a DM856 driver and a small Nema 23 motor, all connected to a SPS705 68VDC power supply (I was told the voltage on the PSU is a bit high for this motor, but it should run ok). This is driven via the PUL / DIR input from a custom built uC based board, which acts like a jog / test board, you press the '+ / -' buttons to turn the motor one step CW or one step CCW. If I press a button and hold it down, the pulses are generated in a cycle and the motor moves smoothly, but if I only press the button once, every now and then the motor 'clunks' or jumps a step, sometimes going reverse etc. Here's what the pulse looks like:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/pulse_whole.png

The first two (from the left) screenshots show the pulse generated by the uC / electronics, pulses are 41us wide and as per the manual the DIR signal is in front of the PUL signal (DIR is not shown here). The screenshot on the right is a pulse from a pulse generator, not much different from the micro controller generated ones. With the pulse generator the motor runs smoothly, even at 1Hz :O

Anyone got any ideas as to what might be causing the 'clunks'? the motor isn't loaded, it simply sits on a desk with nothing attached to it.

Regards,
T.

irving2008
13-10-2013, 07:47 AM
Is that trace from a time when it misbehaved? How sure are you that it's not contact bounce on the switch? Where is the driver input ground tied back to? Is the driver opto-isolated and are you sure the PIC is driving it hard enough?

dsc
13-10-2013, 01:03 PM
Hi Irving,

the trace shows any pulse generated by the PIC, I've looked at traces of randomly captured pulses and they are all the same. De-bounce is done on all switches, so they behave properly without any ringing etc.

From the manual the connections look like this:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/DM856_connection.png

I'm not sure what current consumptions the inputs have, but since it's all opto-isolated, I'm guessing the amount of current needed to drive them is not high. Looking at the above, the PUL+ is tied staight into the PIC output and PUL- is connected to 0VDC which is common to the PIC as well.

I can post a video later on to show how the 'clunking' looks like.

Regards,
T.

irving2008
13-10-2013, 09:48 PM
so you're driving the input to the stepper driver direct from a PIC output? What PIC are you using?

dsc
13-10-2013, 10:02 PM
Indeed, although I've just noticed that I'm using the pins on the PIC as source and the diagram in the manual shows the controller pins as sink ie. PUL+ connected to 5VDC and PUL- to the pin on the controller. I have it the other way around, PUL+ connected to the pin (which goes high to generate pulse) and PUL- to 0VDC. I'll swap it around and do a test.

I'm using PIC16F887 to control the DM856.

Regards,
T.

irving2008
14-10-2013, 07:43 AM
Exactly so and I think that may be a partial cause of the problem. In source mode those pins will only drive the Opto at about 7mA, it really needs 12 or more, and they will be susceptible to ground noise. In sink mode they can easily manage 15mA. I'm guessing you're driving the DIR line the same way and driving it high, which would also explain the occasional reversal.

As a first step, excuse the pun, I'd change this to use an active low approach.

dsc
14-10-2013, 10:39 AM
Yes at the moment I'm driving the whole lot like this ie. source rather than sink. I have the same problem for a PWM signal to another driver for a bigger Nema 34 motor. I will change all connections today, change the logic to be low active and do a test with the PUL signal alone.

Thanks again irving2008!

Regards,
Tom

dsc
14-10-2013, 10:57 PM
Ok I've changed it as per the manual, all outputs sink'ed, so PUL+ connected to 5VDC and PUL- connected to the output pin of the PIC16F887. Unfortunately it still isn't working, here's a video which shows it better than I can describe using words:

https://vimeo.com/76900420

[best to watch in HD and full screen mode. The clicks are tactile switches used to drive the motor]

I've tried using both PUL and DIR as well as PUL alone. I've tried making the pulse wider and using a bigger delay between the DIR and PUL. No change :( I also tried using a scope to check the state of the signal but to my surprise it makes the circuit stop working, I guess the 0VDC connection from the scope grounds the PIC output pin when trying to measure and there's no change on the output then. Not sure how to check what the pulse is like on the PUL+ / PUL- terminals.

Regards,
T.

irving2008
15-10-2013, 12:26 AM
You should connect the scope ground to PIC 0v and then probe the PIC output and/or the driver input PUL- assuming PUL+ is connected to +5v

EddyCurrent
15-10-2013, 11:10 AM
Maybe it's to do with parasitic capacitance at the PIC output so perhaps some kind of buffer stage would help ?

irving2008
15-10-2013, 02:08 PM
Unlikely at these pulse rates, tho I agree a buffer might be needed as a last resort. But I've driven stepper drivers from PICs before with no issues

@dsc 1: are PIC ground and driver supply ground connected or isolated?
2: what is Vdd on PIC?

dsc
15-10-2013, 02:18 PM
Duh moment on the scope question. Dumb-ness galore, will test today.

1. It's two separate power supplies, the driver is powered from a 68VDC Leadshine PSU and the PIC is powered from a plug-in 9VDC power supply via 7805 circuit to get steady 5VDC.

2. 5VDC

Regards,
T.

dsc
15-10-2013, 11:49 PM
Ok I've done some testing and I'm not sure what's going on. For starters I've connected the PIC to the DM856 and done some scoping:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/Pulse_DM856.png

This is the pulse when connected to the DM856, width 41us, nothing fancy jumps out. The back of the pulse overshoots a bit, not sure whether that matters:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/Overshoot_DM856.png

Here's a Pulse vs Dir screenshot, again around 55us difference between the two, DIR being changed first as per the manual:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/PulsevsDir_DM856CCW.png

Afterwards I followed Gary's (Zapp) suggestion and connected the PIC to a different driver, this time a bigger HBS86 coupled with a bigger Nema 34 motor (with an encoder). For starters I got a lot of noise on the pulse and direction lines, but I had all sorts of cables on the bench, crossed etc.:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/Noise_HBS86.png

Here's a pulse vs direction screenshot, all looking steady (well apart from noise):

http://i1120.photobucket.com/albums/l496/dsc_MT/random/PulsevsDir_HBS86CCW.png

And here's a video showing how the motor moves when the buttons are pressed:

https://vimeo.com/76993712
[video should work now]

Compared to the previous video this is steady, no jump backs, no sudden movement. A bit noisy I have to say, it clunks every time, but it's a bigger motor. Is this good behaviour?

I've started looking at the configuration of the DM856 but whenever I try to connect to the driver via RS232 it looses connection. I will try on a laptop at work tomorrow.

Regards,
T.

dsc
17-10-2013, 12:08 PM
Just a bit more info, here's the DIP switches on the DM856:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/switches.png

According to the manual this gives:

- 400 steps per rotation
- software configured dynamic current setting
- half current in standstill (or full, manual shows conflicting info for this)

Can anyone suggest buffering that would work on the outputs?

Regards,
T.

EddyCurrent
17-10-2013, 12:23 PM
So just to be clear, you are saying that it works fine with the HBS86 coupled with a bigger Nema 34 motor (other than noise) but it's not fine with the DM856 ?

The HC244 is often used as a buffer, it also has 2 active low output enables that can be used in a watchdog, E/stop, charge pump circuit.

dsc
17-10-2013, 01:06 PM
Yes it seems that way, with the HBS65 and the big Nema 34 it seems to work fine ie.no glitches, steps seem complete and there's no erratic movement front / reverse. The big motor seems to be louder, there's a 'clunk' when it steps, but I'm not sure whether that's correct operation or not as I've never used steppers before. The small motor with the DM856 shows a lot of erratic movement when driven by the same signals from the PIC, even though the noise levels on that driver are much lower than the HBS86.

Regards,
T.

irving2008
17-10-2013, 01:48 PM
Looking at those traces there's nothing obviously wrong with the input to the driver, so the issue would seem to be with the driver, yet you say it works ok with a pulse generator?

Are the motors clamped down to the bench? I know my bench testing was noisy when the motor was just lying there.

Do you have PIC ground and motor supply ground tied together or separate?

What do you have on input & output of 7805 regulator?

dsc
17-10-2013, 02:40 PM
Yes I've had it connected to a pulse generator earlier on, but of course that's a source output rather than a sink, it seemed to work ok I think, I will upload a video later on with a pulse genny on the DM856.

The motor just sits on a desk, I can probably clamp it down for further tests.

As I said before the PIC is powered from a plug-in 9VDC power supply, which is connected to the same 230VAC source as the 68VDC PSU which powers the motor / driver.

On the 7805 I have 9VDC on the input and 5.01VDC on the output.

Regards,
T.

EddyCurrent
17-10-2013, 02:54 PM
Having read you previous posts I am surprised you say this
As I said before the PIC is powered from a plug-in 9VDC power supply, which is connected to the same 230VAC source as the 68VDC PSU which powers the motor / driver. because it doesn't matter about that, it's the output dc grounds that have to be connected.

dsc
17-10-2013, 02:56 PM
Why is that? what I meant to say is that eventually it all comes down to the same 230VAC connection, so ground on both should be at the same potential. Or am I missing something obvious?

Regards,
T.

FatFreddie
17-10-2013, 03:47 PM
Why is that? what I meant to say is that eventually it all comes down to the same 230VAC connection, so ground on both should be at the same potential. Or am I missing something obvious?

It doesn't quite work like that, it's sort of complicated depending on earthing arrangements etc but you definitely need the DC grounds (maybe a bad term - DC 0v is better) connected.

EddyCurrent
17-10-2013, 04:09 PM
Well I was surprised because it looks like you know what your about but it may be I'm at cross purposes.
I'm on about this.
10442

But I then realised you might be saying this;

"I'm using the same power supplies for both the DM856 and the HBS86 tests"

Jonathan
17-10-2013, 04:18 PM
Since the drive inputs are optically isolated, you shouldn't connect the PIC DC ground to the driver supply DC ground as that looses isolation. I think there could easily be enough noise on the driver DC ground to cause incorrect signals on the inputs if you tied them together.

What you're trying to do should take about 5 minutes, not days, so there's probably something simple we're missing. Could you carefully draw out the complete schematic of what you've set up?


On the 7805 I have 9VDC on the input and 5.01VDC on the output.

I'm pretty sure Irving was asking to find what capacitors (if any) you'd put on the input and output of the 7805. The datasheets give typical values, which should be fine for this.

The 'clunking' you describe is normal at low speed, since the motor stops after every step. At high speeds a good driver will run the motor in a different way with continuous angular speed, so you wont hear the steps.

dsc
17-10-2013, 04:54 PM
Ok then, here's a connection diagram:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/diagram.png

I'm using this as power supply:

Solderless MB-102 Breadboard Power Supply - Dual 5V and 3.3V DC Jack and USB New | eBay (http://www.ebay.co.uk/itm/Solderless-MB-102-Breadboard-Power-Supply-Dual-5V-and-3-3V-DC-Jack-and-USB-New-/200942682754?ssPageName=ADME:L:OU:GB:3160)

As it can be used on a breadboard, had enough faffing about with 7805 on their own (too thick legs to fit on a breadboard). Not sure about what capacitors it's using, as it's all tiny SMD stuff.

I'm using the SPS705 unregulated power supply from Leadshine (Zapp) and used it on both the DM856 and the HBS86.

The only other thing is the setting on the DIP switches for the current, I was told by Zapp to set it to 2.1A peak, currently it's software configurable, but I can't connect to the driver as the software package from Leadshines drops the RS232 connection for some reason when I view the config of the driver.

Regards,
T.

Jonathan
17-10-2013, 05:12 PM
What you've drawn look fine to me.
Have you put a decoupling capacitor adjacent to the PIC? e.g. 0.1uF capacitor across VSS and VDD.

irving2008
17-10-2013, 05:14 PM
Jonathan got the point of my questions exactly right. The driver ground and the PIC ground should be kept separate.

That power board is fine for a PIC assuming you have nothing else loading it; it's good for 700mA and has the required decoupling. Do you have any decoupling capacitor (100nF typically) on the PIC power pins? Shouldn't really be necessary on a breadboard that size (I'm assuming the PIC is on the breadboard) but sometimes not having one can cause oddities.

Otherwise I can't obviously see where you're going wrong.

EddyCurrent
17-10-2013, 05:48 PM
I think I had in mind source connections

dsc
17-10-2013, 11:22 PM
Just confirmed I do have a decoupling capacitor between VSS and VDD on the PIC (right next to the PIC), value 100nF (104 code on the ceramic capacitor).

I changed the DIP switch setup, setting the peak current to 2.1A and done autotune via SW4 (toggled ON / OFF within 1sec, could hear some variable buzzing from the driver afterwards, I'm guessing it was the autotune process):

http://i1120.photobucket.com/albums/l496/dsc_MT/random/dips.png

Tested the whole thing again and no luck, the motor simply goes a few steps, then vibrates without moving after I press the tactile switch, then moves slightly after a second press and then jumps on the third press. I've tried it with a PWM output and that seems to work without any issues. I'm lost as to what's wrong, especially since it works with the big Nema 34 motor and the HBS86.

Just to double check the wiring, here's the connections to the motor:

http://i1120.photobucket.com/albums/l496/dsc_MT/random/wires.png

A+ BLACK
A- GREEN
B+ RED
B- BLUE

This comes from a spec sheet for the motor itself.

Regards,
T.

dsc
19-10-2013, 04:50 PM
Did some further testing today with a signal generator. It was wired as a source rather than sink, but I could easily repeat the glitches and sudden jumps by changing the frequency of the pulse signal (say from 1Hz to 2Hz). This is similar to generating pulses via tactile switch and seems consistent with what I've seen before. Constant pulse generation (similar to hold the tactile switch) from the pulse generator shows a pretty smooth action.

I think I've tried everything I could and I'm waiting for a reply from Leadshine.

Regards,
T.

dsc
27-11-2013, 03:12 PM
Based on the testing done by Gary, these DM856s all struggle with low frequency pulses / single pulse operation.

Can anyone recommend a driver which can handle 68VDC and drive a SY57STH56-2004A motor:

10873

?

Regards,
dsc.

Jonathan
27-11-2013, 04:03 PM
these DM856s all struggle with low frequency pulses / single pulse operation.

Just use microstepping to increase the frequency. You'll loose incremental torque, but that most likely doesn't make any difference as you're only interested in the coarser steps.

dsc
27-11-2013, 04:30 PM
I think the issue here is that the motor doesn't want to remain in-between steps and falls back into the 'true' full step, which is why it doesn't move at all and jumps two micro-steps at a time. I need this to move a step / microstep and remain in that position for a long time, including down-time when not powered up, I simply cannot have it miss steps or jump steps.

Regards,
dsc.

irving2008
27-11-2013, 10:29 PM
Then you can only use full steps. All forms of microstepping need power applied to hold position.

dsc
27-11-2013, 10:49 PM
Yes, I've just realised this. What's the normal work around if you need microstepping? 'Zeroing' on every power up?

Regards,
dsc.

irving2008
27-11-2013, 10:57 PM
Well, re-homing certainly.

Jonathan
28-11-2013, 12:03 AM
Since you're already using a PIC, it would be easy enough to add an encoder to the motor and use it to keep track of the position.

dsc
28-11-2013, 09:46 AM
Well I could use an encoder, although I'd need an absolute one to know where the motor sits after power cycling the thing.

Regards,
dsc.

dsc
09-12-2013, 02:22 PM
Just use microstepping to increase the frequency. You'll loose incremental torque, but that most likely doesn't make any difference as you're only interested in the coarser steps.

Kudos again to Jonathan, I'm using 1/4 microstepping and sending four pulses to move a step. Works like a treat, no jumping, glitching, random movements.

Regards,
dsc.