[Tutor] Pen plotter data format

Dennis Lee Bieber wlfraed at ix.netcom.com
Sat Apr 1 20:09:06 EDT 2023


On Sun, 2 Apr 2023 09:45:30 +1000, Phil <phillor9 at gmail.com> declaimed the
following:

>
>I'm building the plotter from Lego parts so the motors are analogue and 
>not digital stepping motors. I don't expect much, it's just a project.
>
	Those are going to make things tricky -- different rotation speeds will
skew any plots, and you have no means of determining the location of the
pen. I'd refrained from bringing up a set of micro-switches for determining
"home" (0, 0) position.

>
>I started down that route when I first thought of building a plotter but 
>ended up deciding to go my own way. I believe what I now have will work.
>
>
>> def penUp(parameters):
>> 	try:
>> 		x, y = parameters.split(",")
>> 	except <pick the appropriate exception for too many/few parameters>:
>> 		return "Incorrect number of parameters provided; expected 2"
>
>Your suggestion is along the lines that I now have except for the try 
>and except blocks. I haven't built the pen lifting mechanism yet because 
>I'm waiting for parts and I only have a vague idea how I might build it 
>at the moment.

	Small servo motor and some sort of parallelogram arm (keeping the pen
vertical as the arm moves up and down). Does mean needing a PWM output
(another excuse to not use a costly R-Pi -- most microcontroller systems
have multiple true PWM outputs vs the simulation the R-Pi does, and you
might need some for motor speed control [suggestion: continuous rotation
servos; you shouldn't need to rig something to reverse the motor direction
as 50% PWM is "stop", <50% is one direction, >50% is the other])



More information about the Tutor mailing list