Hello Guest it is March 29, 2024, 05:02:39 AM

Author Topic: Mach2 inconsistent motor drive pulses  (Read 4402 times)

0 Members and 1 Guest are viewing this topic.

Mach2 inconsistent motor drive pulses
« on: October 14, 2008, 10:09:24 PM »
Hey, this is a technical question, sorry to post in "General Mach Discussion" but I didn't see a technical section.

I am having problems getting clean pulses at higher step rates out of the demo version of Mach2. I've attached the scope trace at the bottom of the post. It's the green trace.

I originally tried Mach on a laptop. I could spin the motors, but it didn't really work, and after some digging I found the "OCXDriverTest" and the screen that shows your time delays looked like a square pulse with a bunch of HF noise on it. Not good, I assumed. So I put Mach on a desktop machine with a fresh XP install. OCXDriverTest looked great. In my reading I found that parallel port voltage levels aren't that great, so I bought a simple opto isolator board. I hooked it up and my motor drives, and started to test but got some strange results. The motor was only turning one way, and actuating the Y axis made the Z axis move. Finally figured out that the isolator board I bought had too small value of resistors driving the coupling chips, and it trashed the parallel port driver IC on that PC. The pins were all mixed up and not smooth.

So. Back to the drawing board. I made my own opto-isolator board, with SAFE current levels and added some circuitry for charge pump, interlocks, etc. I hooked it up to the motor drives (and a different PC) and tried running Mach2. Everything looks pretty good. The motors turn slow, have good torque, the inputs work. Steps are a little rough and the motor has a few nasty resonant peaks, but it works. However, the motors have no torque if they are spinning any more than one RPS. I can stop the bare shaft with my fingers. They stall almost immediately. So I hook up the diagnostic equipment (scope, DVM, current clamp) and watch the signals. The motors look great down low, but when things speed up the current flat lines. They simply have too much reactance to accept current.

If you're still reading, here are some background details, since at this point everyone is questioning my home-built stuff: The motor drives I built. They are PIC controlled, 8 step microstep, based on the LMD18245 full-bridge chopper motor driver from National. They work. I've tested them as far as I can, and they perform great. I've verified the waveforms for the DAC, the motor output, the step input, etc.
The optocoupler is my design based on 74LS244 buffer ICs and TLP2631 Optocoupler ICs. I've bench tested it and tested it with Mach. It works.
I had been powering the motors with a 24V power supply, and after some more digging I found that I could potentially (no pun intended) get more current into the motors by raising the voltage. So I tried a 48V power supply. Since the absolute maximum voltage of the driver IC is 60V and the back-EMF of my old setup at worst was about 5V, I also built a voltage regulator to keep that expensive driver alive. It's a zener diode/ FET design that clamps the voltage at 56V. I put in a big capacitor for good measure to try and prevent the current surges from upsetting the voltage.

So i tried that. The voltage is now rock-steady at 48V. Doesn't matter where I try and run it. However the motor doesn't care. At this point I've about proven the motors junk. I bought them new from an internet surplus seller. NEMA 23, 2.3A, pretty decent specs. But they won't run. They are 6 wire, and I've tried running them with one half of each coil connected and bipolar series connected.

So I tried actual bipolar motors from AutomationDirect. They came today, and I hooked them up and started up Mach2. Finally! A motor that will actually take current. Still nice flat line 48V, and the current clamp shows sinusoidal current flow. great. I started at a few RPM and worked up, but even though I have current at higher speeds, the motors are still stalling at a couple RPS, or about 60% of Mach's rated maximum pulse rate. It's going to take an awful long time to move my machine with a 10TPI Acme screw at that rate.

I have messed with the motor tuning screen quite a bit, bit still no success. I have found little gain from adjusting pulse duration, so I leave it at 5us.

Again I break out the scope. I had noticed before that I couldn't trigger off of the step input pulses very well, but it wasn't the worst of my worries so I let it go. Today I figured it out. The step pulses at lower speeds (<50% of Mach max pulse rate) are clean and uniform. The motor likes that. But when I run higher than 50%, the pulses start to lose their timing. I'm getting pulses bunched up together, and sometimes gaps. I assume that this is causing my motors to stall at higher speeds. I'm not sure what to do about it either. I've run the OCXDriverTest again, and the screen is nice and smooth. This is the third machine I've tried, and the fastest computer I have. (Athlon 64 3200+ 2GB RAM) My next step is to program my ATMega128 development board with a PWM routine and test it that way. But before I go to that trouble and continue to beat my head against this brick wall, can anyone make any suggestions?

Thanks if you read all this. Here's the trace.

 
« Last Edit: October 14, 2008, 10:16:27 PM by imsolidstate »
Re: Mach2 inconsistent motor drive pulses
« Reply #1 on: October 14, 2008, 10:46:02 PM »
You don't say what the CPU speed of the PC is.  Or how much memory it has.  That is critical.  If it's a dog, you won't get good performance.

Have you gone through and turned off EVERYTHING that doesn't need to be there?  Especially any power management features?  There is a document on the ArtSoft website that describes the steps for optimizing the windows install for Mach.  You need to pare the system to the bones - you should have only about a dozen processes running.

Regards,
Ray L.
Regards,
Ray L.

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Mach2 inconsistent motor drive pulses
« Reply #2 on: October 14, 2008, 11:21:58 PM »
imsolidstate,
Have an admiration for your endeavor / challenge of designing or building your owne drive for use with Mach.
I just feel compelled to ask a question since Mach past and present has proven to work for so manny users.

Why would you try and build a drive, when so many time proven inexpensive drives that work without a hickup are
available?
It's such a critical component of the CNC system.

RICH

Offline da21

*
  •  87 87
    • View Profile
    • M-Machine
Re: Mach2 inconsistent motor drive pulses
« Reply #3 on: October 15, 2008, 04:07:29 AM »
whats the difference in the trace before and after the Opto ?
you may need faster opto's etc ,

what current do you have available from your power supply

see if you can trace through the signal from the parrell port and see if it gets mixed up along the way either by the opto's which would be my first suspect or the buffer ,

have u got pullups either side of your buffer chip ?
if you have your circuit available post it and i'll take a look

Dave

Re: Mach2 inconsistent motor drive pulses
« Reply #4 on: October 15, 2008, 03:51:11 PM »
Thanks for the replies everybody.

  HimyKabibble: Actually, I did say what the CPU speed was. And how much memory my machine has. I've tested on two machines with greater than 2GHZ clock speeds with 4GB of dual channel fast RAM.

  RICH: I hear ya. But I don't have much money, and I do have a bunch of electronic stuff lying around that I can use. Plus, I like making my own stuff because it does exactly what I want it to do.

  da21: I haven't compared pulses from the output of the parallel port to the output of my isolator. I didn't think it was necessary since the 2631 is a 10MB logic chip with rise and fall times of 60ns typical. The 74ls244 is 6ns. That's alot faster than Mach runs at. But you are right, there could be a problem there so I will check it out.

I have a 48VDC, 12.5A power supply. The motors are rated at 2.8A. I'm running them at 2.4A right now.

I'm not using pullups on the buffer ICs, just on the optocouplers. I went without pullups on the buffer input to keep the current draw from the parallel port to the absolute minimum. The 74ls244 is only supposed to draw uA. But I guess I assumed that the parallel port outputs would be pulled up internally. My mistake.
I didn't use pullups on the buffer outputs because the chip is supposed to be a balanced current source/ sink. The internal circuitry either turns on a transistor to ground or a darlington to Vcc. I guess again I assumed that one of those would always be on. However, judging from the scope trace, I don't think the buffer output is sufferring any tri-state issues because it would have enough current to turn on the couplers and I'd have alot bigger pulses. I'd post the schematic but it's pretty big.

Thanks for the ideas. In the near future I will be trying to run Mach on a stripped down fresh install of XP, but right now I don't have a computer that I can use for that. I have the case but none of the guts yet. I hope that will fix my problem.