Commit Graph

30 Commits

Author SHA1 Message Date
Markus Hitter 45baa75a5d CoreXY: tell config.h templates about KINEMATICS_COREXY. 2014-12-26 19:41:37 +01:00
Markus Hitter be0af71b2e CoreXY: distribute new KINEMATICS definition to all config.h templates. 2014-12-26 19:41:37 +01:00
Markus Hitter 9f618ee048 Testcases: add nothing.gcode.
This is for running stuff with run_in_simulavr.sh which needs no
G-code.
2014-10-18 20:59:41 +02:00
Markus Hitter e0ee76b54e heater.c: add a hysteresis when using BANG_BANG.
Before, the heater would turn off and on at each tiny temperature
fluctuation. Or better: at every tiny analog voltage fluctuation.
2014-10-18 20:58:35 +02:00
Markus Hitter 5cc84a069a Canned G-code: setup right in config.h.
This works with Arduino IDE as well and should be easier to figure
for inexperienced users.
2014-08-31 19:31:39 +02:00
Erik Jonsson 0723b53c44 run-in-simulavr.sh: terminate simulation if stop recieved.
Note by Traumflug: this

  while read -r LINE; do
    some commands
  done << (some other command)

didn't work here (bash 4.3.11 on Ubuntu 14.04), so I had to swap
the sequence of these two commands for using a pipe. Anyways,
excellent idea, shortens some simulator runs drastically!
2014-08-31 19:12:43 +02:00
Markus Hitter ec937adde2 run-in-simulavr.sh: move statistics to the end.
This is more convenient for obvious reasons, you no longer have
to search all the output for these few lines.
2014-08-31 19:10:48 +02:00
Markus Hitter 157a5a966b run-in-simulavr.sh: clean up tracein file after being done. 2014-08-31 19:10:39 +02:00
Markus Hitter ad82907b98 testcases: Add config.h.
There's nothing special about this config.h, it's just the one I
happened to use for first profiling investigations. To allow
everybody else to do the very same profiling runs, I add it here.

Doing profiling isn't too complicated:

  mv config.h config.h.backup
  ln -s testcases/config.h.Profiling config.h
  git checkout -b work
  git cherry-pick simulavr # add tweaks convenient for simulation runs
  make
  cd testcases
  ./run-in-simulavr.sh short-moves.gcode smooth-curves.gcode triangle-odd.gcode

After being done you can restore your config.h and delete this work branch.

Currently, performance is as following (with convenience commit applied):

    SIZES             ATmega...  '168    '328(P)    '644(P)    '1280
    FLASH : 20270 bytes          142%       66%        32%       16%
    RAM   :  2302 bytes          225%      113%        57%       29%
    EEPROM:    32 bytes            4%        2%         2%        1%

short-moves.gcode
Statistics (assuming a 20 MHz clock):
LED on occurences: 888.
Sum of all LED on time: 279945 clock cycles.
LED on time minimum: 306 clock cycles.
LED on time maximum: 722 clock cycles.
LED on time average: 315.253 clock cycles.

smooth-curves.gcode
Statistics (assuming a 20 MHz clock):
LED on occurences: 9124.
Sum of all LED on time: 3297806 clock cycles.
LED on time minimum: 311 clock cycles.
LED on time maximum: 712 clock cycles.
LED on time average: 361.443 clock cycles.

triangle-odd.gcode
Statistics (assuming a 20 MHz clock):
LED on occurences: 1636.
Sum of all LED on time: 546946 clock cycles.
LED on time minimum: 306 clock cycles.
LED on time maximum: 712 clock cycles.
LED on time average: 334.319 clock cycles.
2014-08-31 19:07:39 +02:00
Markus Hitter fdfd202e5d run-in-simulavr.sh: add statistics output for LED On Time.
As it's still a bit cumbersome to go through the whole .vcd file
to find the highest delay between On and Off, do this search
automatically and output an statistics. Can look like this:

  Statistics (assuming a 20 MHz clock):
  LED on occurences: 838.
  Sum of all LED on time: 262055 clock cycles.
  LED on time minimum: 306 clock cycles.
  LED on time maximum: 717 clock cycles.
  LED on time average: 312.715 clock cycles.

This should give an reasonable overview of wether and roughly
how much a particular code change makes your code slower or
faster. It should also show up showblockers, like occasionally
huge delays.

BTW., the above data was collected timing the step interrupt when
running short-moves.gcode with the current firmware.
2014-08-31 19:06:13 +02:00
Markus Hitter da08c35edd run-in-simulavr.sh: add support for timing measurements.
The idea is simple: if you want to time a portion of code
precisely, turn on the Debug LED (see config.h for
DEBUG_LED_PIN) at the start of sequence and turn it off when
done. Running this in SimulAVR, you have two flanges precise
to the clock cycle which exactly reflect the time taken to
run this code sequence. Ideally, you run this code n a loop
to get a number of samples, if it doesn't run in a loop anyways.

Time taken can then be measured in GTKWave. For convenience and
for a better overview, run-in-simulavr.sh also extracts all the
delays into it's own signal, so it can be viewed as an ongoing
number.
2014-08-31 19:06:05 +02:00
Markus Hitter 4389e670bd run-in-simulavr.sh: start signals undefined.
Also a few aesthetical corrections.
2014-08-31 19:05:56 +02:00
Markus Hitter 35c4949965 run-in-simulavr.sh: run SimulAVR a bit more verbose.
SimulAVR doesn't always work exactly the way it should, so looking
at the command line it's started with is a first debugging step.
2014-08-31 19:05:47 +02:00
Markus Hitter d94e3c7258 Testcases: add save file for GTKWave.
The nice thing about these save files is, they provide a display
for the data, so you simply load a .vcd, additionally read a
save file and you're ready to investigate your movement data.
2013-12-06 19:24:58 +01:00
Markus Hitter 06d496e8ca run-in-simulavr.sh: also output position in micrometers. 2013-12-06 19:24:58 +01:00
Markus Hitter f1873b4360 run-in-simulavr.sh: also record position.
So far only in steps.
2013-12-06 19:24:58 +01:00
Markus Hitter 3ad9ad5594 run-in-simulavr.sh: fix bitfield conversion.
No major thing, even numbers had the last bit set.
2013-12-06 19:24:58 +01:00
Markus Hitter c25547da15 Add a testcase for moves shorter than the acceleration ramps. 2013-12-06 19:24:58 +01:00
Markus Hitter f92b59365e Testcases review:
- comment on why the case exists,

- add an M2 at the end to later allow automatic simulation stop,

- move comments to the end to avoid filling the serial buffer with
  stuff unrelated to movements,

- make sure there's a line ending at the end of the file and

- use Windows line endings (they're more difficult to handle).
2013-12-06 19:24:58 +01:00
Markus Hitter 46526ecdda Add testcase for nullmoves.
Moves which have no movement intention, e.g. pure feedrate changes,
and moves too small to cause a single step, are a bit tricky to
handle with lookahead. Essentially, they should be joined with the
next movement, without queueing them up.
2013-12-06 19:24:58 +01:00
Markus Hitter fd5fe676f4 run-in-simulator.sh: express velocities in mm/min, too.
Uh, this bloats the resulting VCD file by 50% ... ;-)
2013-12-06 19:24:58 +01:00
Markus Hitter 5c0808732c run-in-simulator.sh: run (only) selected files. 2013-12-06 19:24:58 +01:00
Markus Hitter e559b59b54 run-in-simulator.sh: use stdin/stdout for the data file, too. 2013-12-06 19:24:58 +01:00
Markus Hitter 005a935adc run-in-simulavr.sh: also rewrite VCD file to add speed values.
This is quite handy, as you can see accurate speed ramps in
GTKWave now.
2013-12-06 19:24:58 +01:00
Markus Hitter 6e4bdc43ca Add a draft of a script running testcases in SimulAVR.
This script also asks SimulAVR to generate pin traces of the X
and Y axis and even processes this data into a data file with
time, position and current speed of each axis.

Missing:

- Acceleration calculation.

- LOTS of polish.
2013-12-06 19:24:58 +01:00
Markus Hitter b2e22c6d3b Add another testcase, add lookahead-warmup.
Lookahead-warmup = two lines of G-code which take just long enough
to allow the intended movements to be added with look-ahead.
2013-12-06 19:24:58 +01:00
Markus Hitter ff9fdafa3c Add another testcase, triangle-odd.gcode.
This was found to expose a bug, see Github issue #67.
2013-11-28 23:43:10 +01:00
Markus Hitter d0bea9b51a Add another look-ahead testcase. 2013-11-11 19:03:52 +01:00
Markus Hitter 89c85181f7 Add a testcase for look-ahead (smooth curves). 2013-11-11 19:00:31 +01:00
Markus Hitter 59e461104b Add a testcase with excessive digits left to the decimal.
Currently, Teacup can't handle this.
2013-11-11 12:25:17 +01:00