PDA

View Full Version : stepper motors glitching



routercnc
25-05-2010, 09:59 PM
Hi all,

This is my first post here - thought that since I lived in the UK I should support this one rather than some overseas ones :tongue:.

I'm part way through my second cnc router build (I will post this at some point for interest) and thought I'd take the opportunity to resolve an issue with one of the stepper motors. The x axis was basically glitching quite frequently during traversing. My set up is:
Driver board System3 all in one - Roy DIYCNC
3Nm steppers x & y - ArcEuro
1.8Nm stepper z - (sorry,can't remember where from)
Power supply 350W 33V - Roy DIYCNC
Desktop PC with parallel port.

After doing extensive testing (step width, pulse width, ramp rates, swapping motors, axes etc. different step rates etc.) I concluded that it was the X axis driver circuit. The charge pump signal had also stopped working some time ago, and needed to be overriden to get the board going again. I wrote to Roy and he suggested sending the board back to replace the allegro chip. It is now back with me, as a complete new board :cool:, and bench testing shows that now all 3 axis are glitching!

I started to wonder about the data from the PC so have borrowed an oscilloscope and checked the pulses out of the end of the parallel cable (i.e not connected to the driver board). During a steady traverse (me pressing the left arrow for example) they show square regular spaced pulses (I'm triggering off the pulse to make it easier to read), but quite often the spacing of the next pulse varies considerably. This means that the PC is the source of the glitching.

I've only discovered this tonight, so have alot of things to check, but though I'd ask for ideas on this one?

The PC had a fresh XP install, with only Mach3, a CAD program, Vectric Cut2D, and AVG (virus checker). It is on the internet, but it still glitches even it is not. I've not checked all the processes which are running in the background, but the Mach3 diagnostic screen shows 'Int time' around 10. Sorry this info is a bit sketchy, I need to do more on this.

I'm sure someone else must have had this issue. Reason for pursuing it is because complex jobs seemed to be loosing steps in the X direction and the 2 issues seemed linked.

p.s. Also have an extra parallel port in the PCI slot which I've not used yet (was intended for further inputs etc). I briefly had a play with this to see if I could run it all from here in case the main parallel port was broken, but could not get motion. Didn't have time to investigate tonight. Thoughts on trying this route welcome.

Thanks
Barry

Lee Roberts
25-05-2010, 11:08 PM
Welcome to the site Barry, Hum "but could not get motion" I’m not the best tool in the box but I would say try taking that PCI card out and see if that helps. I'm just thinking maybe its conflicting with the main one, I’m not 100% sure but I think I read somewhere that some PCI cards have given issues, I could be wrong but if you can get time to remove it then you may as well.

The guys will be along shortly and hopefully have better solutions to offer you, welcome to the site anyway and good luck!

routercnc
26-05-2010, 07:39 AM
Hi Lee,

Thanks for that. When I said could not get motion, that was only last night when I plugged it into the additional PCI parallel port as a trial. When it is plugged into the main parallel port all steppers move fine, except for the glitching which I think is leading to lost steps.

The glitching has been there from day one (about 1.5 years ago) long before I added the second PCI port card, so I think this is OK, but will remove anyway as part of the trial.

There must be something upsetting the pulse output from the PC. I've got some ideas but as this is a hobby it will have to wait for the next window.

Suggestions welcome !

Thanks
Barry

FatFreddie
26-05-2010, 11:37 AM
Hi Barry,

I don't use Mach3 but I'd suspect AVG or possibly the video driver. Installing EMC2 on several machines showed poor latency with inbuilt video drivers so it might be worth sticking in a video card if you have one handy - I had a Matrox lying around which is recommended for EMC2 and it helped considerably.

Mark

routercnc
26-05-2010, 01:06 PM
Hi Mark,

The video card idea is worth looking at, hadn't though of that. I bought the MB from a colleague who was into music creation. He wasn't bothered about the video card, and it might even be on-board video. It was over a year since I built this machine so I will check tonight. If it is on-board, or low spec, an upgrade would be worth a try.

I think this latency is the route of my problem, just a matter of finding out the cause. If it is AVG then that would be annoying since I would have to drop internet access on the garage machine, which is quite useful.

The processor was reasonably good, an Athlon XP 2600, and I put in a fair bit of ram. MB was a well known make.

I'll post back if I find out any more, thanks. Other suggestions welcome . . .

routercnc
27-05-2010, 07:48 AM
Still haven't checked the video card, but managed to run a few more quick checks last night. Attached is a photo of the oscilloscope display when connected to the parallel port lead, pin 3 (x steps) during trraverse. First photo shows scope with even spaced pulses, second photo shows the glitching of uneven spaced pulses.

I'm also have a video of the steppers running. I will post later, and you can hear the glitching.

Screen shot of DriverTest program, shows all is well.

Also switched off Virus checker, and set it up to trust Mach3. Made no difference.22082209

Robin Hewitt
27-05-2010, 11:06 AM
I don't use MACH because Windows isn't a friendly enviroment for stepping. Don't know if this will help, but on my PC pressing Cntl-Alt-Delete brings up the XP Task Manager. Check the "Performance" tab and see how flat your CPU usage graph is. Parking a jittery mouse slightly past the screen bottom right hand corner can help smooth it out.

FatFreddie
27-05-2010, 11:45 AM
You could try the EMC2 trial disk (http://www.linuxcnc.org/content/view/21/4/lang,en/) which would help determine whether it's hardware or software.

It's interesting that Mach3 appears to think the PC is ok but there are problems in operation. How long did you run the test and what other system activity was there?

The EMC2 latency test suggests running it for a while and stressing the system at the same time.

Will the scope capture to a file? - it might be more instructive to see a series of pulses.

routercnc
27-05-2010, 12:39 PM
Hi Robin,
I did pull up the task manager and took a screenshot of the processes running, and nothing stood out as odd. I'm at work so don't have this picture, but will post it later in case anyone spots anything. I didn't try the CPU useage graph, but will have a look.
In terms of Mach3+windows, I know there are many happy users running this combination so I should be able to get to the bottom of this, although I accept your point about Linux.

FatFreddie,
I'll have a look at EMC2 as part of the investigation. Should tell me where the problem is/is not. I ran the Mach3 test for about 20 seconds, and Mach3 was minimised and not cutting, but nothing else. I should try this with more things running, and for longer, and see what happens.

I'm working on a way to capture the scope data since this would be a great help. Once I get the stepper video posted on youtube (never posted video before), it should help some of the experts out there to offer a solution.

Another thing I'm going to try is to look at the signal off the parallel port directly at the motherboard. My scope data was from the end of the parallel port cable. I have read about suspect cables, and I'm hoping it is as simple as that because it would be easy to fix!

Thanks for all the suggestions so far, there are more things to try than my hobby time allowance allows (don't ask!) but I will get through them all in the end.

Thanks
Barry

Lee Roberts
28-05-2010, 01:50 AM
Hi,

It dose say on the MACH website:


Minimum Requirements:



Non-integrated Video Card with 32MB RAM





However I think this is from the old days and providing you have got enough RAM in the box shouldn’t give you a problem after all it is the minimum specs.


Something that maybe worth trying (as you can leave them running and come back) is some system stress test software's. This will max the PC out for hours and report back to you how it did, I think if you are running an integrated graphics card then I would look at running a memory testing program just to be sure the RAM is ok, memtest86+ I use here on new builds and with it being an older system....let me know if you need a download link for this. The system stress test software i use is called Prime.

I would consider removing AVG as well, if your other system has got an antivirus on it then you could just use a USB pen drive to move files about, I understand though as internet access/ local LAN is handy to have if everything is working ok.

routercnc
28-05-2010, 07:53 AM
2212Hi Lee,

I did some more testing last night, and got the PC spec.

Processor AMD Athlon XP 2600
RAM 1.5Gb
Graphics card FX5200 128MB ram (i.e. not built-in)
MB Asus A7N8X Deluxe Gold
Windows XP SP3

A few years old, but plenty good enough!

Checked the output of the Parallel port directly and still got glitches on the scope.

Then disabled the PCI parallel port and got clean pulses from the main port! Quickly hooked up the steppers and got clean runs - for about 20 seconds, then the glitches came back. The allegro chips all got quite warm on the drivers, even though the current is limited to 1A. System3 is an all in one board, and for these tests it is out in the open. Shouldn't be overheating surely? Thinking about heatsinks and direct fans on chips to see if this helps (case has general exit fan).

I might need to remove AVG to see if that helps, but the chip heating needs to be checked out a bit more first.

Thanks
Barry

irving2008
28-05-2010, 05:12 PM
Definitely sounds like there might be a heat issue.

A useful trick from my 'making the design work on the manufacturing line' days... Pop to maplins, get a can of freeze spray (or B&Q pipe repair freezer) - its a bit pricy (£14 B&Q) but you only use tiny amounts. direct the spray onto hot parts one at a time, small bursts, till you find which component reacts. A temperature probe (Maplins £19.99) is also useful. Obviously adding a fan would help but sometimes replacing a part with a better rated part is a more effective answer, or adding localised heatsinks. Classic examples of poor design are the lack of heatsinks on voltage regulators so they flip in and out of thermal limiting - doesnt stop the circuit working but causes odd side effects as the regulator current limits and the 5v supply rail drops out of spec for a millisecond or so.

routercnc
28-05-2010, 07:46 PM
Hi Irving2008,

I was beginning to think that this was a heat issue, but went back in the garage after work today and the reading direct from the parallel port was full of glitches again. I'm getting very confused by what seems to be perhaps multiple contributing factors.

Started disabling every other port and piece of hardware I could, and disabling AVG at startup, removed printer driver, and still got glitches on the port.

Only encouraging thing from this is that I've managed to ''hold" scope readings on the screen to work out the pulse spacing. Sorry I'm struggling to get these as a good photo (there is no output on the scope either), but I think the following will give you the numbers you need. These are the Mach3 settings, and theoretical pulse spacing:
INPUT
320 steps / min (calibration: stepper per rev, 1/8 microsteps, 5mm pitch)
1500 mm / minute traverse rate (my jog speed)

THEORETICAL OUTPUT
= 480,000 steps / min
= 8000 steps / second
= 8000 Hz
= 125 microseconds between pulses

Comparing this to a typical scope reading shows several pulses spaced at 125 microseconds, then a spacing of about 187 microseconds, followed by more at 125 microseconds. This 187 microseconds is probably:
125 + (125/2) which is 187.5

This means there are several normal pulses, followed by a gap of 1.5 times the correct pulse rate. This is odd, I was expecting missing pulses rather than a mis-timed output. It is more of a jump than a missing pulse. Does this give anyone any more ideas?

Thanks for your continued support and ideas . . .
Barry

Re-read your post, and thought I'd add a bit about the system 3 board and the heat. There are transistors with metal plates which I think are the regulators (see photo in post above). These do get quite hot to the touch within perhaps a minute or two, hotter than the allegro chips. I had considered heat sinks on these, but with the glitches on the parallel port that area of investigation will have to wait. Good suggestions about the cooling spray etc, thanks.

Robin Hewitt
28-05-2010, 11:37 PM
Comparing this to a typical scope reading shows several pulses spaced at 125 microseconds, then a spacing of about 187 microseconds, followed by more at 125 microseconds.

A quick explain might be called for, if you already know all this someone else might find it useful.

Windows time slices the processor, that's how it can run several programs at the same time. A Windows programme is actually a whole mess of unconnected programmes all working to a common purpose.

For example: You ask Windows to put a button on the screen, a resource. You the ask Windows to allocate the button to you, and come to you should someone press it. Your button might require part of the screen to redraw but your button can only invalidate that part of the screen. Nothing happens until Windows asks you redrawing program to refresh that part of the screen.

Without time slicing the machine nothing works.

MACH has to assume that other programs do not create appreciable delays. If they do you get glitches. That is why you you want to crock everything possible apart from MACH.

AVG 9 has a bad habit of creeping across your disk checking files. I know this because I had a corrupt sector on my disk, if I tried to read it Windows crashed. It took about half an hour for AVG to find it running it's background scan and then POW, dead machine.

Go through your Start up and crock anything you can get away with.

mel_earp
29-05-2010, 09:20 AM
Robins explanation is fine as a basic understanding, but as in any field it can and does go much deeper than this. I am sure that Robin is using the term "time slicing" in an informal manner, but the original time slicing based operating systems used fixed and then variable time slices which could not be interrupted. This is no longer true for Windows and it doesn't time slice in the strict meaning of the term. Also made more complicated with the advent of multi-processor chips. But Windows doesn't, and this is the problem, have much in the way of mechanisms to guarantee that processes that need it, get the resources in a timely manner. This is what I meant when I said that Windows is not a real time operating system, and it is never likely to be so because, apart from it being too hard, there is no commercial reason why Microsoft should make it so.

A real time operating system would know that certain Mach processes were time critical and would do all that is possible to give them the resources as soon as they needed them. Windows makes a bad job of this. The time taken to do this is called latency and this is one of the things the Mach (and EMC) test programs try to measure.

EMC will generally be better at this because it is based on a version of Linux with real time extensions - not fully real time from the ground up, but not bad.

If the source of this problem is the software (not yet proven) then the only hope is as Robin says, kill everything that is not essential for Mach. That includes AVG, any additional hardware drivers... I think it unlikely that a network driver could cause this, but it is known that some network drivers can spend time looking for an UNPLUGGED cable. So if you have a network driver try both situations, with the cable being plugged in as the preferred option. The best way would be a clean Windows install. Some software packages are notorious for not quite uninstalling themselves. So, if you have installed anything else and uninstalled it, you have to consider a Windows clean install and clean means ask for the disk to be formatted along the way. A Windows install over an existing copy won't necessarily get rid of the rubbish. The install process might just pick up stuff from the old installation.

(BTW - I used to design real time software)

irving2008
29-05-2010, 09:42 AM
(BTW - I used to design real time software)
You and me both :)

Of course there are true real-time extensions for Windows, as well as the embedded Windows with RTX, but the licencing costs of those makes it unlikely to get into hobby-level software. There was an OpenSource RTX sometime back, but it seems to have died off....

Robin Hewitt
29-05-2010, 10:12 AM
My stepper driver runs under DOS :eek:

Ancient history maybe, but I have the computer's undivided attention and all it takes is one setvect(0x1c,service); for the timer interrupt to become mine, real time, glitch free.

The only real escape for Windows is to add a slave processor on the end of a cable. The slave can then do all the timing while Windows makes it pretty.

routercnc
29-05-2010, 02:17 PM
Thanks for all these suggestions and explanations. AVG is out of there! If this does not work then I had made my mind up last night that it was time for a fresh install. That machine actually has 2 hard drives (the other one is not used but contains the old system that got too clogged up) so I am going to reformat the other one, re-install windows, any vital drivers, then mach3.

Wife is asking when she can have things engraved again, so no pressure then!

By the way, if I were to create an 8KHz square wave (of about 3-5v) and inject it into the system3 parallel port pin 3 and earth, would the stepper rotate or does it need all the other pins to be present (board has a charge pump override)? I have access to lots of signal processing kit at work and could easily do this, or even borrow a signal generator to do it live.

Thanks
Barry

irving2008
29-05-2010, 03:22 PM
yes it would, in fact thats exactly how I test my drivers. You may have to patch the enable lines and disable the charge pump but these should be jumpers you can move on the system 3 board, or make a 25way test adaptor from a 25pin male connector and some hookup wire.

routercnc
30-05-2010, 04:47 PM
I re-formatted a spare harddisc, installed windows xp, and then added mach3. Same problem with glitches. I'm now open to try anything, so . . .

I downloaded ubuntu-8.04-desktop-emc2-aj13-i386.iso onto another machine, then burnt it onto a disc. However, when I put this disc into the cnc PC with the reformatted harddisc (setting it to boot to CD in BIOS) I get 'Boot from CD :' then 'disc boot failure, insert system disc and press enter'. It does not recognise this as a boot disc. Not being familiar with linux install I don't know how to proceed from here. Any offers?

irving2008
30-05-2010, 08:11 PM
did you burn it as an ISO image using 'disc at once' or burn it as a file? If you open the CD on your PC do you see the ISO file, or do you see a collection of files? If the former then you need to find out how to correctly burn an ISO image...

John S
30-05-2010, 08:57 PM
Try this.

http://www.codeproject.com/KB/system/17ChannelLogicAnalyzer.aspx

and check the BIOS is set to EPP

routercnc
31-05-2010, 09:14 PM
Hi irving2008,

Looks like I did not create an ISO. Am reading about those so I can try again.

John,
Downloaded the analyser and tried it briefly. The graphical output showed some red pulses, but they were all in a block. I need to play with that a bit more, but my Wife is getting upset with the amount of hours (days!) I'm putting into this.

Started again with a clean install this morning, following the Mach3 windows optimisation steps. Disabled everything on the list (sound, gone back to classic, switched off auto updates etc.etc.). Switched to 'standard PC' in hardware.
Still glitches.

In BIOS have disabled: game port, midi port, AC97 audio controller, onboard lan (nvidia), onboard lan (3com) 1394, serial port1, serial port2
Parallel port is set to: 378/IRQ7
Still glitches.

Then went through all the parallel port options in BIOS: ECP+EPP DMA3, EPP, ECP DMA1, ECP DMA3, SPP, ECP+EPP.
Still glitches.

Then in Mach3 traversed at various speeds (since I noticed that 1500mm/min did not glitch since this fresh install). Noticed that: 50,300,500,700 mm/min all glitched. 1200 mm/minute occasionally glitched. 1500mm/min never glitches, nor does 2500mm/min. 3500mm/minute makes the motor sound unhappy (but not glitching). Cutting at 1500mm/minute is not possible, so this is not a solution but may point to the answer.

I hooked up the scope to the system3 boards whilst it was running, onto pin3 and earth. At 1500mm/min (when there is no glitching), the scope does not give a steady spacing between pulses and is very inconsistant. I can no longer rely on the scope and need to use the motors as a glitch guide.

I'm beginning to think there is a fault with the MB (or parallel port). Even used on ebay this spec of board (ASUS A7N8X) still is quite expensive. What MB are people successfully using Mach3 with?

Thanks for your patience !!
Barry

routercnc
05-06-2010, 10:09 PM
Update,

Installed ISO recorder into windows xp, and created a proper boot disc for Ubuntu and EMC2. Installed this onto a reformatted second HDD. I ran the latency test and got max jitter servo thread of 6983, and max jitter base thread of 7541. These are similar to the results in the EMC2 manual, so assume are OK.

I then ran EMC2 using the 'stepper mm' profile. Unfortunately this also glitched the motors!

I then tried the profile which sends the stepper pulses to the speaker (nice feature). This also glitched. I attempted to record this into another computer using 'windows sound recorder', so I could post this and do some analysis on it, but got the windows error about not enough memory. Microsoft say this is a problem on machines with more than 2GB (this other machine has 4GB), but do not offer a fix.

Anyway, later today I switched on the CNC PC and tried Linux again, but system will not get past POST with 'NTLDR is missing' error. Tried lots of things but can't get past this. PC obviously thinks there is a problem with the boot or root directory of the Linux HDD.

Went back to Windows XP and added a PCI parallel port, added the driver, and configured Mach3 to this port. Motor rotated, but still glitched. Glitches are still happening at <900mm/min or so, but not >1500mm/min. This test probably means the built-in parallel port is OK.

So in summary:
Fresh install XP, optimised computer (all drivers updated, standard PC, minimal hardware enabled etc.): this helped and glitches only occur <1500mm/min
Brand new replacement driver system3 board from Roy - glitches
Mach3 using PCI parallel port (Moschip) instead of built in port - glitches

Fresh install on reformatted HDD of Linux and EMC2 - glitches
Linux and EMC2 output to speaker - glitches

This all suggests it is the motherboard (ASUS A7N8X Deluxe Gold), or MB chipset. I would welcome information on successful MB & chipset combinations which work with Mach3 (or EMC2), what are other people using?

Also, been reading about smoothstepper. Since this takes the timing away from the PC, do you think this would help?

Thanks
Barry

irving2008
05-06-2010, 10:26 PM
Update,

Installed ISO recorder into windows xp, and created a proper boot disc for Ubuntu and EMC2. Installed this onto a reformatted second HDD. I ran the latency test and got max jitter servo thread of 6983, and max jitter base thread of 7541. These are similar to the results in the EMC2 manual, so assume are OK....

Anyway, later today I switched on the CNC PC and tried Linux again, but system will not get past POST with 'NTLDR is missing' error. Tried lots of things but can't get past this. PC obviously thinks there is a problem with the boot or root directory of the Linux HDD.

BarryNTLDR missing is a Windows boot error, means that the PC has a Windows master boot sector trying to find NTLDR on the disc... suggests your dual boot setup is not right, or corrupted

routercnc
09-06-2010, 07:34 AM
I borrowed a function generator from work yesterday and set it up for a square wave TTL output of 8KHz (=1500mm/min on my system). I connected this to pin3 and earth on the driver board and the stepper motor ran smoothly. I then tried different speeds and at low speeds <8KHz the motors glitched. This was the same result as when the PC is connected whereby it glitched at lower speeds. Although this doesn't rule out the PC glitching, it certainly means that the driver board, stepper motors, or power supply are causing part of the problem and need to be resolved before connecting it back to the computer.

The driver board is a brand new replacement since the previous board glitched (but on the X axis only). The power supply is a 33v 10A unit and is the one recommended by Roy at DIY CNC. This power supply provides 33v (I've checked this with a DVM), which goes through a switch and a current display 0-5A. I plan to directly connect the power to the board to elimate the switch and meter. Next is to double check the wiring to the steppers, but I was very careful with this when I wired them up. Might be getting somewhere !!

routercnc
09-06-2010, 12:48 PM
This morning before work I connected the driver board directly to the power supply, thus eliminating the switch and the current display. Again driving directly from the function generator it still glitched <8KHz (i.e. <1500mm/min).

I then checked the connections to the motor and they are all tight. Checked the coil resistance and they both read about 2.8 ohms. I think I read somewhere that this is OK.

I did notice that if the earth connection from the function generator is not made to the parallel port connector, (i.e. only pin3 square wave input is connected) then the stepper motors will still run. This must be earthing through the mains since the power supply and the function generator both run from the mains.

Therefore since the board can run from 24v - 33v, I'm thinking about running it from 2 small 12v batteries in series, as a test. The function generator can also run from batteries. This might tell me if there is some kind of earth loop problem, although Roy tells me that there should not be. The board is not optically isolated.

Are the other users of the DIYCNC system3 all-in-one board out there? What is your set up like?

irving2008
10-06-2010, 01:02 AM
Is the glitching at the same frequency? Is there one speed where its worse? I wonder if you're experiencing mid-band resonance where the mechanical and electrical parameters combine to absorb energy to the point where the motor cannot maintain enough torque and therefore loses steps. If you sweep the frequency can you determine a specific point where the glitching is worst? If so, try adding some damping to the motor shaft, e.g. a flywheel or some other angular weighting. Does it still glitch then and has the glitch point moved? If so this would indicate a resonance issue.

routercnc
10-06-2010, 07:48 AM
Hi Irving2008,

The glitching is random, and occurs consistently at any speed lower than 8KHz. There is no bad point, they are all equally glitchy until about 8KHz where it starts to smooth out. Above 8KHz it never glitches.

Note that I'm not actually connected to a cnc machine at the moment to resolve this. There is just the 33v power supply, system3 board, one stepper motor, and the function generator. I've disconnected limits, estops etc. There is no load on the stepper and it is still glitching in the same way as when connected to the machine. By the way it sounds I don't think that this is a resonance issue, more like an electrical spike or interference type problem, but I'm open to try all ideas.

I've got 2off 3Nm motors (Arc Euro) which both glitch in the same way, and have different length wires, and one 1.8Nm motor (DIYCNC) which also glitches in the same way and has different length wires again.

I think the best thing for me to do is try and get a video posted so you can see the set up and hear the results of different speeds. Bare with me, never posted video before!

Thanks for your continued support. Determined to resolve this one . . .
Barry

Swarfing
10-06-2010, 12:43 PM
Could i suggest you set it off running and then disconnect your screen plus its power supply. I have a similar issue with a dell and it has bad earthing issues from the screen power supply. The interference from these are notorious, could even be the machines power supply chucking spurious outputs all over the place. Worth a punt?

routercnc
10-06-2010, 05:06 PM
Hi 2e0poz,

It's a good suggestion, but the monitor is not on at the moment (see previous post). Neither is the PC. To track the problem down I'm running the driver board from a function generator which is providing square wave signals into the parallel socket on the driver board. Therefore the problem must be with the 33v power supply to the board, the board itself (which is a new replacement), or the stepper motor (of which I have 3 and they all glitch in the same way).

But I think you are right in that there must be some kind of interference from something, or bad earth somewhere.

Hoping to have another go at this after work tonight . . .

Barry

Swarfing
10-06-2010, 09:34 PM
Sorry Barry thats me all over skimming instead of reading.......I suffer a lot of issues with switch mode power supplies near my radio gear, they cover a lot of frequencies across the different circuits that make up the supply unit. It may be worth probing with a frequency counter and see if any clash with the driver. What can sometimes be seen as a spiky output could in fact be a number of signals overlapping.
Paul

routercnc
10-06-2010, 09:51 PM
Cracked it !!

Well, I've found the source of the problem anyway. The driver board can take 24v - 33v, so I set up 2x12v 7Ah lead acid batteries to power it by DC, eliminating the 330Watt mains power supply. Now there are no glitches at any speed, from barely moving, right up to 12KHz. I ran it for several minutes like this, changing the frequency on the function generator and it was smooth all the way.

It is remotely possible that the glitching is removed by dropping the voltage (although this doesn't feel like the answer), but I have no easy way to check that since the mains supply only goes down to 33v. Could I use a high wattage resistor to drop the voltage from the mains power supply to 24v to check? What value and resistor type to use if I wanted to try this?

So, I have a square wave function generator, into the stepper parallel port of the driver board, and one stepper motor connected. The board is running from 24v DC and does not glitch at all. However, this is not a long term solution since the batteries are quite small and old and I think they won't take to running the CNC machine.

Now, what is going on here? The power supply was from Roy at DIY CNC and was recommended. Obviously I will email him for advice on this since something about this power supply, or some interaction with the driver board, is causing the glitching, but I'm not electronics expert so need a bit of help.

Can I put ferrite rings around the DC cables?
My VFD came with a mains filter, would this sort of thing help on the main side of the power supply?
What about these choke type devices on the mains side of VFDs?
Could I safely scope the DC voltage to the board provided by the mains power supply to see if there is noise on the supply when the steppers run?

Out of time to try anything more today, but starting the see a way forward!

Thanks
Barry

John S
10-06-2010, 10:06 PM
I hate switched mode power supplies. Steppers need to get rid of excessive power as they decelerate, it's known as back EMF.
Normal power supplies like a transformer, cap and rectifier can absorb this back EMF, switched mode can't.

Not a perfectly technical explanation but it gives the gist.

Barry can you try a convention power supply?

.

irving2008
10-06-2010, 10:53 PM
Well somethnig to try is providing some additional hi-frequency bypass capacitors on the power input to the driver board. An 0.1uF/100v in parallel with an 0.01uF/100v should do, this will eliminate any switching spikes from the motors going up into the power supply and upsetting its regulation. Also to absorb back emf a large electrolytic capacitor might be useful, something like a few thousand uF at 100V.

I agree with John tho, if you can try a linear power supply then do so...

routercnc
13-06-2010, 08:23 PM
Hi John, Irving2008

Thanks for your suggestions. This does all make sense now, and probably explains why the stepper ran smooth at the higher rpm, since the pulses would be closer together and the deceleration of the motor between them would be less, creating less back EMF.

I tried both the 0.1uF capacitor, and the 0.01uF + 0.1uF, and both combinations reduced the kick of the glitch, and also brought the frequency down from >8KHz = no glitches to >6KHz = no glitches. A small improvement, but not solved. I tried a 1000uF 35v capacitor which I had, and this brought the frequency down to about >5.5KHz = no glitch. Roy at DIY CNC said that he had sold alot of these supplies and had no problems, so it could be faulty. He suggested I try a 4500uF - 10000uF 35v capacitor across the power supply in the first instance, so I have ordered a 10000uF 35v unit from ebay. If this does not work, then I'm still open to try a replacement.

Otherwise, I did have a look around the internet for an equivalent linear supply of about 30 - 33v, up to 10A, and didn't find much about. I could probably live with a lower current rating since there are 3 axis of up to 2A each, but some overhead is nice. Alot of people had made their own supply from a transformer, diode rectifier circuit, and capacitor(s), but I don't trust my electronics enough for mains. Where are you buying them from?

Thanks
Barry

irving2008
13-06-2010, 10:27 PM
I'd be wary of putting a 35v rating capacitor on there permanently, the back emf could easily get to 45+ volts and lead to premature capacitor failure.

Makig a linear power supply is easy. Its hard to find ready-made linear supplies as there's little market for them outside the CNC world. I'd be happy to take you through it, almost no soldering required!

John S
13-06-2010, 10:47 PM
Right 3 axis at 2 amps each is 6 amps but as they are never running at the same time, and believe it or not they don't draw 2 amps then the rule of thumb is 70 % of total. However to give a bit of over head we'll say 6 amps at 30 -33 volts.

So we select a transformer in this case from RS because I'm idle and they deliver for free.
6 Amp at 25 volts #223-8207 £ 27.82

Next we need a capacitor 10,000uF 63 volt working #255-0232 £10.44

Then a bridge rectifier 15 amp 50 volt working #515-5559 £1.50

Now because it is smoothed by the capacitor and converted into DC that 25 volts now becomes 25 x 1.414 = 35.5 volts.

All these components above are either screw fixing or you crimp on spade terminals, no soldering needed.

irving2008
13-06-2010, 11:37 PM
I'd go higher on the bridge rectifier... 15A 100v, part # 687-5642 @£1.75
This will need to be mounted on a 5degC/W heatsink or better (or the aluminium case you mount it all in if its at least 200mm x 150mm)

Also its 25 * 1.414 - 1.1 (forward drop of diode) = 34v, which might be a tad hi for a 30V driver.... 8% regulation its going to be nearer 37v off load... just need to check max driver voltage.

10000uF capacitor will give 2% ripple @ 6A which is more than adequate, for 3% ripple you could go as low as 6,800uF (381-9093) @ £8.59

Dont forget fuse holder (384-011, £1.23) and slo-blo fuse @ 1.5A, crimp terminals for the fuse holder and bridge rectifier, ring terminals for the capacitor, 10A-rated 'chocolate blocks' for input and output

z3t4
13-06-2010, 11:47 PM
Genuine question here 'cos this is most definitely not my home territory. That transformer is 300VA (2x25V, each at 6A). Do you need 300VA, or are you just putting in a nice healthy margin?
I'm interested in this, having seen the telecoms PSU's on the 'bay* at 13 quid for 50V @ 9A. Was already to unlock the safe and trade in some beloved Jaffa cakes, but it's a SMPSU so after this thread I'm not so sure.

*Item number 380071301709

Cheers,

John

routercnc
14-06-2010, 07:50 AM
Wow, thanks John and Irving2008

Before I blow the dust off my GCSE electronics certificate (grade B - long time ago!), I will give Roy's suggestion a try when the part arrives. If it works, I will upgrade to a higher voltage capacitor as you suggest. I still remember seeing a capacitor explode when it was deliberately connected the wrong way around, as a warning, so am cautious about higher capacity units in general.

If it does not work, I should give Roy the chance to swap the power supply for another unit if it is genuinely faulty. If that is still no good, then I will take you up on the offer of helping me make my own linear supply. I have ring terminals and an electricians crimp tool (proper heavy ratchet job, not cheap DIY one), and with a couple of questions and a diagram could probably put one together.

The system 3 board is technically rated at 24v-30v, although Roy does allow 33v to give a bit more motor power. Anything higher is probably pushing it, and so the above specs might need to be revised a bit. Could I add a voltage regulator (?) or start with a different transformer?

If I do end up making my own, I'll signoff from this thread and start another.

Thanks
Barry

irving2008
14-06-2010, 08:10 AM
In that case go with an 18v transformer not 25v... 18v *1.4 -1.1 = 24.1v nominal, 26v off load. Ideally you want a 22v transformer but the only way to get one is to roll your own.

Actually there is a solution to this - its called buck windings. Basically you wind 10turns of heavy gauge wire onto the transformer and measure the voltage you get, then adjust the number of turns till you get 3v and connect that in series with the other windings in a way that reduces the output voltage from 25 to 22v. This allows you to fine tune the output voltage for a little more effort and messing about but relatively little cost (a reel of shellac insulated 14 gauge copper wire basically)

routercnc
16-06-2010, 07:45 AM
More testing, and a video !

The 10,000uF 35v capacitor arrived yesterday, so I connected it across the power supply to the board, but the glitching was unfortunately still there. I also added a further 0.1uF capacitor as well but this was no better. The scope showed that the capacitor reduced the ripple, but the steppers still glitched.

With this scope connected to the power supply input I could monitor the waveform at different motor speeds. At very low speed (1KHz) there was ripple, which you would expect, but there was also a sort of saw tooth pattern which might be the stepper pulses appearing at the power supply. The stepper was glitching at these lower speeds.

As I increased the frequency up to about 6KHz the waveform started to smooth out and the saw tooth slowly disappeared. The stepper was then very smooth and did not glitch. Above 6KHz the waveform and the steppers continued to be smooth.

I've posted a private video on YouTube. Sorry it is low quality, my camera is quiet old. Also, YouTube has moved the sound well ahead of, and out of synch with, the picture. Don't know why.
www.youtube.com/watch?v=q8Ov7v74Kbo (http://www.youtube.com/watch?v=q8Ov7v74Kbo)

I've sent all this info to Roy at DIYCNC to see if a replacement PSU is the next thing to try.

Other info, when I turn the steppers by hand, the blue power light comes on on the board (when it is switched off). They must be generating current as alternators. If I drive the steppers with my cordless drill then at quite low speed the drill stutters. If I repeat this but don't plug the motors into the board then the drill can spin them up to high speed very smoothly. Is this all normal behaviour?

Thanks
Barry

der_fisherman
17-08-2010, 08:27 PM
I have an idea that you might like to check out, find out exactly what current your PCB is drawing from the parallel port outputs in milliamps. Its only guaranteed to be a TTL output so when its high (5 volts) it should not exceed 2.6ma. When low (0 volts) it should not exceed 24ma..
Many commercial and home built units simply take too much current and damage the interface.....
Here is a good tutorial on the printer port:-
http://ee.cleversoul.com/parallel-port.html
You can find this at point 6. in the tutorial:-
6. Electrical

See also the tutorial section below on TTL outputs.

The Data Out pins were orginally driven by a 74LS374 octal latch, which could source 2.6 mA and sink 24 mA. There were 0.0022uF capacitors between each
line and ground to reduce transients. The manual warns "It is essential that the external device not try to pull these lines to ground", as this might
cause the 74LS374 to source more current than it could handle without damage.
Some parallel ports can supply more current, but it is almost impossible to know which one can........so always take on the "legal" maximum for safety.....
Having Windows running as well can cause problems, but as I am not a Mach3 user, take that with a pinch of salt, but you might check that you have the correct SP level for the software, that might be a problem.....
Regards
Andy

routercnc
17-08-2010, 08:58 PM
Hi der_fisherman, guten abend.

I've parked this problem for now until I've finished off some house DIY jobs, and can also finish off the mechanics of the CNC machine. I'm sure you know how it is!

But when I'm back on this again I can do the checks you suggest above, although as I mentioned if I run the board from DC instead of the AC supply everything is fine. Roy's CNC board products have a good reputation and following, so I'd hope he know about handling the parallel port properly.

On the suspected faulty power supply front because it was 2 years since purchase I'm understandibly on my own with that one, although it did have this problem from new but had ignored it. That leaves me with:
Making my own linear supply (with Irving's and John's help above) - had the figure of ~£55 for that option, plus my labour
Purchasing a switched mode replacement unit from Roy ~£60 (but sending it back for a refund or replacement if it glitches)
Purchasing a lower spec (but exactly the same make) unit from China at 27v instead of 32v for ~£40

As for Windows SP etc, I've tried it with a fresh install of Linux running EMC2 and it still glitched.