Saturday, December 19, 2009

The stuff that makes up a PSU

In the previous post, I choose a E-I Core, 300VA, Secondary winding 48Vac. which should have 66.5Vdc 4.5A

I happened to have a 540VA, Double bobbin, 36Vac E-I core tranny collecting dust in my junk box. It says 36V, 15A, So I approach a friend to add a few more coils on the secondary and I now I have a 48Vac, 11.25A tranny for the job.











Now for the Capacitor,

Voltage rating,
It is safe to have a 1.5x safety factor over the expected rated peak,
So, 66.5 x 1.5 = 99.75V
so a 100V rating Cap will do just fine.

Another safe formular to guide us along,
C = (80,000 * IMax. total) / Vdc (microFarad)
C= 80,000*(4*4)/66.5 = 19,248.12 uF

Capacitors don't come in this exact size
This is what I found off the shelve, a 22,000uf, 100Vdc Screw terminal electrolytic capacitor.




Ractifier is easy,
minimum Voltage rating is 100V, minimum current rating is 4x4x1.5=24Amp but we know from the tranny selection 2/3 of that would be enough so 2/3 of 24 is 16Amp

I got this KBPS2504,250V & 25A. metal casing which is good for heat dissipation. when I mount it to any metal plate.


















Next, is Wire selection, We know the motor rating is 4A max, but nominal operating current will be much less. Anyway,  14 gauge AWG wires will do 4amp nicely & since they are easy to get I used some 8Awg (easily 15Amp) speaker cables for the job. all I need now is some crimping pins, some soldering work....


A quick wiring work yielded this


Monday, December 7, 2009

Value Engineering the Stepper Motor PSU

The word "DESIGN" had been over rated & over used... Everyone in the advertisement design something... I prefer to use "SELECTION".  e.g. select a few different color clothing & you have a in-store fashion designer... do you "design" a 200hp engine for your car or you select? Do you select chopstick over fork & Knife or design... Can anyone claim the credit of designing a wheel? but we keep seeing this " we design of the wheel to xxxx, yyyy......."

Enough of my ranting, lets get back to the Stepper motor Selection.

Like everything else, we must know what we need before we can conduct a proper selection.

Stepper motor system consist of a stepper motor and a Stepper motor driver or amplifier.

Stepper motors takes in high current pulses which the motor driver made by chopping a DC current with respect to the instruction from the Brain. So we need to prepare a DC power supply for the Stepper motor system.

We starts with the Voltage rating,,

There is a straight forward & safe formular commonly used in the industry,
V=32 x SQRT(Coil Inductance in mH)
you can go higher but just watch out for the motor temperature.

EG,
My coil is 3.5mH
Vdc=60V

Secondary Voltage of the Transformer
Vsec=(60V+1.4V(voltage loss of rectifier))/sqrt(2)=43.4V
common transformer off the shelf are, 6V, 9V, 12V, 24V, 36V, 48V.
So, 48V is my choice. this will give
48xsqrt(2) -1.4=66Vdc#


Current rating
Most will follow the convensional wisedom and add up all the max.current rating of the motors & call that the PSU's current rating.... Nothing wrong when its a small system with total 6 Amp of current, but with a full size machine, the motor max rating of each motor can be 7~8 Amps... if there are 4 motors, the DC is 50V, that will require a 1400VA~1600VA about 2hp!!! That will be huge, heavy & expensive!

One must understand that we normally don't use up all the power the motor can do, i.e. the rated power... the motor will only produce "enough" power to move whatever they we designed to do, so it is all too common to see motor rated for 3kw only work 0.5kw with plenty of headroom.

With that in mind, lets do some "value engineering",
We know
we will never run the motor to the max limit because its a bad design practice. we know all the motors don't run at the same time...
Now we need to determine how much current the motor need to move the burden it was entrusted with. again there are more then one way to find the number,
By mathematics model, culculate the weight, inertia, moment... etc of the overall mechanism & find out the torque and hence the power required... I always keep this option last... even if I can, why should I go throught the whole trouble?
By experiment, build the machine, measure the torque required, this is always a good option, but I need to build the machine first....
Empirically, we can measure the current drawn by motors in similar machines.

I went for the empirical method, many reported to run on 300VA without risk of over heating and burning transformers, Even though they have a different voltage rating from mine, 300VA is the figure I need to know.

VA is a very close equivalent to Watt, VA is derive from multiplying the Voltage and the Current, this current is the resultant current and the current of W is the reactance current, but they are very close in number in this case.


Regulated or unregulated Power supply,
Again, common wisdom will pick regulated power supply, but really it is the worst choice for this application.

The nature of the stepper motor operation is such, when stop, they draw near zero current and when they move, they need current immediately or risk loosing steps,

Regulators are not famous for fast response, to ensure they meet the motor demand, they have to have the full power ready all the time, but the machines hardly use up the the max as we know by now, that extra power will turn into heat and wasted...

As for Unregulated power supply, they only give when the load ask and it does have a capacitor to act as a ripple filter & double as a reservoir.

SO since SMPS is normally regulated & the unregulated one are not good in drastic load demand, it is ruled out.

Transformers
There are few types of transformer core, The C-core, R-core, Toroidal & E-I core.
C-core & R-core are not as commonly available as the used to be and that leaves us with Toroidal and E-I core.
Toroidal Core is a more efficient transformer, but it is its efficiency that became its weakness in this application.
Toroidal response to suddent load demand extremely well, so well that it will burn itself when responding.
E-I core is less efficient magnetically, but because of this deficiency,  the hesitation acts as a buffer to protectects the transformers from burning its coil.

So, there you have it,
My best package selection is
Transformer :- 300VA E-I core transformer with a 48Vac secondary voltage
Rectifier :- Bridge rectifier with metal casing, rated over 100V & 25 amp
Capacitor :- 22,000uf @ 100V Capacitor based power supply.

This also turn out to be the cheapest & the least technological advance combination.

Why The Stepper Motor

We have to look back to the type of control system that we select.

Two main types of control system, Open-Loop & Close-Loop.
Open-Loop control:-
The Brain send an instruction to the Muscle and expect the instruction to be carried out perfectly. and never bother to go back to check if the job had benn done properly as told.
Close-Loop Control:-
Commonly named Servo-System. The Brain will send instruction to the Muscle, after completing the instruction, by using encoders the Brain will cross check if its been done correctly,  if there is error, the brain will instruct the muscle to make the correction/adjustmet, & repeat the cross-checking until the brain feels happy.

Another advantage of a Servo system is they can move much faster then steppers.

The first reaction for most will be to use an close-loop system, error correction, faster speed... simply because that is how a healthy person will think. BUT after a quick search, one will learn that a close loop system will cost an arm & leg.... Not willing to hurt the pocket & further complexity, one normally settles for Open-Loop System...

Anyway, most CNC router employ a stepper system as their muscle and they had been proven competent mostly.

A compromise must be made, Generally,
  1. One must not skim on specification of the motor, such as power & torque.
  2. Eliminate or minimise backlash in the system.
  3. One must tune the machine to ensure the motor doesn't
    •  loose step, i.e. motor turn but the machine doesn't move. The cause are generally asking the motor to perform acceration which the motor torque are not sufficient to achieve, mechanical friction, Load of machine too heavy.. etc.
    • Backlash, this is the term to describe the "free-play" between the to & fro motion, one can introduce mechanical solution to minimise the error or use software to compensate.
    • Electronic inteference, one must ensure the instruction signals are transmitted uncorupted by external noise such as EMI, RFI... etc.

There are no free lunch! Stepper motors system is generally a fraction of the Servo-system, so more brain-juice & body sweat is required to compansate the situation. BTW, servo system do have their unique sets of headache to tackle... but that is another story for another article...

When looking at the Stepper motor specs sheet these are the things to look
  • number of phase, the modern steppers are normally hybrid 2-phase.
  • number of wires,
    • 4 wires means 2-coils,
    • 6 wires means 2-coils with choice of Bipolar in series or uni-polar (half coils)
    • 8 wires means 4 coils with choice of Bipolar inseries, Half coils or parallel half coils.
  • Coil inductance of each coil. Lc
  • Torque.
  • Max. Current rating of each coil.
Stepper motor normally runs over 10 times the rated Voltage, so the voltage rating isn't important. To find the actual motor Voltage rating, here is a simplified and safe estimate.

Stepper motor rated DC voltage = 32 x sqareroot(Lc)
where, LC is in mH.

Actually, if the motor doesn't heat up too much, one can go for higher Voltage.

Don't ask me why as the answer will come in a few pages or tech ladden write-up which I am too lazy to do.

Generally,
  • Higher the V, we can get higher speed from the motor, if high speed is a necessary, seek out ahigh coil inductance motor.
  • Higher the A, we can get higher torque from the motor, check out the coil rating.
  • The limiting factor is always the heat during operation, IMHO it is always desirable to have as low a Coil Resistance no matter what...
  • Sufficient Torque, too little can't do the job, but too much doesn't always better. just be rational.

Saturday, December 5, 2009

I/O ??? LPPT#1 ??? Parallel Port??

Lets talk about how the PC communicate with the muscle.

In natural language, The PC is the brain and the stepper motor system is the muscle.

In this specific case, the Intel D945GCLF mobo, is the PC talk to the CNC machine?

To simplify the analogy, lets leave the EMC2 software system, the mechanical structure, mechanism, electrical ...etc out for the moment.

The PC, has a choice to send and receive signals via serial port, USB and parallel port. with EMC2, the choice is the parallel port.

Traditionally, the parallel port is used as the printer port, there are 25 pins which are arranged as per the table attched, can do 8 bi-directional ports, 4 output ports and 5 input ports.

The simplest way to connect the machine & the parallel port is directly via a cable. BUT because the signal strength from the parallel port is not strong, interfering noise can have its way with the signal & the corrupted signal my be of no meaningful use. or if the receiving end is passive or require some "drive" to work properly.
since my Stepper Motot Driver/Amplifier requires about 15mA to function properly, Hence, a buffer stage is used, normally this is made into a separate PCB which are called Break-Out Board or BOB.
I use a PMDX-122 board which I was mislead into buying. You can find plenty of board at half or less price with equivalent of better specifications. Or maybe DIY one for yourself for less the USD10.

Wednesday, November 18, 2009

The Atom Mobo is Alive!

The motion constrol system requires a PC to work.... obvious isn't it...

For EMC2, we can use Pentium 4 with 512Mb or more. I had a free P3 donated. but it Ubuntu didn't like it... An used P4 of the correct spec will set me back ~RM400, It is the most economical choice but I have a soft spot for the Intel Atom chip...

Purchased a D945GLF box. Its contained  mobo + the N240 processor at RM215. I need to have a ATX PSU, a 2Mb DDRII RAM, and use salvaged LCD monitor, keyboard mouse,  HDD, CD drive.

Plug in all the necessary connectors, slot in the RAM, power up... then all hell broke loose for the next 3 day trying to figure out what went wrong.... after swapping a new DDRII RAM, IDE cable, BIOS battery, keyboard, mouse, CD drive and even another HDD. Eventually, it was concluded that the mobo is faulty and while waiting for replacement, (warranty claim), I got hold of the Dual core Atom board D945GLF2 as they only have this in stock...

Back to me workbench, slot in the RAM, plug in all neccessary connector, set the bios, insert the EMC live-CD & we have this


Ran the latency Test, 15,801ns max jitter is  just what I hope for.



Here is the screenshot (literally) of EMC2




Lessons learnt? Yes, Murphy Law never fails!!! ....

Apart from that, check your PSU pinout!!!

The D945GLF requires  2x10 +2x2 power connectors.

The D945GLF2 requires  2x12 + 2x2 power connectors

Getting the right PSU at the right price burnt up 2~3weeks of my time....

So you are warned.

Thursday, November 12, 2009

Featuring EMC2

While settling back in my home town, I found time to evaluate the CNC Controller bits.

After pain staking search and review; I end up PC based CNC software controller
1) Mach3 which runs on Window
2) EMC2 on Linux OS

As I wish to have the flexibility to have the last say on the hardware specifications

I eventually ended with EMC2 which is free open source program. Not that I'm cheap, Mach3 is affordable ~USD100, & you can have a trial version for unlimited period for free, it has all the bell and whistles that any top rank controller programs would have. Moreover, help forums and supporting community are strong too.

It is the believed that Open source Linux OS is practically immune to hackers & deathly viruses which I fear most.

About the software

  • EMC (the Enhanced Machine Control) is a software system for computer control of machine tools such as milling machines and lathes.
  • EMC is free software with open source code. Current versions of EMC are entirely licensed under the GNU General Public License and Lesser GNU General Public License (GPL and LGPL)
  • EMC provides:
    • a graphical user interface (actually several interfaces to chose from)
    • an interpreter for "G-code" (the RS-274 machine tool programming language)
    • a realtime motion planning system with look-ahead
    • operation of low-level machine electronics such as sensors and motor drives
    • an easy to use "breadboard" layer for quickly creating a unique configuration for your machine
    • a software PLC programmable with ladder diagrams
    • easy installation with .deb packages or a Live-CD
It does not provide drawing (CAD - Computer Aided Design) or G-code generation from the drawing (CAM - Computer Automated Manufacturing) functions.
  • It can simultaneously move up to 9 axes and supports a variety of interfaces.
  • The control can operate true servos (analog or PWM) with the feedback loop closed by the EMC software at the computer, or open loop with "step-servos" or stepper motors.
  • Motion control features include: cutter radius and length compensation, path deviation limited to a specified tolerance, lathe threading, synchronized axis motion, adaptive feedrate, operator feed override, and constant velocity control.
  • Support for non-Cartesian motion systems is provided via custom kinematics modules. Available architectures include hexapods (Stewart platforms and similar concepts) and systems with rotary joints to provide motion such as PUMA or SCARA robots.
  • EMC runs on Linux using real time extensions. Support currently exists for version 2.4 and 2.6 Linux kernels with real time extensions applied by RT-Linux or RTAI patches.

EMC2 is precompiled with Ubuntu 8.04 LTS (long term support) versions for ease of installation and longevity.

EMC2 has a few GUIS, Namely, AXIS, TkEmc, HALUI. They even has a Ladder Logic program call CLASSICLADDER. For now, I'll concentrate mainly on AXIS which is an ongoing development.

Screen shoots




Thursday, September 10, 2009

Balik Kampung

Its been nearly a decade since I arrived in Sandakan; Now, it is my time to balik kampung.

I'd withness the transformation from a quiet town with empty road after 7pm to traffic congestion till 10.30pm. From RM1.50 plate of economic mixed rice c/w free chinese tea at the wet market to today's RM4.50++ bowl of kon-lau-man at any kopitiam & you have to pay for you sky juice. The resurrection effort of the old town center.

This is a town which will grow on you; With sparse population, vast space with abundance of fresh clean air are there for your taking; Spoiled by the wealth of natural resources this state possess, one don't need to live a stressful life here.

Slowly but surely, this place had transformed from a timber cowbow town to a small oil palm city, with tourism industry creeping in unannounced.

I'm going to miss the stress-free lifestyle & fantastic seafood Sandakan had indulged me lavishly. Most of all, the sincere and friendly locals that tool me in as a part of their community.