Plotter data list
Archiver
Posts: 46,084
Sorry to be a pain again! but can anyone out there tell us how we go
about organising a data list to enable Basic stamp2 to tell our
plotter to draw simple alphabet characters?
Many thanks. Paul
about organising a data list to enable Basic stamp2 to tell our
plotter to draw simple alphabet characters?
Many thanks. Paul
Comments
>Sorry to be a pain again! but can anyone out there tell us how we go
>about organising a data list to enable Basic stamp2 to tell our
>plotter to draw simple alphabet characters?
>
>Many thanks. Paul
What kind of plotter do you have, and does it accept serial data as input?
>
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>
and a pen up/down, we have crude control of them, but would value help in
organising "data" for finer movements! It is interfaced to the Basic stamp2
board and the whole connected to a serial port.
If you can kick-start our programming in any way (or direction!) we will be
grateful.
Paul.
Original Message
From: "Bruce Bates" <bvbates@u...>
To: <basicstamps@yahoogroups.com>
Sent: Sunday, July 11, 2004 10:16 PM
Subject: Re: [noparse][[/noparse]basicstamps] Plotter data list
> At 08:45 PM 7/11/04 +0000, free22preach wrote:
> >Sorry to be a pain again! but can anyone out there tell us how we go
> >about organising a data list to enable Basic stamp2 to tell our
> >plotter to draw simple alphabet characters?
> >
> >Many thanks. Paul
>
> What kind of plotter do you have, and does it accept serial data as input?
>
> >
> >
> >
> >
> >To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> >from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
>Bruce, hello and thank you. The plotter has two steppers for XY movements
>and a pen up/down, we have crude control of them, but would value help in
>organising "data" for finer movements! It is interfaced to the Basic stamp2
>board and the whole connected to a serial port.
>
>If you can kick-start our programming in any way (or direction!) we will be
>grateful.
> Paul.
Paul -
Is this a home-brew plotter, that you have designed yourself, or a commercial product that you're trying to interface with the Stamp? If the latter, who manufactured it? Each plotter has a "language" that it understands. One popular format is HP/GL (Hewlett Packard Graphics Language) and you can find an introduction to that language here:
http://tech-diy.com/HP%20Graphics%20Language.htm
Bruce
attached is a sketch to show details. We understand we need to have a set of
X,Y data for each character we hope to draw, but where do we go from
there?
Original Message
From: "Bruce Bates" <bvbates@u...>
To: <basicstamps@yahoogroups.com>
Sent: Monday, July 12, 2004 10:02 AM
Subject: Re: [noparse][[/noparse]basicstamps] Plotter data list
> At 09:41 AM 7/12/04 +0100, Paul Haskew wrote:
> >Bruce, hello and thank you. The plotter has two steppers for XY movements
> >and a pen up/down, we have crude control of them, but would value help in
> >organising "data" for finer movements! It is interfaced to the Basic
stamp2
> >board and the whole connected to a serial port.
> >
> >If you can kick-start our programming in any way (or direction!) we will
be
> >grateful.
> > Paul.
>
> Paul -
>
> Is this a home-brew plotter, that you have designed yourself, or a
commercial product that you're trying to interface with the Stamp? If the
latter, who manufactured it? Each plotter has a "language" that it
understands. One popular format is HP/GL (Hewlett Packard Graphics Language)
and you can find an introduction to that language here:
> http://tech-diy.com/HP%20Graphics%20Language.htm
>
> Bruce
>
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
[noparse][[/noparse]Non-text portions of this message have been removed]
search on "HPCL" or "PCL", it's a text-based language that is pretty much
"pen up / pen down / move"
At 08:45 PM 7/11/04 +0000, free22preach wrote:
>Sorry to be a pain again! but can anyone out there tell us how we go
>about organising a data list to enable Basic stamp2 to tell our
>plotter to draw simple alphabet characters?
>
>Many thanks. Paul
>
Sean T. Lamont, Director Of Engineering
Innovative Communications Technologies, Inc. http://www.ict.net
email: lamont@a... / sean@i...
"Do not fear mistakes, There Are None" - Miles Davis
>Bruce , thanks for the link site, but our plotter is a "homebrew" plotter
>attached is a sketch to show details. We understand we need to have a set of
>X,Y data for each character we hope to draw, but where do we go from
>there?
This list doesn't support attachments, sorry. Your next stop, like it or not, is to design and implement some sort of language or syntax to "speak" to the Stamp if it is to be the interface engine. This is NOT an easy project, as the Stamp has limited string handling capabilities. That being said, use single alphabetic commands where possible, and your life will be much easier.
My suggestion would be to implement something simple like what follows:
SIMPLE PLOTTER SYNTAX
Movement Commands Parameters
F = Forward, B = Back, dd = Distance relative
U = Up, D = Down dd = distance relative
R = Right, L = Left aa = Angle
L = Locate x,y (exact position)
Pen Commands Parameters
P = Pen U = Up, D = Down, G = Get (color)
Initialization and Miscellaneous
H = Home or S = Synch
E = End, Stop, Idle
: Comment
With just that much, you should be able to draw any regular polygon, most or all simple block and single stroke letters (nothing fancy), have multiple colors,
be able to do bolding and underlining, and probably even more. The next step after that would probably be to implement a Subroutine command where you can define a new primitives (say SQUARE) from existing commands:
P G Bk : Fetch black ink pen
L=10,10 : Begin at actual location 10, 10
S = SQUARE : Subroutine Square
P D : Place pen on the paper
F 10 : Ink 10 units
R 90 : Turn right 90 degrees
F 10 : Ink 10 units
R 90 : Turn right 90 degrees
F 10 : Ink 10 units
R 90 : Turn right 90 degrees
F 10 : Ink 10, Last line
S E : Square subroutine end
P U : Lift pen
E : Idle for now
That's an overview of the human interface part. Now, you need to implement the machine (plotter) interface part. By way of simple example, Pen Up will cause a solenoid to lift the pen from the paper. Forward causes forward movement in the X direction, thus activating the X-Axis stepper motor. Back causes reverse movement in the X direction, thus activating the X-axis stepper in a negative direction. I suspect you get the picture by now. Angles cause the proportional use of both steppers.
Regards,
Bruce Bates
those variables into a data table. Then have your program read in the
different commands to send to the appropriate servos. Search the web for
animatronics, perhaps you will find a programming example.
Shawn
> [noparse][[/noparse]Original Message]
> From: Paul Haskew <PandL.Haskew@b...>
> To: <basicstamps@yahoogroups.com>
> Date: 7/12/2004 12:14:30 PM
> Subject: Re: [noparse][[/noparse]basicstamps] Plotter data list
>
> Bruce , thanks for the link site, but our plotter is a "homebrew" plotter
> attached is a sketch to show details. We understand we need to have a set
of
> X,Y data for each character we hope to draw, but where do we go from
> there?
Original Message
> From: "Bruce Bates" <bvbates@u...>
> To: <basicstamps@yahoogroups.com>
> Sent: Monday, July 12, 2004 10:02 AM
> Subject: Re: [noparse][[/noparse]basicstamps] Plotter data list
>
> >
> >
> >
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
then do we get from a list of data commands to seeing the motor(s) execute
them?
e.g.
from:
DO_A DATA 0, 100, 50, 0, 0, -50, -50, 0, 50, 0, 0, -50,
0, 0 ' X,Y movements for letter A
to
DO_X : ' Code to move X stepper
FOR X = 1 TO X
LOW 8 'direction X+
TOGGLE 1 'Xstepper
PAUSE 20
NEXT
This section of code is our best shot so far....
index var word
x var word
y var word
DO_A DATA 0, 100, 50, 0, 0, -50, -50, 0, 50, 0, 0, -50,
0, 0 ' X,Y movements for letter A
index = DO_A ' set start of data
READ Index, X ' read steps for x
READ Index+1, Y 'read steps for Y
DO_X ' Code to move X stepper X number of steps??????
FOR X = 1 TO X
LOW 8 'direction X+
TOGGLE 1 'Xstepper
PAUSE 20
NEXT
' Code to move Y stepper Y number of steps ???????
Index = Index + 2 ' move index up by 2
READ Index, X ' read steps for x
READ Index+1, Y ' read steps for y
LOOP WHILE ((X<>0) AND (Y<>0)) ' loop if 0,0 is not condition
As
always will be grateful for advice.
Paul Haskew
Original Message
From: "Bruce Bates" <bvbates@u...>
To: <basicstamps@yahoogroups.com>
Sent: Monday, July 12, 2004 10:59 PM
Subject: Re: [noparse][[/noparse]basicstamps] Plotter data list
> At 07:08 PM 7/12/04 +0100, Paul Haskew wrote:
> >Bruce , thanks for the link site, but our plotter is a "homebrew" plotter
> >attached is a sketch to show details. We understand we need to have a set
of
> >X,Y data for each character we hope to draw, but where do we go from
> >there?
>
> This list doesn't support attachments, sorry. Your next stop, like it or
not, is to design and implement some sort of language or syntax to "speak"
to the Stamp if it is to be the interface engine. This is NOT an easy
project, as the Stamp has limited string handling capabilities. That being
said, use single alphabetic commands where possible, and your life will be
much easier.
>
> My suggestion would be to implement something simple like what follows:
> SIMPLE PLOTTER SYNTAX
> Movement Commands Parameters
> F = Forward, B = Back, dd = Distance relative
> U = Up, D = Down dd = distance
relative
> R = Right, L = Left aa = Angle
> L = Locate x,y (exact
position)
>
> Pen Commands Parameters
> P = Pen U = Up, D = Down, G = Get (color)
>
> Initialization and Miscellaneous
> H = Home or S = Synch
> E = End, Stop, Idle
> : Comment
>
> With just that much, you should be able to draw any regular polygon, most
or all simple block and single stroke letters (nothing fancy), have multiple
colors,
> be able to do bolding and underlining, and probably even more. The next
step after that would probably be to implement a Subroutine command where
you can define a new primitives (say SQUARE) from existing commands:
>
> P G Bk : Fetch black ink pen
> L=10,10 : Begin at actual location 10, 10
>
> S = SQUARE : Subroutine Square
> P D : Place pen on the paper
> F 10 : Ink 10 units
> R 90 : Turn right 90 degrees
> F 10 : Ink 10 units
> R 90 : Turn right 90 degrees
> F 10 : Ink 10 units
> R 90 : Turn right 90 degrees
> F 10 : Ink 10, Last line
> S E : Square subroutine end
> P U : Lift pen
> E : Idle for now
>
> That's an overview of the human interface part. Now, you need to implement
the machine (plotter) interface part. By way of simple example, Pen Up will
cause a solenoid to lift the pen from the paper. Forward causes forward
movement in the X direction, thus activating the X-Axis stepper motor.
Back causes reverse movement in the X direction, thus activating the X-axis
stepper in a negative direction. I suspect you get the picture by now.
Angles cause the proportional use of both steppers.
>
> Regards,
>
> Bruce Bates
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
>Bruce Bates thank you! Am working on movement routines as you suggest, how
>then do we get from a list of data commands to seeing the motor(s) execute
>them?
>e.g.
>
>from:
>
>DO_A DATA 0, 100, 50, 0, 0, -50, -50, 0, 50, 0, 0, -50,
>0, 0 ' X,Y movements for letter A
>
>to
>
>DO_X : ' Code to move X stepper
>FOR X = 1 TO X
>LOW 8 'direction X+
>TOGGLE 1 'Xstepper
>PAUSE 20
>NEXT
>
>This section of code is our best shot so far....
>
>index var word
>x var word
>y var word
>
>DO_A DATA 0, 100, 50, 0, 0, -50, -50, 0, 50, 0, 0, -50,
>0, 0 ' X,Y movements for letter A
>
>
>index = DO_A ' set start of data
>READ Index, X ' read steps for x
>READ Index+1, Y 'read steps for Y
>
>DO_X ' Code to move X stepper X number of steps??????
>FOR X = 1 TO X
>LOW 8 'direction X+
>TOGGLE 1 'Xstepper
>PAUSE 20
>NEXT
>
>' Code to move Y stepper Y number of steps ???????
>
>Index = Index + 2 ' move index up by 2
>READ Index, X ' read steps for x
>READ Index+1, Y ' read steps for y
>LOOP WHILE ((X<>0) AND (Y<>0)) ' loop if 0,0 is not condition
>
>
> As
>always will be grateful for advice.
>
>Paul Haskew
Paul -
If you are only doing a fixed number of things (just alphabetics and numerics)
I suppose DATA statements might work well. If not, you may have to build arrays on the fly to use for the date which is parsed from the user input. If you run out of variables or internal EEPROM during this process, you might consider storing the parsed tables in external EEPROM and reading them back in as needed. Review I2CIN and I2OUT for using an I2C EEPROM if needed.
One very powerful facility in the latest Stamp Editor is the CASE statement, which might help you immensely in your parsing efforts. Check it out in the PBASIC Stamp manual or in the online help facility of the editor.
I honestly didn't go through your programming line by line, but the general flow of the program suggests to me that you've got the right idea.
Regards,
Bruce Bates
>
Original Message
>From: "Bruce Bates" <bvbates@u...>
>To: <basicstamps@yahoogroups.com>
>Sent: Monday, July 12, 2004 10:59 PM
>Subject: Re: [noparse][[/noparse]basicstamps] Plotter data list
>
>
>> At 07:08 PM 7/12/04 +0100, Paul Haskew wrote:
>> >Bruce , thanks for the link site, but our plotter is a "homebrew" plotter
>> >attached is a sketch to show details. We understand we need to have a set
>of
>> >X,Y data for each character we hope to draw, but where do we go from
>> >there?
>>
>> This list doesn't support attachments, sorry. Your next stop, like it or
>not, is to design and implement some sort of language or syntax to "speak"
>to the Stamp if it is to be the interface engine. This is NOT an easy
>project, as the Stamp has limited string handling capabilities. That being
>said, use single alphabetic commands where possible, and your life will be
>much easier.
>>
>> My suggestion would be to implement something simple like what follows:
>> SIMPLE PLOTTER SYNTAX
>> Movement Commands Parameters
>> F = Forward, B = Back, dd = Distance relative
>> U = Up, D = Down dd = distance
>relative
>> R = Right, L = Left aa = Angle
>> L = Locate x,y (exact
>position)
>>
>> Pen Commands Parameters
>> P = Pen U = Up, D = Down, G = Get (color)
>>
>> Initialization and Miscellaneous
>> H = Home or S = Synch
>> E = End, Stop, Idle
>> : Comment
>>
>> With just that much, you should be able to draw any regular polygon, most
>or all simple block and single stroke letters (nothing fancy), have multiple
>colors,
>> be able to do bolding and underlining, and probably even more. The next
>step after that would probably be to implement a Subroutine command where
>you can define a new primitives (say SQUARE) from existing commands:
>>
>> P G Bk : Fetch black ink pen
>> L=10,10 : Begin at actual location 10, 10
>>
>> S = SQUARE : Subroutine Square
>> P D : Place pen on the paper
>> F 10 : Ink 10 units
>> R 90 : Turn right 90 degrees
>> F 10 : Ink 10 units
>> R 90 : Turn right 90 degrees
>> F 10 : Ink 10 units
>> R 90 : Turn right 90 degrees
>> F 10 : Ink 10, Last line
>> S E : Square subroutine end
>> P U : Lift pen
>> E : Idle for now
>>
>> That's an overview of the human interface part. Now, you need to implement
>the machine (plotter) interface part. By way of simple example, Pen Up will
>cause a solenoid to lift the pen from the paper. Forward causes forward
>movement in the X direction, thus activating the X-Axis stepper motor.
>Back causes reverse movement in the X direction, thus activating the X-axis
>stepper in a negative direction. I suspect you get the picture by now.
>Angles cause the proportional use of both steppers.
>>
>> Regards,
>>
>> Bruce Bates
>>
>>
>>
>> To UNSUBSCRIBE, just send mail to:
>> basicstamps-unsubscribe@yahoogroups.com
>> from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>