Toner Transfer PCB creation - Attempt 1

by Ivan Hamilton 8/21/2008 5:30:00 PM

A little while ago I printed a PCB design on my laser printer to some ink-jet paper I had, and ironed that onto some blank PCB. After that, let it soak in water, and lightly brushed the paper away.

This is my first attempt at home brew PCB creation using the toner transfer method, and the results (while not perfect) are not bad for a first attempt.

There's two parts to this process where I need some more practice: transfer & etching.

Transfer

I actually did the transfer twice. The first time, a number of the tracks didn't fuse and lifted. I used more pressure and a longer duration the second time, and the result was much better.

One edge was a little patchy, and I'd say my lack of even ironing contributed to this. I though the layout was more centered (see the large gap at the top), and didn't put effort right up to those edges.


Board after transfer

I touched up a few of the patchy areas with a pen (which was a little large nibbed).

Etching

Not wanting to make up a large batch of etchant, I grabbed a plastic container just large enough for the board and put in ammonium persulfate crystals. The instructions on my etchant container said 75°C, so I boiled the jug and took it downstairs.

The etching started well, but pretty much came to a stop with a few blobs of copper still remaining. This is going to be due to one of two things: not strong enough etchant or not enough heat.


The etching process (edges gone, 3, 18 & 24 min later)

So, I need to work out a more accurate way to measure out the ammonium persulfate crystals (some small scales), and a way to keep the etchant heated (maybe a hot plate or oven).

Final Results

After giving the board a scrub to remove the toner this is the final result.

 
Final result

Some of the tracks appear to have been etched from under the toner (they looked good until the toner was removed). This is probably because I left it in the etchant for nearly 30 minutes. It should have only taken about 10 minutes. There were a few areas where the toner transfer wasn't the best, and a more even ironing should help this.

This board is beyond repair, as the tracks on the far left are all broken and they're too fine to repair. This is a learning process, so I'll do another one and see how it goes.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Electronics

DIY Servo Controller - The Plan

by Ivan Hamilton 6/24/2008 2:57:00 PM

Accurately controlling the position of rotating elements is the heart of a motion controlled system. Often stepper motors are called upon to complete this task. Although cheap and plentiful at lower power levels, more powerful versions are expensive and difficult to source.

Stepper motors have limitations:

  • Constant-power device (power = angular velocity x torque). As motor speed increases, torque decreases. 
  • More vibration than other motor types, as the discrete step tends to snap the rotor from one position to another.
  • Generally must be over engineered, so that there is no possibility that the motor will lose steps.

Another device is the servo motor. This combines a standard electric motor and position feedback sensor with a controlling circuit. The electric motor can be DC (brushed) or AC (brush-less).

At the hobby level Gecko (US$114) drives appear to be the norm. The Gecko appears to be a analogue unit with gain & dampening trim-pots. A test-point reflecting the error (as voltage) is available to assist in tuning with an oscilloscope.

There are a couple of fundamental components to these servo drives:

  • Actual position conditioning & decoding
  • Desired position conditioning & decoding
  • Error calculation (from actual-desired)
  • Error filtering (PID calculation)
  • PWM generation
  • H-Bridge

Actual position conditioning & decoding
Function:
This is the feedback sensor to determine the current position. They are built in to industrial servo motors, and industrial external sensors cost many $100s.
Hobby Option: A low cost optical encoder can be had for US$20, and with a little effort these can be fitted to a standard permanent magnet DC motor. The output from these incremental rotary encoders, is "quadrature" encoded (two output wave forms 90 degrees out of phase). Decode quadrature input with a microcontroller.

Desired position conditioning & decoding
Function:
The servo controller must be instructed of the desired position.
Hobby Option: Derived from stepper motors, the defacto standard is STEP & DIRECTION signals. A "step" line is pulsed, and each pulse represents an increment or decrement depending on the state of the "direction" line. Software such as EMC2 & Mach3 can generate these signals.  Decode quadrature input with a microcontroller.

Error calculation (from actual-desired)
Function: From the actual and desired position, an error level must be derived. This can be done via analogue, or digital means.
Hobby Option: Calculate with a microcontroller.

Error filtering (PID calculation)
Function:
From the error calculate an output level.
Hobby Option: Calculate with a microcontroller.

PWM generation
Function:
From processed error calculate an output level.
Hobby Option: Generate with a microcontroller. This is a logic level PWM signal (or signals) that control the H-bridge.

H-bridge
Function:
Produce a high power PWM DC signal.
Hobby Option: The H-bridge needs to match the motor. A simple 100mA unit can be constructed with BC548 NPN and BC558 PNP transistors. At 160A the 16 MOSFET Open Source Motor Controller project is the other extreme. Most setups will lie somewhere in between.

Motor
Function:
Converts electric power to motion.
Hobby Option: DC Brush motors provide the best performance/price. Genuine high power, low inertia, industrial servo motors cost many $100s. Existing automotive, electric scooter, & general purpose motors can be used quite effectively.

The most variable component is the motor. Different uses will require different motors, and different motors have different drive requirements. A number of DIY controllers, Elm Chan Servo, UHU Servo, Dspic-Servo, were all designed for the specific purposes of their creator, and integrate the H-bridge into the controller PCB. A modular approach, with a separate controller & H-bridge would be much more flexible.

I've created a prototype controller (PCB & firmware), and I'm using an off-the-shelf H-bridge.

This is my plan.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CNC | Electronics

DIY Servo Controller - Four Axis Tangential Test

by Ivan Hamilton 5/19/2008 2:57:00 PM

I've setup Mach3 to drive the 4th axis tangential to the XY plane. This feature is used by vinyl cutters and such where the tool's orientation must follow the direction of travel. This includes lifting the tool before large changes (>45°), and lowering it before continuing.

This setup allows me to test my 4 axis servo controller in a "real world" situation. The motion appears a little jerky, but this appears to be Mach3 coming to a full stop before changing the 4th axis' direction (The RoadRunner test is not good for this since it's composed of lines and not arcs).

I've started making the mounts for the motors, but there is more tuning and testing to be done before final mounting of these motors on the mill.

When I'd picked up the motors, they had some heft. So out of interest, I put those motors on the scales... a total of 3kW (4HP) and 16.5kg (more than airline carry-on allowance).

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CNC | Electronics | Mechanics

Tuning my PID controller 2

by Ivan Hamilton 5/10/2008 10:44:00 PM

I've mentioned previously that I think it's beyond me to visually judge the performance of the PID tuning values in use in my servo controller.

I had created a simple program to test the response, but wasn't happy with the point to point style test it was carrying out. It's more important for a CNC machine to follow curves closely, than have outright movement speed.

To fix this, I've added a feature to the microcontroller, a sine wave test. The test was added to the controller, because for a good test, a position update needs to be present every time the PID loop recalculates. By placing the sine wave path generation in the controller, a new movement value is present every single PID update. I couldn't achieve this sort of high performance timing by sending updates down a serial line.

Also, the standard point to point test produces massive errors when the set-point jumps, masking the fine detail of an "error" plot. I've added it now (on it's own axis), and it's very helpful in seeing exact levels of error (the large scale of the movement would otherwise hide this relatively small error). 

 
Rotate 1 revolution forward and back in 1 second

 
Rotate 1 revolution forward and back in 5 seconds

In the above images you can see the reduction in error during a slower test (from +/-10 to +/-3). On the slower test, that's within 0.9 degrees.

I've also included a "steady state" option. This doesn't instruct the controller to make any movement, but it does record and display it. This lets you see the response to an external disturbance on the servo (the handy shifter!).

Armed with this new information... I still haven't gone back and re-tuned the PID values.

Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | CNC | Electronics

Tuning my PID controller

by Ivan Hamilton 5/9/2008 4:21:00 PM

The nice thing about making your own PID controller, is that it's easily modified to add extra features. The nice thing about having PC software development skills, is that it's easy to whip up a small program for a particular task.

I've mentioned on a number of occasions, that I hadn't yet tuned the PID settings in my controller. I didn't want to do this because I could spend all day tinkering with values without being able to accurately judge the exact effect. What I needed was a way to monitor the servo response.

It took less than a dozen extra lines of microcontroller code, and a couple of dozen lines of C# (WinForms) to make a GUI application to test and monitor the servo. Once I had this, I could change values and with a mouse-click see the results. This made it very quick to tune by trial and error.


Step response before tuning


Step response after tuning

The best "simple" explanation I've heard for these values are:

  • P - Proportional - Spring - The greater the error, the more correction applied
  • I - Integral - Accuracy - The longer the error, the more correction applied
  • D - Derivative - Dampening - The more the error changes, the more correction applied

The best "simple" tuning method I've heard is:

  1. Set P, I & D gain values to 0.
  2. Increase P until it becomes unstable (post-step oscillations don't fade).
  3. Halve P.
  4. Increase D until overshoot is removed.
  5. Increase I until it settles quickly enough when disturbed

I used this method and it appears to work well, but this was a simple test on an unloaded motor. It will be interesting to try this once fitted to a more complicated system.

There is an issue with the current test... this a step-response scenario. That's great for a system which needs to move from A to point B as quick as possible. But in a CNC machine, it doesn't just move from one point to another. The motion controller (e.g. Mach3 or EMC2) will produce "smooth" motion with a constant stream of position updates. What is more important, is that the servo accurately follows this acceleration, than achieve high outright point to point speed.

In the future, I think I'll need to add a "Curve Follower" tuning option. Instead of jumping from point to point, this will drive the servo as if it was tracing a circle (a sine wave pattern).

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | CNC | Electronics

Servo Controller - Four Motors

by Ivan Hamilton 5/8/2008 1:35:00 PM

After a bit of a late night, I've connect four motors to my servo controller. I wanted to clean up the layout a little, and I think for a prototype, it's pretty neat.

I had recently finished fitting encoders to my other motors, and thought it was time to test the limits of the controller.

I had always designed my controller to handle four servos, but didn't have the hardware to test it. Armed with the extra hardware, I had the opportunity to see how well my theory would work in practise. Once again, I was very happy with myself.

There's a couple of things the keen-eyed will notice.

  • The motors don't always turn at the same speed - The test here is limited by the power delivered to the motors. It's set to output 33% max. Different motors will have slightly different performance, especially when moving in different directions. The motors I'm using slightly prefer one direction to the other.
  • The motors overshoot - the PID parameters aren't tuned yet.
  • The motors sometimes hunt - it's the cogging of the unloaded motor & the PID parameters aren't tuned yet.

This test was just sending serial set-point commands. The controller can also be able to decode STEP+DIR input from Mach3 and such (I haven't fully wired up the break out board yet).

I've put it off long enough, I think I'll have to work on the PID tuning...

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CNC | Electronics

A closer look at my 2 axis servo controller

by Ivan Hamilton 5/6/2008 3:44:00 PM

For anyone interested, I've taken a closer look at my 2 motor setup.

(I've also decided to start giving more relevant post titles...)

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CNC | Electronics

'Cause one's not enough; I ain't a wimp, I'm a pimp.

by Ivan Hamilton 5/4/2008 3:59:00 PM

With another motor available for testing, I decided to configure my controller to run two motors. I also mounted the motors, so they wouldn't roll under acceleration and fall on the floor (again).

Ooh... two motors. Yeah... my servo controller can run more than a single servo. The Pololu driver board I have has two H-bridges, so with 1 controller board and 1 driver board, I can control two motors.

I also fixed a bug in the quadrature decoding routines that was causing incorrect amounts of movement to be calculated. To see if something had changed, I was incorrectly comparing the current raw quadrature state against the previous decoded state. Whoops!
With my 1,200 step encoder, now moving 1,200 steps now gives one clean rotation. Do 120,000 steps and you get 100 rotations, stopping at the exact same spot.

The PID parameters still aren't tuned. Hence the overshoot and slow final approach. I'm yet to even start working out a simple reliable tuning method. I don't want to hand tune the free-standing motors through trial and error, only to do it again once they're fitted.

Much more testing still needed...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CNC | Electronics | Mechanics

Now I'm counting every minute, Every single minute.

by Ivan Hamilton 5/2/2008 4:44:00 PM

I'd mentioned previously about my efforts to fit a rotary encoder to my DC motor. It was my first attempt at this, and also my first attempt at any real machining with my mill.

I've since done this on another motor (or three), and with the benefit of hindsight (and some measuring equipment), it was much easier, quicker and less painful. I thought I'd detail my experiences here, for the benefit or anyone trying this themselves.

Thanks must go to Richard J. Kinch for his original article.

This is your single shaft DC motor.
We want to fit an encoder (and the extra shaft it needs).

  You'll need a nice flat spot to mount the encoder.
This motor has nice circular raised area, but there is some logo & writing in the way.
 

Most motors have 2 longitudinal bolts. Remove these and get ready to take the end plate off.

HELPFUL HINT!! Be ready for parts to fly everywhere. The brushes are spring loaded, and once free of the commutator, they will want to spring out.

After removing this, you'll see the end of the shaft that you want to extend.

Notice the counter sunk hole in the end? This is where the shaft is held when it was initially made. This is what will guide our new hole.

 

You're going to put a hole in the end plate for the new extension shaft to exit.

Find the center of the bearing mount within the end plate.

HELPFUL HINT!! Don't guess the center position. Find the center with accurate measuring tools.

 

Put the hole in the end plate.

I went for 1mm larger (5mm) than my shaft (4mm).

 

The mounting face needs a clean up.

Mount the end plate, and prepare to mill.

  After a quick face mill, you should have a lovely clean mounting area.
 

Simply slipping the end plate on (with the springs removed and brushes just tucked out of the way), makes for a good sanity check.

You should see the shaft's center hole neatly in the middle of your new hole.

 

To drill the hole in the shaft, we're going to rotate the shaft and hold the drill bit stationary. This will cause a "self-centering" action, and help keep our hole straight and centered.

I used the motor's own power (you'll need the motor reassembled to do this).

HELPFUL HINT!! During the conversion you'll need to reassemble the motor (to a working state) a couple of times (you'll might even convert a couple of similar motors). Do yourself a favor and find a quick way to refit the end plate. I bent up a few paper clips to make brush retainers, which made fitting the end plate a breeze. Find a good way at the start, and you'll save lots of time and frustration.

 

Center your drill bit over the motor. With the motor stationary, drop the bit in and see if it bends toward the shaft's center hole. Adjust until you're in the center.

HELPFUL HINT!! Check the rotation direction of the motor. Made sure it's spinning anti-clockwise from the bit's perspective.

HELPFUL HINT!! Use a good quality sharp bit. It will be easier on the motor, and make the job quicker.

HELPFUL HINT!! Use a variable supply so you can adjust the motor speed. My first attempt was with a fixed supply at the motor's rated voltage. The very high speed simply cooked the drill bit.

Drill with short "pecks", as there is limited area between the shaft, bearing and end plate, and you'll want to bring out as much swarf as possible.

HELPFUL HINT!! Use a powerful magnet to help remove swarf. Put the magnet against the bit, or a nail and dunk it in the shaft hole to drag swarf out.

I drilled a hole about 10mm deep into the shaft.

 

With the shaft drilled, clear the swarf out of the motor.

HELPFUL HINT!! When removing the drilled end plate, hold the motor with the drilled end plate on the bottom. This way the swarf will fall out, and not in to your motor. With care (and luck), you won't need to remove the armature to clean out the swarf.

 

HELPFUL HINT!! That strong magnet you used to remove swarf when drilling, can help clean up the end plate afterward.

HELPFUL HINT on the HELPFUL HINT!! A plastic bag over the magnet will make removing the tiny filings from the magnet very easy.

 

Get your extension shaft ready.

If turning your own, made sure you're very accurate. Especially if the encoder wheel is press-fit.

You need to be smaller than the hole you drilled, but not smaller than the bore needed for the encoder.

I found that at 0.05mm above or below 4.0mm, the shaft would jam in the drilled hole, or be too loose for push-on encoder.

 

Clean the new shaft & hole. Put a drop of super-glue in the shaft's drilled hole and insert the shaft.

If a little glue doesn't ooze out, remove the shaft, and add another drop.

Refit the end plate (brushes not needed) to help judge the concentricity of the new shaft.

Spin the motor (manually is fine) and watch the new shaft. If it's off center, give it a slight nudge.

Let the glue dry a little (not fully), and re-align the shaft.

Allow the glue to cure.

 

Center the encoder's PCB.

The US Digital encoders have a placement tool, a tube which has an internal diameter equal to the shaft size. The tool's ends have a slight taper to center the board.

  Mark the centers of the screw holes on the end plate with a punch.
 

Drill and tap the mounting holes.

In my case, I drilled 2mm holes and tapped in M2.5 threads.

  Mount the base & PCB. Center with the centering tool.
  Insert and tighten the screws, and then remove the centering tool.
 

Mount the encoder wheel.

My encoders are the E4P push-on type. The US Digital encoders have a tool to push the encoder wheel on just the right amount. (The tool stops on the base tabs)

 

The encoder wheel is now fitted. Time for a final inspection.

My shaft was a little short in this case, but the wheel doesn't carry any load, and has a good grip on over most of its length.

 

Install the top cover, and you're done.

E4P - US Digital E4P encoder (US$20)
300 - cycles per revolution - 1200 pulses
157 - 0.157" (4mm) shaft
M - metric screws

 

 

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CNC | Electronics | Mechanics

If you're on the highway and Road Runner goes beep beep

by Ivan Hamilton 4/29/2008 11:10:00 AM

The servo controller I've been building is meant to interface to a motion generation system. In the hobby CNC world, that's probably Mach3 or EMC2.

Mach3 uses the parallel port to generate signals that describe motion. It's often referred to as DIR+STEP signals. One line is the direction, the second is pulsed for each increment of movement. My servo controller was written to interpret these signals, but I didn't have a parallel port on my "legacy free" desktop to test this. A trip to the PC shop got a 2 Port PCI parallel port card (a Sunix 4018A Multi-I/O Adapter) for $35 (I could get one a few bucks cheaper, but the cheap shop had around 25 people queued at the counter!).

Unfortunately the Sunix card isn't just a "standard" parallel port. It doesn't appear at IO address 0x378 & 0x278 like a "standard" port (these are the addresses set by default in Mach3). Being a Plug & Play card, the IO addresses are assigned by the BIOS/OS. Windows XP's Device Manager shows the addresses the card had acquired.

   

I was hoping that the few ranges it had were still IO compatible with a standard parallel port. I entered 0xC000 as the port address into Mach3, attached the CRO to the port, and jogged the axis. Success!

A couple of wires were added from the parallel port break out board to my controller, and a test was in order.

The background is the standard Mach3 screen. Lower left is the motor. Lower right is the serial terminal output from my controller. The terminal output is: [0] positional error, desired position, output strengthtemp diag numbers

The error sits at around 30 and peaks at 100. The motor is fitted with a 1200 pulse encoder (Mach3 configured for 0.25"/rev screw), meaning that's 9-30 degrees (0.16-0.55mm) out respectively. That's not bad for a system that's not been tuned properly (at all really - Kp=100, Ki=100, Kd=0).

I've added simple serial command processing to the controller, and you can adjust the PID parameters on the fly now. This will certainly help in getting the final tuning values.

More thorough testing is still needed. I need to push it until it breaks, and see what it can withstand. I also need to do some "quality" PID tuning. But for the moment... I'm a little pleased with myself.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Electronics | Mechanics | CNC

Powered by BlogEngine.NET 1.3.1.30
Original theme by Mads Kristensen

About the author

Name of author Ivan Hamilton
"My inner nerd can beat up your inner nerd."

E-mail me Send mail

Adsense

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent posts

Recent comments

Tags

None

    Entropy

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2010

    Sign in