header photo

Polargraph Commands

 

The Commands

It is probably not a bad idea to first understand the commands which are sent over the serial port (57'600 baud).

Each command is terminated with ,END, which we omit in this table to improve readability.

CMD Command Remark
C01, L, R CHANGE LENGTH  
C02,F CHANGE PEN WIDTH initial value: 0.8
C03 CHANGE MOTOR SPEED  
C04 CHANGE MOTOR ACCELERATION  
C05, L, R, N, N DRAW PIXEL GRID SIZE, DENSITY (0..255)
C06, L, R, N, N DRAW SCRIBBLE PIXEL GRID SIZE, DENSITY (0..255)
C07 DRAW RECT not implemented
C08, N,N CHANGE DRAWING DIR MODE,DIRECTION
C09,L,R SET PEN POSITION  
C10 TEST PATTERN  
C11,N,F,F,F TEST PEN WIDTH SQUARE GRID SIZE,PEN START, PEN END, PEN INC
C13 PEN DOWN  
C14 PEN UP  
C17,L,R,N MOVE DIRECT  
C24,N,N SET MACHINE SIZE MACHINE WITH, MACHINE HEIGHT (goes to eeprom)
C25,PGXXABCD SET MACHINE NAME (goes to eeprom)
C26 GET MACHINE DETAILS  
C27 RESET EEPROM  
C29,N SET MACHINE MM PER REV 95 (goes to eeprom)
C30,N SET MACHINE STEPS PER REV 400 (goes to eeprom)
C31,N SET MOTOR SPEED initial value: 600
C32,N SET MOTOR ACCELERATION initial value: 400
C37,N SET MACHINE STEP MULTIPLIER 8 (goes to eeprom)
additional command for the mega
C12 TEST PEN WIDTH SCRIBBLE  
C16,L,R,N,N DRAW CIRCLE PIXEL GRID SIZE, DENSITY (0..255)
C21,L1,R1,L2,R2 SET ROVE AREA  
C28 DRAW DIRECTION TEST  
C33 MODE STORE COMMANDS  
C34 MODE EXEC FROM STORE  
C35 MODE LIVE  
C36 RANDOM_DRAW  
C38,N,sprite START TEXT  
C39 DRAW SPRITE  
C40 CHANGE LENGTH RELATIVE  
C41 SWIRLING  
C42 DRAW RANDOM SPRITE  
C43 DRAW NORWEGIAN  
C44 DRAW NORWEGIAN OUTLINE  

Meaning of command-parameters:

  • L,R - native coordinates for the left and right stepper
  • X, Y - Cartesian coordinates
  • N - integer number
  • F - floating number

The Hidden Feature

On the right side of the window form the controller program you always see the commands send to the server. If you want to see what comes back from the server, press "c". This will open a new window which shows what the server sends back.

Python for Nodebox

This little Python script is based on the program PG_preview.cpp from A. Kinsman 12/23/11. We adapted it for the for Nodebox 1.9.7rc1 in order to understand the commands and to quickly test the output from the polargraphcontroller.app.

Here is some sample output: