Question:-
Do you know if this serial printer will work with the Basic Stamp?
Answer:-
I have no experience with the Basic Stamp, but I think you have an embedded
RS232 line on the Stamp don't you? This will allow outside world communications
with the printer. If you also have twelve output lines then your in business.
All that
would be needed would be some high current driver chips. You could then take my
C code and translate it into Basic. The code is quite easy to read (I hope!).
///////////////////////////////////////////////////////////////////////
Question:-
I am a wanna be inventor with very little
micro controller experience. From your website I get the idea that the
Panasonic printer may cost only 6.50 but will end up costing me much more in
stress.
What books do you recommend for a novice like me? I want to learn. Where
do you buy your parts from?
What I am trying to find is a low cost way to print. Have you seen to DYMO
hand help label makers. I took one apart and the printing mechanism is a
half or less inch strip that lays on top of the thermal paper (label) as it
passes by. Have you ever seen this. They must be cheap if DYMO can sell
their end product for $19.00.
Answer:-
Your right, the printer is very cheap, but the driver would be quite
expensive. I only
did it because I was interested in the challenge.
The trouble with most cheap printers is that once you have overcome the cost
of making the print mechanism itself and the programming of the controller then
as long as you can sell many of them the initial cost goes down and the final
cost
of the device can be low for the consumer.
In our case, the print mechanism is low because they have been pulled from old
equipment, but we have to reinvent the wheel as it were on the controller. Since
it is a one off thing the cost has to be high. I am not trying to sell you this
(I've never
sold anyone anything that I have designed at home), but I could (if you were
interested) sell
you a working system (RS232 in, printer controls out) for about $40. As I say, I'm NOT
trying to sell this to you, it's just to give you an idea of what it
would cost me.
Books, hmmm. I take it you mean books on microcontrollers in general, you seem
to have the background in electronics. I have never been a one for books. I
prefer
hands on experience. As long as it does no harm to the devices I am using I
just tinker until I get it right. The only reference I use is the datasheet for
the
device. In short, I'm afraid I can't help you here. Maybe someone who reads this
on the website will come up with a few names.....
I have settled down on using the PIC microcontroller for a number of reasons.
There
are many,many different versions out there all of which have many different
features
(UARTS, ADC etc). There are two main hurdles in using these devices. One is
you have to know a programming language (and have the assembler/compiler) and
the second is you have to have a way to program the device.
On the first front, I think there are free assemblers out there for the PIC
chips, but
the downside is that the assembly language route is very low level, you have to
think in terms of registers and shuffling bits of information about all alone.
If you
go the compiler route then C is probably the way to go, but the cost is quite
high. The cheapest C compiler for the PIC I have seen is about $140 from a UK
firm. It's not great, but it works.
Once you have your raw code you have to get it into the controller. The PIC's
have
a method where you can program the chip once it is in a system by using three
wires (from a PC parallel port? maybe a search of the web would give you an idea
on how to do this, but the datasheets for the devices give you the basics). I
have
a programmer, but they again can be quite expensive.
I get all my good, new, brand spanking new parts from www.digikey.com. I can't
recommend them highly enough. They send you your stuff the same day (if ordered
by 5PM). One word of caution, they do require a $25 minimum charge. If you don't
meet it then you pay a handling fee. Although I can't remember the price even
that
is not to excessive. The range of devices (including most of the PIC's) they
carry is
phenomenal.
One good source of info for the PIC is Microchip's website. They have all sorts
of
datasheets, FAQ's, startup tips etc. for downloading. Their website is
www.microchip.com.
At least give them a look if your thinking of learning about the subject.
///////////////////////////////////////////////////////////////////////
Question:-
I have surfed the web looking for a decent printer and they are all so
relatively expensive.
Ebay has some but who knows what you get!
I will keep in contact with you and may take you up on your offer. Would what
you put together
be easy to integrate with a controller?
Answer:-
It suddenly occurred to me that you may not realize that this printer is only
3.5 inches
across and takes a special type of paper that reacts to that (the letters are
almost
burnt onto the paper). It's the sort of thing that would be used in a
supermarket
checkout. I hope you were not expecting a full blown printer that used standard
paper.
The paper itself is quite cheap by the way. I think I paid something like $6 for
nine
rolls and each roll is 85 inches long. Quite a bit of printing!
If you were to take me up on my offer of a working board all you'd need to
supply
was the printer, solder a ribbon cable to it (a little tricky, but not to bad),
and then
start putting RS232 characters into it. Depending on the first character
received
the board would either enter a debug mode where you can play around with
character
spacing, printing special characters etc. In this mode you'd need to set up a
terminal emulator on your PC (many free ones are available on the internet and I
could point
you to a site where you could get one. If the first character is not the
debug character the printer would act just as that, a printer. You'd send it
characters
from your Stamp via RS232 and they would be directly printed.
///////////////////////////////////////////////////////////////////////
Question:-
Why are you using 6 drivers? From looking at the schematic, it appears
that only 4 are required. Am I missing something?
Answer:-
In fact I have used 12 high current drivers (if you look at the circuit each
package
contains 2). Each of the eight head 'dots' requires a driver and the motor has
two
coils. Each coil needs two drivers since you have to both "suck" and "blow"
current
into the coil to make it travel either forward or backward.
Further :-
Thanks for the info. The schematic I have shows a single driver for the
dots and a single driver for the stepper motor control. I also have a
schematic that shows 4 drivers. I did find that it is possible to
"cheat" the paper rotation and advance just 1/3, 2/3, or fully the
amount. This gives you the ability to actually do graphics.
The documentation states that you should NOT drive all of the head
elements at the same time. Besides using about 3 amps of current, the
excess heat causes premature death of the print head and a reduced print
quality. It doesn't take that long to pulse each dot and move the head.
The information in the data sheets is correct as far as wave forms for
the stepper motor and head pulse times, providing you pulse each dot
individually. The whole system uses less than 500ma if you do
everything individually.
Reply :-
You raise some interesting points, I'd love to see your schematic if you are at
liberty to show it too me. Even better would to be able to put it up on the website
for others to see. If you agree to this, would you like to be created? Name? Email?
I've just taken a look at the tech spec downloaded from Allelectronics website.
Are we getting confused over term here? That diagram shows one chip for the
dots and one chip for the motor. Contained in the dot chip are my eight drivers
and the motor chip is a stepper driver which contains four drivers and control
circuitry. Since I wanted direct control over the motor and I had the processing
capabilities on the microcontroller I decided to "go it alone" on the motor drive.
I agree with you about driving all the dots at once and that I use excessive
timings, but I came to this solution after experimentation and measurement. The
high currents can easily be handled but large decoupling capacitors and as far as
I can tell no strain is being put on the power supply. The microcontroller performs
normally whereas I have had sporadic reboots if a power line gets too noisy. I
have a feeling that there is a ramp up time from when I first send a bit out to burn
a dot and before the head temperature rises and that this adds to the required 'on'
time.
On the subject of paper ejection, I'm really interested in how you managed to get
a true movement of one vertical line. As the head moves back from various positions
I have noticed that the paper cannot be forwarded unless the head has reached the
Xth horizontal position. If you do a head return from X - ? position the paper does
not feed all the way. Is this the method you employ? Is it consistent across
printers? Looking at the construction of the units I would not have thought that
there would be enough consistency to give you that amount of control. Interesting.
I haven't got any sophisticated measuring equipment, but I take it that your figure
of 500mA is an average? My power brick is only rated at that level and there
is the microcontroller to take into account. I can only assume that it is the
decoupling capacitors that are smoothing out the peaks. I see very little ripple on
the power lines during operation.
Further :-
> You raise some interesting points, I'd love to see your schematic if you
are
> at
> liberty to show it too me. Even better would to be able to put it up on the
> website
> for others to see. If you agree to this, would you like to be created? Name?
> Email?
These are the schematics that were included with the printer, as well as
the ones downloaded from the All Electronics website. So, they are no
secret. :)
> I've just taken a look at the tech spec downloaded from Allelectronics
> website.
> Are we getting confused over term here? That diagram shows one chip for the
> dots and one chip for the motor. Contained in the dot chip are my eight
> drivers
> and the motor chip is a stepper driver which contains four drivers and
> control
> circuitry. Since I wanted direct control over the motor and I had the
> processing
> capabilities on the microcontroller I decided to "go it alone" on the motor
> drive.
>
> I agree with you about driving all the dots at once and that I use excessive
> timings, but I came to this solution after experimentation and measurement.
> The
> high currents can easily be handled but large decoupling capacitors and as
> far as
> I can tell no strain is being put on the power supply. The microcontroller
> performs
> normally whereas I have had sporadic reboots if a power line gets too noisy.
> I
> have a feeling that there is a ramp up time from when I first send a bit out
> to burn
> a dot and before the head temperature rises and that this adds to the
> required 'on'
> time.
Yes, even the specs recommend large capacitors for the head dots,
although the sample schematic (part of an actual commercial product)
does not show them to the degree of the recommened size.
> On the subject of paper ejection, I'm really interested in how you managed
> to get
> a true movement of one vertical line. As the head moves back from various
> positions
> I have noticed that the paper cannot be forwarded unless the head has reached
> the
> Xth horizontal position. If you do a head return from X - ? position the
> paper does
> not feed all the way. Is this the method you employ? Is it consistent across
> printers? Looking at the construction of the units I would not have thought
> that
> there would be enough consistency to give you that amount of control.
> Interesting.
Yep, basically, there are 3 positions where you can move the head to and
return, all rotating the paper feed at equal 1/3rd distances. This is
consistant with all of the printers since each uses the same gear drive
setup that "slips" past one tooth of the gear depending on where the
head is located.
> I haven't got any sophisticated measuring equipment, but I take it that your
> figure
> of 500mA is an average? My power brick is only rated at that level and there
> is the microcontroller to take into account. I can only assume that it is the
> decoupling capacitors that are smoothing out the peaks. I see very little
> ripple on
> the power lines during operation.
The 500ma is a high figure. Each dot element needs to have 375ma of
current applied (no more or excessive current will lead to premature
death). You could have less current and reduce the intensity of the
dot, although this would be difficult to control. If you just setup the
output driver (I am using eight 2N2222A transistors) with current
limiting, you can output whatever current you like. The micro uses next
to nothing, and the power supply uses about 6ma of current. So, a 500ma
output power supply will handle the entire circuit with room to spare.
///////////////////////////////////////////////////////////////////////
Question:-
First, the paper guide problem you
mentioned. What did you do to deal with this problem?
Second, the three Head Rank pins on the 20-pin printer interface
connector, pins 18, 19 and 20. I see you left these pins unconnected.
I am not exactly sure what these pins are for since I am unfamiliar
with thermal print head design and interfacing though it seems I am about
to learn. :-) Can you tell me what these pins are for and why you
thought it best to leave them unconnected?
Answer:-
Yet again I have to admit that my solution is not one that I would recommend to
anyone
using this product in an industrial (or academic) environment. I cut a piece of
wire coat
hanger and bent it into shape to hold the paper roll then attached it to the
chassis.
The main problem (apart from the esthetic side) is that it is not a perfectly
stable paper
holding platform. Sometimes the printer seems to drag one side of the paper more
than
the other and the resulting skew results in either a paper trap or the head not
fully
repositioning itself for the next line.
If you come up with a better solution I'd love to hear about it!
As to the Head Rank, I seem to remember that from the datasheet :-
That cutting certain tracks would alter the head resistance (and hence the power
taken
to actuate the head). After trial and error I took the path of least resistance
(pun intended)
and leave that section alone. My drivers had enough current to spare. There are
equations
later on in the document that specify how long the "burn" time should be for
each vertical
row of dots, but again I took the practical approach and started with a low time
and
increased it until I got a readable print. The software was altered with this
fudged time.
It would be nice to add to the debug code a section where the time could be
tinkered
with and then the value stored in EEPROM.
Further :-
The head rank is the way the OEM controller knows what kind of printer is connected. The same OEM controller works on a number of different type printers. I.e.: 16, 24 or 40 characters wide. I don't see a use for it an off type project.
///////////////////////////////////////////////////////////////////////
Question:-
Where do you get your thermal print paper for this printer?
Answer:-
I get mine at Staples. It's an NCR brand, 57mm X 50m size. Comes in a three
pack.
I'm sure that any correct width paper would do though (as long as it was
thermal. Don't
laugh I bought a few rolls that were for ink printing. Duh!).
Nigel