Yahoo Groups archive

Homebrew PCBs

Index last updated: 2026-04-28 23:05 UTC

Thread

Red Laser Diode Rotating Drum Photo Plotter

Red Laser Diode Rotating Drum Photo Plotter

2006-04-28 by cunningfellow

All,

This is the new thread I have started for details
on the laser plotter I am going to try build.

As stated in the just previous message - I am
aiming at something between these two articles.

http://pico-systems.com/photoplot.html

http://www.bungard.com/seiten/p-filmstar.htm

I am going to be happy with the 1000 dpi the
home built one from pico-systems does.  Finest
tracks I think I can etch are 4 thou anyways.
However 2000 dpi might be a goal to try cope
with the ludicrous pin spacing on some new
leadless metric packages.

So far I have built a text-book 4046 PLL
multiplier. This has been hooked up to a
servo motor I scavanged from something.

Unfortunatly the encoder wheel on the servo
does not have an index mark - so I will have
to scavange another one from somewhere.

The circuit for the PLL also has an Atmel on
board to regulate the speed of the servo
motor via PWM of a FET.

The main connector on the board has the 
following signals

STRT - Input  - Turn Motor On or Off
IDX  - Output - Index mark from encoder
M-OK - Output - Tell host motor at correct speed
SIG  - Output - The un-multiplied encoder signal
CLK  - Output - The Multiplied encoder signal
GND  - In/Out - Tell the host when the PCB was
                left sitting on the ground.
                (OK the last one was a joke)


NOW - to answer Lez with "I am intersted in how
you're going to get the bmp out"

There is going to be another Atmel sitting on
the end of a UART.  You will simply X-Modem a
BMP file to it and like magic it should come
out the laser.

I think this should be easy in assembly laguage
using the IN and POP instructions.

Main_Routine:
     IN     Accumulator_A, XMODEM_Data
     POP    That_Data_Out_The_Laser

As long as I can get that to assemble in AVR
studio the project should be finished tomorrow.

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-28 by ralucas4277

Hmm, missed this post before, yes it's the "like magic bit" that 
needs the algorithm!!

Roger


--- In Homebrew_PCBs@yahoogroups.com, "cunningfellow" 
<andrewm1973@...> wrote:
Show quoted textHide quoted text
>
> 
> NOW - to answer Lez with "I am intersted in how
> you're going to get the bmp out"
> 
> There is going to be another Atmel sitting on
> the end of a UART.  You will simply X-Modem a
> BMP file to it and like magic it should come
> out the laser.
> 
> I think this should be easy in assembly laguage
> using the IN and POP instructions.
> 
> Main_Routine:
>      IN     Accumulator_A, XMODEM_Data
>      POP    That_Data_Out_The_Laser
> 
> As long as I can get that to assemble in AVR
> studio the project should be finished tomorrow.
>

Re: [Homebrew_PCBs] Red Laser Diode Rotating Drum Photo Plotter

2006-04-28 by Jan Kok

On 4/28/06, cunningfellow <andrewm1973@...> wrote:
> All,
>
> This is the new thread I have started for details
> on the laser plotter I am going to try build.
>
> As stated in the just previous message - I am
> aiming at something between these two articles.
>
> http://pico-systems.com/photoplot.html

I like it! :-)

The carriage mechanism from an old inkjet or dot matrix printer might
work for holding the laser diode.

I haven't worked with red-sensitive film, have you?  Green lasers are
available for about $60.  That ought to work with red-insensitive
lithography film (the stuff they used in print shops 30 years ago -
Kodalith?  Even a red laser will expose lithography film if you shine
it right on the film for a few seconds.)

Beware of unstable output power as the laser heats up:
http://www.laserglow.com/images/comparearies.gif (note, it's not clear
whether this is a problem for <5mW laser pointers).

Cheers,
- Jan

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-28 by cunningfellow

> > andrewm wrote:
> > This is the new thread I have started for details
> > on the laser plotter I am going to try build.

<SNIP>
> Jan wrote:
> The carriage mechanism from an old inkjet or dot
> matrix printer might work for holding the laser
> diode.

Yes, I was thinking printers too.  I have a collection
of old inkys and dottys to pull apart.  Something is
still going to have to be done about the 1000 (or)
2000 dpi resolution requirments though.  Line encoders
seem to max out at a few hundred cycles per inch.

Mechanical multiplication by using a rotary encoder
on the end of a large wheel (like in a mouse) might
work.  But at 2000 dpi I still think that sticktion
may be a big as problem as anything else.  Any one
up for some air-bearings :S 


> I haven't worked with red-sensitive film, have you?
> Green lasers are available for about $60.  That ought
> to work with red-insensitive lithography film (the
> stuff they used in print shops 30 years ago -
> Kodalith?  Even a red laser will expose lithography
> film if you shine it right on the film for a few
> seconds.)

Red film is just easier to get AFAICT.  it's what most
the industry uses so is just more available.  Also
unlike blue-ray DVDs - the red wavelength for photo
plotting is not a disadvantage size wise.  So there
does not seems to be a need for industry to shift.

> Beware of unstable output power as the laser heats
> up:
> http://www.laserglow.com/images/comparearies.gif
> (note, it's not clear whether this is a problem for
> <5mW laser pointers).

I am using a 10mW diode - just because it was available.
It is probably only going to be used at sub milliwatt
levels to get enough light for exposure of an 300mm
x 300mm page in 15 minutes.

I don't think that at sub milliwatt levels heating will
be an issue.  Also the contrast of the film is so step
like that it takes a pretty big change in exposre to
make any change in density.

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-29 by cunningfellow

> >andrewm wrote:
> > <SNIP>
> > There is going to be another Atmel sitting on
> > the end of a UART.  You will simply X-Modem a
> > BMP file to it and like magic it should come
> > out the laser.
> > 
> > I think this should be easy in assembly laguage
> > using the IN and POP instructions.
> > 
> > Main_Routine:
> >      IN     Accumulator_A, XMODEM_Data
> >      POP    That_Data_Out_The_Laser
> > 
> > As long as I can get that to assemble in AVR
> > studio the project should be finished tomorrow.

> Roger wrote:
> Hmm, missed this post before, yes it's the "like magic
> bit" that needs the algorithm!!


Damn - AVR Studio would not assemble that code :(

I will have to actually cut and paste some X-Modem CRC code
from my data loggers I build.

Now for the "POP That_Data_Out_The_Laser".......

I guess I am going to have to use a parallel to seriel
shift register (where will I find one of those in an
ATMega :).

So - We have :

An index mark from the opto encoder.
A pixel clock from the VCO on the 4046 PLL
A Laser we can pulse on and off
A parallel to seriel shift register
Some method of getting raster data from a PC
   (via a TIFF file using CCIT group 3 fax)

I reckon I should be able to finish it in under 6
months.

It could be now that some unkind people would point
out that sometimes it takes me longer than 6 months
to mow my lawn :(

Re: [Homebrew_PCBs] Red Laser Diode Rotating Drum Photo Plotter

2006-04-29 by Jan Kok

On 4/28/06, cunningfellow <andrewm1973@...> wrote:

> So far I have built a text-book 4046 PLL
> multiplier. This has been hooked up to a
> servo motor I scavanged from something.

My, what a lot of circuitry :-)

If you are going to use a 16MHz ATMega, you don't need the analog PLL
or XOR gates.  Just pipe the encoder signals into the processor's
digital input ports.

You don't need the motor control chip either.  Take a PWM output and
run it into an RC (low pass filter), so with 50% duty cycle you get
2.5V with say .1V sawtooth ripple.  Compare that with the voltage
across the motor, lowpass filtered.  Use the comparator output to
drive a high-side switch (PFET) to drive the motor.

The ATMega even has an analog comparator on-chip that you might be
able to use, but I think that might be taking things too far, and
there might be performance problems.

> Unfortunatly the encoder wheel on the servo
> does not have an index mark - so I will have
> to scavange another one from somewhere.

If you can keep an accurate count of the encoder pulses, you don't
need a super-accurate index pulse.  In fact you don't need an index
pulse at all, if you are willing to set the cylinder at the "zero"
position manually before starting the cylinder motor.

If you do want an index pulse, you could use the laser to supply the light...

Now you know why they put microcontrollers in toasters - saves a bunch
of other parts :-)

> There is going to be another Atmel sitting on
> the end of a UART.  You will simply X-Modem a
> BMP file to it and like magic it should come
> out the laser.
>
> I think this should be easy in assembly laguage
> using the IN and POP instructions.
>
> Main_Routine:
>      IN     Accumulator_A, XMODEM_Data
>      POP    That_Data_Out_The_Laser
>
> As long as I can get that to assemble in AVR
> studio the project should be finished tomorrow.

You just need a couple more lines of code to input the encoder lines
and control the PWM duty cycle.

Cheers,
- Jan

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-29 by cunningfellow

> > andrewm wrote:
> > So far I have built a text-book 4046 PLL
> > multiplier. This has been hooked up to a
> > servo motor I scavanged from something.

> Jan wrote: 
> My, what a lot of circuitry :-)

The final board shall probably have an ATMega
an FT232 and a HC4046.  Apart from that some
discreets or possibly an laser diode current
driver IC.

I am building it in sections for prototyping.
Each section probably with its own atmel.  All
these atmels will be combined into the one
chip in the end.

> If you are going to use a 16MHz ATMega, you
> don't need the analog PLL or XOR gates.  Just
> pipe the encoder signals into the processor's
> digital input ports.

I don't think I need the XOR gate or the HC393
(they are only there for the proto boards in test)
but I think the PLL is pretty necessary.  The
opto encoder on the back of the servo motor does
not have anywhere near the resolution needed to
do 1000 dpi - hence the multiplication by the
PLL.

I am going to do some fancy tricks with the
ATMEL so I don't need the divider - but I will
still need the phase comparator and the VCO.

I don't think a 16 Mhz Atmel has enough omph
to get that kinda thing done in software.

From my math the pixel clock for a 2000 dpi plot
of the kinda size and speed we are talking is
200Khz.  Thats about 80 CPU clocks per pixel.
If you are going to do the pixel clock in SW
you wont be able to use a shift register. (the
spi port).  So you have to do two control loops,
decode group 3 fax and a SW shift register with
hopefully uS accuracy in 80 clock cycles.

If you have a PLL/VCO provide the pixel clock
you can use the SPI port in slave mode to be
a hardware shift register.  You then have 640
CPU clocks to get the next 8 pixels ready.

Call me wuss for not trimming my ASM code
enough - but I think I shall stick to an
external PLL.


> You don't need the motor control chip either.
> Take a PWM output and run it into an RC (low
> pass filter), so with 50% duty cycle you get
> 2.5V with say .1V sawtooth ripple.  Compare
> that with the voltage across the motor,
> lowpass filtered.  Use the comparator output to
> drive a high-side switch (PFET) to drive the
> motor.

HUH - who said motor control chip.  The PWM
straight from an Atmel into a FET on the low
side.  The Atmel counts the pulses from a
single channel of the encoder to do speed feed-
back.  Cheaper and less chips than a high side
switch and whats all the complexity of going
into the analog domain about :S

Digital pulses in - Digital pulses out.  I spend
so much of my life avoiding analog circuits.
There is no way I am going to invite them in
the front door for no good reason.

<SNIP>
 
> > Unfortunatly the encoder wheel on the servo
> > does not have an index mark - so I will have
> > to scavange another one from somewhere.
> 
> If you can keep an accurate count of the encoder
> pulses, you don't need a super-accurate index
> pulse.  In fact you don't need an index pulse at
> all, if you are willing to set the cylinder at
> the "zero" position manually before starting the
> cylinder motor.

I will keep track of pulses line to line - but I
am NOT willing to manually ZERO the thing.  I am
a dork - and if there is something I can do wrong
I will 50% of the time.  And wasting every second
sheet of film because I could no be bothered
making it automatically detect the start of frame
is not my idea of fun.

Remeber Andrew = hopeless dork that makes many
many mistakes.

> If you do want an index pulse, you could use the
> laser to supply the light...

Or get an encoder with an index pulse - seeing as
it is very common anyways.  I could do ALL sorts of
things with lasers or my own opto interupter or
maybe even aligning the PCB with stonehenge.  But
at the and of the day - the optical detector on the
back of ALL servo motors have an index out.  All
you need to do is find a motor with a wheel that
has the index marks etched.  Free index pulse as
far as I am concerend.

<BIG SNIP>

Also - I am not trying to be nasty about any feed-
back about my circuit.  I welcome all feedback
especially if I am doing something stupid and
obviously wrong.  But please can we limit "I
*think* it would be better if you did this" kinda
feed back till I have something working.  Even if
you think I am going about it the hard way. (rather
than the wrong way)

Once I have it running (give me 6 months) feel
free to bag me endlessly for having one too many
resistors in there and tell me I could have made
it much less complex if I had done something
differently.

Thanks :D

On a side note - feel free to bag my spelling.  I
know its terrible.

Re: [Homebrew_PCBs] Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-29 by Jan Kok

On 4/29/06, cunningfellow <andrewm1973@...> wrote:

> I don't think I need the XOR gate or the HC393
> (they are only there for the proto boards in test)
> but I think the PLL is pretty necessary.  The
> opto encoder on the back of the servo motor does
> not have anywhere near the resolution needed to
> do 1000 dpi - hence the multiplication by the
> PLL.

I guess what I would do is run the processor from a crystal
oscillator, and try to sync the cylinder rotation with the processor
clock.

12 inches circumference, 2000dpi, 10rev per sec = about 250000 pixels/second
about 64 clock cycles per pixel, 1600 clock cycles per encoder pulse,
25 pixels per encoder pulse.

I wonder how much jitter there is, pulse to pulse, and from one
revolution to the next?

Note that the only feedback you have about the cylinder speed is the
encoder pulse edges, which come one every 100 uS.  The PLL isn't
psychic... it uses those same encoder pulse edges, sees whether they
arrive early or later than expected, and ramps the oscillator speed up
or down as needed to stay in sync.  The processor can watch those
pulses just as well as the PLL can, and control the motor speed with
PWM.


> From my math the pixel clock for a 2000 dpi plot
> of the kinda size and speed we are talking is
> 200Khz.  Thats about 80 CPU clocks per pixel.
> If you are going to do the pixel clock in SW
> you wont be able to use a shift register. (the
> spi port).  So you have to do two control loops,

Just one, I think: the motor speed, and that loop is s-l-o-w.

> decode group 3 fax and a SW shift register with
> hopefully uS accuracy in 80 clock cycles.

I don't know what's involved with group 3 fax, but 80 instructions is
way more than needed for a sw shift register.  I would do the shifting
in an interrupt routine triggered by a timer.


> > You don't need the motor control chip either.
> > Take a PWM output and run it into an RC (low
> > pass filter), so with 50% duty cycle you get
> > 2.5V with say .1V sawtooth ripple.  Compare
> > that with the voltage across the motor,
> > lowpass filtered.  Use the comparator output to
> > drive a high-side switch (PFET) to drive the
> > motor.
>
> HUH - who said motor control chip.

Oops, I didn't check to see what a "tiny2313" was. :-)

>  The PWM
> straight from an Atmel into a FET on the low
> side.  The Atmel counts the pulses from a
> single channel of the encoder to do speed feed-
> back.

Sounds like you're depending on the internal clock being pretty stable.

>  Cheaper and less chips than a high side
> switch and whats all the complexity of going
> into the analog domain about :S

I was trying to compensate for any 120 Hz ripple in the 12V supply.  2
RC filters and a comparator.  I see a bunch of Rs and Cs near the
PLL... :-)

>
> Digital pulses in - Digital pulses out.  I spend
> so much of my life avoiding analog circuits.
> There is no way I am going to invite them in
> the front door for no good reason.

If the 12V is well regulated then yes, just PWM the motor from a processor port.

>
> <SNIP>
>

> Also - I am not trying to be nasty about any feed-
> back about my circuit.  I welcome all feedback
> especially if I am doing something stupid and
> obviously wrong.  But please can we limit "I
> *think* it would be better if you did this" kinda
> feed back till I have something working.  Even if
> you think I am going about it the hard way. (rather
> than the wrong way)

Sorry... I just enjoy simplifying circuits to the bone...  I don't see
anything there that would make your circuit definitely NOT work.

In order to get 2000dpi accurately, so the dots line up from one
revolution to the next, there can't be too much random jitter in the
decoder pulses, the processor clock needs to be stable, the 12V needs
to be stable or else compensated for...

Cheers,
- Jan

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-29 by cunningfellow

> Jan wrote:
> I guess what I would do is run the processor from
> a crystal oscillator, and try to sync the cylinder
> rotation with the processor clock.

OK - I understand where your coming from now.

Still I would prefer to PLL a pixel clock from the
motor rather than try regulate the speed of a motor
to match the xtal.

<SNIP>

> I wonder how much jitter there is, pulse to pulse,
> and from one revolution to the next?
> 
> Note that the only feedback you have about the
> cylinder speed is the encoder pulse edges, which
> come one every 100 uS.  The PLL isn't psychic...
> it uses those same encoder pulse edges, sees whether
> they arrive early or later than expected, and
> ramps the oscillator speed up or down as needed to
> stay in sync.  The processor can watch those pulses
> just as well as the PLL can, and control the motor
> speed with PWM.

The motor has a very slow loop (big mechanical mass)
The VCO/Divider/Phase-comparator has a relativly fast
loop.  I think that errors that are out by a few thou
and are corrected in 1mm will be less serious than
errors that last for 3 revolutions.

Take that back - PLLs ARE psychic :D

Yes - They both use the same encoder for feedback.
But the PLL can use the phase difference to affect
the loop every single singal pulse.  An MCU like the
ATMega has to

A, Either add up several 100/1000s pulses in a
   pulse accumulator over a period of time to
   feed back into the loop. OR
B, Use an Input Capture to compare the absolute time
   of each pulse.  It has to then run the loop
   filter every encoder cycle.   This being 16 bit
   math with multiplys and divides.  Even if you
   simplify the PID loop to P there is still going
   to be plenty 'nuff 16 bit additions and
   subtractions to keep the poor little atmel busy.


<SNIP>
> > So you have to do two control loops,

> Just one, I think: the motor speed, and that loop
> is s-l-o-w.

Second one on the servo for the X axis.  Amazingly
s--l--o--w but still needs software.

> > decode group 3 fax and a SW shift register with
> > hopefully uS accuracy in 80 clock cycles.
>
> I don't know what's involved with group 3 fax, but
> 80 instructions is way more than needed for a sw
> shift register.  I would do the shifting in an
> interrupt routine triggered by a timer.

G3 compression is Run Length Encoding that is then
Huffman (variable bit length) encoded.

Enter/Exit interrupt, Save states, + SW shift will
take at least 10 cycles.  Take away the time taken
to service the UART, do XModem-CRC and run the
servo control loops - I am not sure that I could
get huffman decoding done in that time.  Even with
fancy tricks and the oodles of memory an ATMega has.

However - Now that I know your idea was to regulate
the speed of the motor more accuratly than I planned
too - You're allowed to use the SPI hardware shift
register too :)

<SNIP> 
> Sounds like you're depending on the internal clock
> being pretty stable.

Just the opposite.  I am planing on the PLL to be
accurate WRT the rotating drum.  Then the pixels are
accurate.  What speed the atmel runs at is totaly
irrelivent.

Rather than making the drum speed the most important
thing in the world - I want to make the world march
the the beet of the drums drum :)

<SNIP>
> > Also - I am not trying to be nasty about any feed-
> > back about my circuit.  I welcome all feedback
> > especially if I am doing something stupid and
> > obviously wrong.  But please can we limit "I
> > *think* it would be better if you did this" kinda
> > feed back till I have something working.  Even if
> > you think I am going about it the hard way. (rather
> > than the wrong way)
> 
> Sorry... I just enjoy simplifying circuits to the
> bone...  I don't see anything there that would make
> your circuit definitely NOT work.

OK - After I have it running with a PLL - I shall try
see if I can reduce the chip count by 1 with your
idea there.

OR I could just pack the finished unit in a cardboard
box and let you do it if you like ?  I already have
about 10 years worth of project backlog to get through.

> In order to get 2000dpi accurately, so the dots line
> up from one revolution to the next, there can't be
> too much random jitter in the decoder pulses, the
> processor clock needs to be stable, the 12V needs to
> be stable or else compensated for...

*OR* the pll needs to have the loop filter sorted and
you ignore all other variances :D

andrew = lazy.
PLL = Not having to optimize code too much.
andrew + PLL = HLA (Happy Lazy Andrew)

:D

Re: [Homebrew_PCBs] Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-30 by Alan King

A bit OT and longish, but other people might want to see how to run 
the software PLL with only a few adds and subtracts..



cunningfellow wrote:

>
>HUH - who said motor control chip.  The PWM
>straight from an Atmel into a FET on the low
>side.  The Atmel counts the pulses from a
>single channel of the encoder to do speed feed-
>back.  Cheaper and less chips than a high side
>switch and whats all the complexity of going
>into the analog domain about :S
>
>Digital pulses in - Digital pulses out.  I spend
>so much of my life avoiding analog circuits.
>There is no way I am going to invite them in
>the front door for no good reason.
>
>
>  
>

  Of course the good philosophy, use it to decide to dump the PLL too..



>I will keep track of pulses line to line - but I
>am NOT willing to manually ZERO the thing.  I am
>a dork - and if there is something I can do wrong
>I will 50% of the time.  And wasting every second
>sheet of film because I could no be bothered
>making it automatically detect the start of frame
>is not my idea of fun.
>
>
>  
>
  Simply add your own setup to get a once per line index, just easier 
than keeping track.


>Also - I am not trying to be nasty about any feed-
>back about my circuit.
>

1>

>  I welcome all feedback
>especially if I am doing something stupid and
>obviously wrong.
>

2>

>  But please can we limit "I
>*think* it would be better if you did this" kinda
>feed back till I have something working.  Even if
>you think I am going about it the hard way. (rather
>than the wrong way)
>
>  
>
3>

>Once I have it running (give me 6 months) feel
>free to bag me endlessly for having one too many
>resistors in there and tell me I could have made
>it much less complex if I had done something
>differently.
>
>  
>

    I find the excluding of advice a bit strange after your earlier 
understanding that software and less hardware is generally better..  You 
seem to be taking things like 3 and categorizing them under class 2 
instead of class 1.  Maybe the only reason you're only seeing it as an 
'either/or/nearly equal' case instead of a very bad idea for hardware is 
because you don't already know the other method fully?  Even if it would 
still fall into class 2, if your timing is loose enough to not worry 
about it in 6 months etc, then there's certainly time to better evaluate 
other techniques more fully.  Knowing the hardware PLL, you know how 
others who don't know their use ascribe more work to using them than 
there actually is, simply because they aren't familiar.  But you're also 
doing the reverse.  Software PLL is a breeze, not the work you seem to 
be deciding it is without looking at it enough.  Your not being familiar 
with it is letting you way overestimate the work involved, you seem to 
have classed the advice into category 2 off hand.  Really you'd have to 
investigate it far better than reading an email or two to even have an 
idea whether it is just an either/or comparison or really falls into 
category 1 and is way more important advice than how you're seeing at 
first..  Knowing both at least somewhat, I'd say instead of the 50/50 
toss up or maybe even in favor of the hardware since you're familiar 
already, it's really more like 80/20 or 90/10 in favor for the software 
PLL.  It doesn't require some serious extra work, if you're already 
doing some related count then it's almost no work to add it into the 
loop and do it in the same routine.  Much less work than you're 
guestimating so far..


  Have your index so you know where the line start is without much 
work.  For speed control, you simply time from one positive encoder edge 
to the next with a counter.  If the count is under what it should be, 
you slow down, if it's over you speed up. Not much else to it.  If from 
one edge to the next doesn't give tight enough control, you simply roll 
over a set of multiple counts.  Keep track of the last 4 pulse timings, 
overwriting the newest one onto the oldest one.  Add all 4 after each 
pulse, and if that last 4 counts are over or under the right total, 
speed up or slow down respectively..  Or 8 or 16 counts etc, however 
many needed to get a large enough count to have tight enough control..  
There is no need for any multiplication or division, that is completely 
taken care of by the fact that the rate you're expecting counts from the 
encoder is different than the rate you're clocking out on the beam from 
the index.  As long as your speed is right with accuracy, and you're 
outputting at the desired clock rate from the index, there is no need to 
relate the two values directly at all.  It is simply keeping track of 2 
factors of different scale within the same loop, it's way less work than 
required by a loop within a loop.  Or you can completely split them up 
and keep them independent, the only real linkage is the mechanical one 
from the encoder to the beam.  Either way it'll spend very little effort 
on the PLL control part, there is near nothing extra needed to control a 
motor like this..

  From your later message, motors are slow creatures.  You don't really 
need a bunch of 16 bit math to keep up with this, even at a higly 
accurate count, you only need a delta signal to decide if you need 
faster or slower.  You spin up and do a full count once, to make sure 
you're in the right speed range with the high byte or bytes.  Then you 
simply subtract the oldest low byte from your accumulated count, and 
then add your new count low byte.  Say you have a 16 count rollover, you 
just subtracted your 16th count ago, and now added your new first count, 
then increment the index for next time.  As long as your current count 
sum low byte isn't 128 out from the desired total count low byte, you 
are within range and know your high byte is the same, you don't have to 
add anything 16 bit really.  And you have really tight control across 
many pulses with just one 8 bit subtract and one 8 bit add.  (Really it 
has to be within 128- the difference from the old byte and the new byte, 
that eats up some of your headroom for the high byte rollover..)  You 
can exercise extremely accurate control with almost no work, you only 
need to check enough low bits to make sure you're within the error range 
of the motor's speed variation.  This way is *more* lazy and less time 
consuming and much more flexible than doing it in hardware, you just 
haven't already seen that part for yourself yet.. :)  I've done it some 
before so these are older ideas for me already..  Say your full count 
has whatever high bytes, and the low byte of the full high res count 
from 16 pulses should be 237.  Anything short of 128 out either way for 
total change and you'll stay accurate and can figure the delta, no need 
to worry about if the high byte went up or down with the wrap even.  
Generally get it so your variation is like 16 or less, that way you're 
well inside, and staying within 16 counts of say a random total of 
13,837 for your full 16 value count is pretty tight control.  If it's a 
little too jittery on controlling by a single pulse value, you could 
easily keep two rolling counts, say one at 16 or 32 counts and one just 
the last 4.  Then use two bits up in the 4 (shift divide by 4 to average 
the last 4 values) related to 4 bits up in the 16 (shift divide by 16) 
to generate the delta for faster/slower.  Still not that many 
adds/subtracts and compares to do, even with two seperate rollover averages.

  Haven't worked the numbers, you have to make sure you're generating a 
delta value toward the correct running total.  My description may even 
be off somewhere on verbage etc, but it's the right basic idea.  Haven't 
written out the numbers etc to make sure I'm saying it 100% correctly..


  It seems you're maybe taking some of the advice a little too 
critically too.  I'm as slack as anybody, and took way too long to 
decide to figure this stuff out for myself when I finally did.  But now 
that I do, and know how useful it is in many areas, and it's obvious you 
have most of the necessary related ideas anyway, I wouldn't be mean 
enough to not give you an extra kick or two too to hurry up and learn 
it, even if you say a million times how much you don't want it lol..  
You'll be kicking yourself a lot more if you wait years, having these 
ideas in your head improves your thinking on solving a ton of different 
programming problems.  You learn to adapt almost everything to these 
ideas, because they are so simple after you have them in mind.  Theymake 
many things easy that would be hard to keep track of without them.

  DDS (direct digital synthesis) is almost directly related, sort of 
like the difference between working with whole numbers or fractions 
between the two.  Learn it at the same time if you don't already know, 
if you do then you need to look at it again while looking at the PLL 
idea to see how related they are.  The combination of the two ideas let 
you do almost anything real world without too much actual work.

  Of course even typing this up isn't entirely altruistic, pulls it back 
into the front of the brain for me, have done some slack coding lately 
where I should have tightened it up more with these ideas.  Use them all 
the time on little tasks, sometimes don't bother to back up and use the 
right big picture after adding code on, very bad and slack habit.


  Also, have you thought about skipping the red laser part and just 
drawing on a board with UV directly?  Thought about it some myself 
before, and lower power non-cutting UV lasers aren't so bad pricewise 
compared to the cutters really.  Still like the idea of a simple inkjet 
though for now, few of my boards are tight resolution.  Of course I want 
a billion watt cutting UV laser anyway..

Alan

UV plotting

2006-04-30 by Alan King

>
>  Also, have you thought about skipping the red laser part and just 
>drawing on a board with UV directly?  Thought about it some myself 
>before, and lower power non-cutting UV lasers aren't so bad pricewise 
>compared to the cutters really.  Still like the idea of a simple inkjet 
>though for now, few of my boards are tight resolution.  Of course I want 
>a billion watt cutting UV laser anyway..
>
>  
>


  Just did a little looking, and sure enough the UV LEDs I have are in 
the correct range for exposing a board.  Should've thought of that a 
year ago..  Saw off the inbuilt lens, mount the LED and a better lens so 
it's focused onto the board, and have an apeture hole near the board to 
block any stray light.  Feed the board vertically, have a second setup 
on the other side, and do both sides at once.  Do 4 or 8 LEDs on each 
side to cut the exposure time too.  Wouldn't even care if it took hours 
personally, it'd still be great for small test boards and pretty simple 
to build up..

  Of course looks like the inkjet will end up being more practical, but 
heck should've already built this a long time ago.  Might even do it 
sometime just for fun, should be easy to do a simple version on an old 
printer mechanism.

Alan

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-30 by Andrew

> Alan wrote:
>
> A bit OT and longish, but other people might
> want to see how to run the software PLL with
> only a few adds and subtracts..

control loops.

P   =  add and subtract
PID != add and subtract

> >cunningfellow wrote:

<SNIP>
> >Digital pulses in - Digital pulses out.  I spend
> >so much of my life avoiding analog circuits.
> >There is no way I am going to invite them in
> >the front door for no good reason.
> 
> Of course the good philosophy, use it to decide
> to dump the PLL too..

I did say "for no good reason."

I am not a mechanic.  I don't know if the motor
speed is able to be controlled without some
amount of jitter.  I do know that I can predict
the loop in the analog PLL.

But maybe a better explanation of my "good reason"
comes from the other post I made when I said 
"marching to the beat of the drums drum"

Think about the reltive merits of controlling
the pixel clock relative to the motor and then
controlling the motor relative to the pixel
clock.


> >I will keep track of pulses line to line - but I
> >am NOT willing to manually ZERO the thing.<SNIP>

> Simply add your own setup to get a once per line
> index, just easier than keeping track.

No - I will keep track.  The index mark could be
out by a pixel or two each revolution if the jitter
is bad.  Counting from the index EACH revolution
you could end up with a spiral along the print out.
(fairly obviously the errors could accumulate)

I MAY look at the index mark each revolution.  This
would be part of "Checks and measures" to make sure
nothing has gone horribly wrong.  I do however think
it would be foolish to rely on it.

<SNIP>
> if your timing is loose enough to not worry about
> it in 6 months etc, then there's certainly time to
> better evaluate other techniques more fully.

I just do not think that I should be doing it now
or in 6 months time.  I was just trying to not be
rude and dismiss the idea outright. 

<SNIP>
> it's really more like 80/20 or 90/10 in favor for
> the software PLL.  It doesn't require some serious
> extra work, if you're already doing some related
> count then it's almost no work to add it into the 
> loop and do it in the same routine.  Much less
> work than you're guestimating so far..

If we are comparing apples and apples a digital
only loop would win.  I used a digital only
control loop to do an automatic traction control
for a remote conrtol car 12 years ago and would
never have thought about using anything analog
in that case.

But please have a look at the relative merits of
controlling motor speed or controlling pixel clock.

Then if you agree with me that controling the
pixel clock is a better idea - tell me if you
think its a good plan to do that in a 16mhz atmel.

<SNIP lots of stuff about 8 bit math ect>

> It seems you're maybe taking some of the advice a
> little too critically too.
<snip stuf about learning things>

I like to think I don't take things to seriosuly
ever.  On the internet though, you have to limit
the amount of people you will spend time listening
too.  Everyone is an expert.  Even if they don't
understand the problem.  And I usually prefer to
say "thats a good idea - but I will stick to doing
it my way for now".

That is unless someone can show me that my way may
not work.

If you invite everyone to put in thier two cents
worth - you might end up rich - but you will never
the job done.


> Also, have you thought about skipping the red laser
> part and just drawing on a board with UV directly?
> Thought about it some myself before, and lower power
> non-cutting UV lasers aren't so bad pricewise
> compared to the cutters really.  Still like the idea
> of a simple inkjet though for now, few of my boards
> are tight resolution.  Of course I want a billion
> watt cutting UV laser anyway..

I have though about it - but dismissed the idea
quickly.  I have a center lathe, a milling machine
a TIG welder and a whole shed full of equipment.

I can even use the lathe to turn up cone pieces.

I do know I don't have enough skill to build an
XY carraige large enough to hold a UV-gas laser
and position it to 0.01 mm accuracy.

Re: UV plotting

2006-04-30 by Andrew

> Alan wrote
> Just did a little looking, and sure enough the
> UV LEDs I have are in the correct range for
> exposing a board.  Should've thought of that a 
> year ago..  Saw off the inbuilt lens, mount the
> LED and a better lens so it's focused onto the
> board, and have an apeture hole near the board to 
> block any stray light.  Feed the board
> vertically, have a second setup on the other
> side, and do both sides at once.  Do 4 or 8 LEDs
> on each side to cut the exposure time too.
> Wouldn't even care if it took hours personally,
> it'd still be great for small test boards and
> pretty simple to build up..

> Of course looks like the inkjet will end up being
> more practical, but heck should've already built
> this a long time ago.  Might even do it sometime
> just for fun, should be easy to do a simple
> version on an old printer mechanism.

I think if you search the archive this idea with
solid state UV emitters has been discussed.

I don't remember the exact numbers but I seem to
recall someone saying it would take weeks to expose
a uv sensitve PCB with UV LEDs.

Re: [Homebrew_PCBs] UV plotting

2006-04-30 by cristian

>   Just did a little looking, and sure enough the UV LEDs I have are in
>the correct range for exposing a board.

Alan, please be more specific: have you tested with positive results?
At what resolution?
What UV power and how long for, let say 10x16cm, 50% traces board?
How is your focusing device?
Cristian

Re: UV plotting

2006-04-30 by warrenbrayshaw

Elektor magazine (May 2006)has a construction article for a UV LED 
light box. 
http://www.elektor-electronics.co.uk/Default.aspx?
tabid=27&year=2006&month=5&art=53039&PN=On
Show quoted textHide quoted text
> 
> I don't remember the exact numbers but I seem to
> recall someone saying it would take weeks to expose
> a uv sensitve PCB with UV LEDs.
>

Re: Red Laser Diode Rotating Drum Photo Plotter

2006-04-30 by Andrew

> andrewm wrote:
> No - I will keep track.  The index mark could be
> out by a pixel or two each revolution if the jitter
> is bad.  Counting from the index EACH revolution
> you could end up with a spiral along the print out.
> (fairly obviously the errors could accumulate)

Opps - sorry - andrew was fairly obviously on drugs
when he wrote that.  The error would not accumulate
would be a maximum of 1 pixel plus proccesor lag (
80th of a pixel) per revolution.

Re: [Homebrew_PCBs] UV plotting

2006-04-30 by Alan King

cristian wrote:

>>  Just did a little looking, and sure enough the UV LEDs I have are in
>>the correct range for exposing a board.
>>    
>>
>
>Alan, please be more specific: have you tested with positive results?
>At what resolution?
>What UV power and how long for, let say 10x16cm, 50% traces board?
>How is your focusing device?
>Cristian
>  
>


  No tests, the light output of the LED is simply in the same 390-420 nm 
range needed for the film coating exposure.

  There's a ton of output power in a UV lamp etc etc etc.  And they use 
that and not wanting the film to go bad at the drop of a hat, and of 
course it's slow.  UV has higher energy than visible light, little doubt 
it'd be fairly trivial technically to do UV film that's dozens or 
hundreds of times faster than what is normally used.  Maybe a different 
story in cheapness and practicality, but no doubt possible.  Even the 
normal is probably fine enough for overnight doings for a 2"x2" board or 
similar with multiple LEDs..

  Again, wouldn't do it practically since the inkjet seems to be looking 
good, but little doubt it's doable.  Should've done it two years ago 
though..

Alan

Newbie Question

2006-04-30 by William Carr

On Apr 30, 2006, at 2:18 AM, Alan King wrote:

>   No tests, the light output of the LED is simply in the same  
> 390-420 nm
> range needed for the film coating exposure.


Hi.   I'm new to the group, can I ask a newbie question?

Why the emphasis on development of a direct inkjet process?

 From High School in the early 80's, I recall the way PCB's were done  
is to use the UV boards, a photo mask, and the sun.   Not that I've  
done any lately.

I just bought some PCB layout software and I wonder at the enthusiasm  
for this new inkjet process.

The current (pun!) problem is that the ink washes off, even though  
it's been oven-dried?


I wonder if fixing the ink with something like silicone spray would  
protect the ink but still not prevent the acid from etching the traces.

****

I've been playing with Electrolytic Rust Removal this week.   Baking  
Soda, water, a plastic bucket and an old trickle charger.

Add a metal part to the solution, clip it to the negative lead, and  
the positive lead to a piece of scrap metal stuck in the bucket.

The rust on the part turns black and falls off, leaving clean metal.

But come back after a week of cleaning off various metal parts, check  
the scrap metal on the positive lead, and it's been eaten away below  
the water line !


Eaten away by baking soda and electrons.


Makes me wonder if you could dope the solution to work faster under a  
UV light.

Put the printed PCB, sprayed with a fixitive,  in the solution  
clipped to the positive lead, a copper or silver-plated rod on the  
negative lead, shine the UV on the PCB, and in 1/2 hour or so, the  
copper not under the printed area is gone.

A silver salt maybe?    Basically I'm thinking of the old PhotoGray  
solution.


You'd need to mask the copper at the contact point for the positive  
lead too, or it would come off first and the process would stop.


William Carr

Re: [Homebrew_PCBs] Newbie Question

2006-04-30 by Lez

On 30/04/06, William Carr <Jkirk3279@...> wrote:
>
> On Apr 30, 2006, at 2:18 AM, Alan King wrote:
>
> >   No tests, the light output of the LED is simply in the same
> > 390-420 nm
> > range needed for the film coating exposure.
>
>
> Hi.   I'm new to the group, can I ask a newbie question?
>
> Why the emphasis on development of a direct inkjet process?
>

Well for me its the speed of prototyping boards, fast small scale
production runs, and low cost, and of course dependable results.

You can see if it looks ok before etching easily if not clean board
and re-print.

Re: [Homebrew_PCBs] Newbie Question

2006-05-01 by Stefan Trethan

Because if we didn't look into new, superior ways of doing things, you  
would still do layouts like in the early 80's, or before.

ST


On Sun, 30 Apr 2006 23:26:00 +0200, William Carr <Jkirk3279@...>  
wrote:
Show quoted textHide quoted text
> Hi.   I'm new to the group, can I ask a newbie question?
>
>
> Why the emphasis on development of a direct inkjet process?
>
>
>  From High School in the early 80's, I recall the way PCB's were done
>
> is to use the UV boards, a photo mask, and the sun.   Not that I've
>
> done any lately.

Re: Newbie Question

2006-05-01 by Andrew

> William Carr wrote:
> Hi.   I'm new to the group, can I ask a newbie
> question?
> 
> Why the emphasis on development of a direct
> inkjet process?
> 
> From High School in the early 80's, I recall
> the way PCB's were done is to use the UV
> boards, a photo mask, and the sun.   Not that
> I've  done any lately.
<big snip>

The _WAY_ (in big capitals with underlining) is
still photographic.

For quality of board, repeatability, freedom from
process variation, speed of production (if making
more than a few) it wins.  No buts, No ifs - it
just wins.

If you can't tell, I'm on of the photographic ways
biggest defenders.

I started with photo when the only option easily
available was negative acting.  I switched to
Toner Transfer a bit over a decade ago after
reading an article about Xerox playing with it.
(I think a long time before pulsar brought out
TTS with all the trademarks and stuff).

I could get 8 thou tracks 8 thou spacing with
toner.  However waiting till the 3rd full moon
after the solatice, cleaning and preping the
blank board with 7 different solutions, drawing
the pentagram on the floor and slaugtering the
goat all took time.

I switched back to photo about 5 or 6 years
ago.  And although I have resorted to toner a
few times in the last five years - it's only
when I desperatly need a board and have run
out of photo-stuff.

Photo does have drawbacks - mostly related to
cost AND the amount of space the equpiment
takes up.  The cost that I talk of is mainly
setting up your shop to do a good job of it.
Cost of production is in the same ballpark as
toner transfer.

Even with a shop set up to do photographic
boards to quite reasonable quality.  AND my
one eyed bigotry in favour of photo.  I still
have an interest in this ink-jet direct method.

Apart from novelty (which seems to be the biggest
winner of hearts around).  It has two big looking
advantages.

1, If requires neither a photo-tool, like the UV
   photographic method or sheet of paper that is
   destroyed in the process like toner transfer.
   This means that ONE OFF boards can be produced
   for a lower cost.

2, If a sytem of ink/printer that would allow
   air drying to happen it could reduce the
   number of attended steps in a home shop.

   Step 1 - load blank board to printer.
   Step 2 - Etch board.

   This would be a big advantage in a home shop
   that is more interested in person time than
   product throughput.


I am watching the thread with interest.

If it can be worked out to give acceptable
results I WILL get one to suppliment my photo
setup.

andrewm.

Re: [Homebrew_PCBs] Newbie Question

2006-05-01 by William Carr

On Apr 30, 2006, at 8:12 PM, Stefan Trethan wrote:

> Because if we didn't look into new, superior ways of doing things, you
> would still do layouts like in the early 80's, or before.

Okay.   Is anybody using a laser engraver to run off PCBs?

Re: [Homebrew_PCBs] Newbie Question

2006-05-02 by Christopher Hart

On Monday 01 May 2006 19:40, William Carr wrote:
>  On Apr 30, 2006, at 8:12 PM, Stefan Trethan wrote:
>  > Because if we didn't look into new, superior ways of doing things, you
>  > would still do layouts like in the early 80's, or before.
>
>  Okay.   Is anybody using a laser engraver to run off PCBs?
>
I've tried it with a 25W CO2 laser (a piece of equipment that costs more than 
my car, and holds it's value better) and it doesn't even touch the copper. 
Flip the board over, and it will cut right through the fiber though.

Re: Newbie Question

2006-05-02 by Andrew

> > Someone wrote:
> >
> > Okay.   Is anybody using a laser engraver
> > to run off PCBs?

> Chris H wrote:
>
> I've tried it with a 25W CO2 laser (a piece of
> equipment that costs more than my car, and
> holds it's value better) and it doesn't even
> touch the copper.  Flip the board over, and
> it will cut right through the fiber though.

Copper side just reflecting that wavelength huh.

Maybe needs an orange laser with a wavelength
that will be absorbed.

Alternativly you could make the copper unshinny.
Maybe a thick layer black toner on the copper.
Possibly use toner transfer paper to put on a
negative PCB image and then the laser will
burn off the copper underneath the black.

andrewm (sitting back and waiting for replies :)

Re: [Homebrew_PCBs] Re: Newbie Question

2006-05-02 by Russell Shaw

Andrew wrote:
>>>Someone wrote:
>>>
>>>Okay.   Is anybody using a laser engraver
>>>to run off PCBs?
> 
> 
>>Chris H wrote:
>>
>>I've tried it with a 25W CO2 laser (a piece of
>>equipment that costs more than my car, and
>>holds it's value better) and it doesn't even
>>touch the copper.  Flip the board over, and
>>it will cut right through the fiber though.
> 
> 
> Copper side just reflecting that wavelength huh.
> 
> Maybe needs an orange laser with a wavelength
> that will be absorbed.
> 
> Alternativly you could make the copper unshinny.
> Maybe a thick layer black toner on the copper.
> Possibly use toner transfer paper to put on a
> negative PCB image and then the laser will
> burn off the copper underneath the black.
> 
> andrewm (sitting back and waiting for replies :)

You could just burn off the black coating resist as
tracks, then etch the pcb as usual. (laser scratch-
and-etch).

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.