[Tutor] Pen plotter data format

Phil phillor9 at gmail.com
Fri Mar 31 23:54:23 EDT 2023


On 1/4/23 11:54, Cameron Simpson wrote:

Thank you Cameron and also Dennis for the links. I should get some 
inspiration from them.

>
> Why in threes?
The original plan was to build a plotter with at least a 100mm x 100mm 
drawing surface. However, due to the parts that I have on hand plus some 
parts that are in the mail somewhere that area has been reduced so I 
will now only need to pass a two digit coordinate byte.
>
> Is this approach deficient because there's no delimiters, so if you're 
> out of sync you misinterpret x as y etc?
I haven't included a method that prevents getting out of sync but that's 
not a problem.
>
>> I'm thinking that a better approach might to send an x byte, for 
>> example, like this "x, 123"
>
> I'd be inclined to drop the comma.
The comma is part of a gcode line but it's easily removed.
>
>> and have the micro-controller separate the value.
>
> It's running software of your own, in Python, receiving the data?
Yes.
>
>> Currently, the micro-controller only accepts data and moves the 
>> motors and doesn't perform any processing.
>>
>> Something like this might be better:
>>
>> if cmd starts with 'x';
>>     strip off the coord value
>>     run the motor to that coord
>>
>> if cmd starts with 'y':
>>     etc
>>
>> if cmd starts with 'z':
>>     lift or lower pen
>
> Sounds ok.

The more I think about the more I think so too. The sweat is dripping 
off me at the moment so I'll leave further experimenting until tonight.


> I happened to look at HPGL recently for a job application and IIRC it 
> has pen-up motions (to x,y) and pen-down motions (to x,y). (And pick a 
> pen colour, etc etc etc.)

Dennis mention HPGL too. I'll look into that as well.


> I think you need to describe what's going on with the micro-controller 
> a bit more. Is there a reason you can just progressively read the 
> G-Code and stream instructions to the micro-controller as parsed? Do 
> you need to wait for the micro-controller to physically perform the 
> motions?

After the micro-controller has received a byte and moved the motor it 
send an acknowledgement back to the laptop signalling that it's ready 
for the next byte.

>
>
>> I don't know what format pen plotters normally receive their data in 
>> and I'm hoping that someone may know. An Internet search hasn't 
>> helped so far.

> No docs for your plotter? Or have you complete control?

I'm building a plotter from scratch using Lego parts and I'm not using 
the Lego software. It's just a project to keep me out of mischief and I 
doubt the plotter will ever serve a useful function. I'll be pleased if 
it produces a reasonable plot.

-- 

Regards,
Phil



More information about the Tutor mailing list