From cbf41dd4adbdac8bd1ce0288b94266342fb62609 Mon Sep 17 00:00:00 2001 From: Stephan Walter Date: Mon, 18 Oct 2010 20:28:08 +0200 Subject: [PATCH] document simulation --- README | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README b/README index 5056a03..bed0715 100644 --- a/README +++ b/README @@ -99,6 +99,30 @@ The fixed-point stuff is fun, although we have to manually ensure that the decim The PID code in heater.c is probably quite generalisable, and seems to work well when tuned. Google knows of plenty of PID tuning guides. +############################################################################## +# # +# Simulation # +# # +############################################################################## + +To compile the simulation code, use + + $ make sim + +The simulation program will open a serial port for communication. If you don't want to connect a null modem cable, you can use 'socat' to connect a virtual serial port to your terminal: + + $ socat -d -d PTY READLINE + 2010/10/18 20:24:33 socat[3700] N PTY is /dev/pts/2 + 2010/10/18 20:24:33 socat[3700] N using readline on stdin for reading and stdio for writing + 2010/10/18 20:24:33 socat[3700] N starting data transfer loop with FDs [3,3] and [0,0] + +On the first line of output, socat will tell you the name of the virtual serial port. Pass this as an argument to the simulation program (in another terminal): + + $ ./sim /dev/pts/2 + +Now you can send G-codes from the socat terminal. The simulation code will print any data sent via the firmware's serial interface. Stepper positions will be shown in green, counting a rising slope on the pin as one step. + + ############################################################################## # # # File descriptions # @@ -153,6 +177,9 @@ This file associates various functions with particular pins on your avr *** README this file +*** simulation.[sh] +helper code to run the code on any Unix PC + *** sender.sh A simple talker