# Probe Basic ATC Simulator

The stock atc_carousle subroutines are build around the pulse/index tool change,
so the gray-code carousel configs are untested and left as examples

Imperial and Metric version
vmc_index_inch.ini
vmc_index_metric.ini

Metric Machine Size
X 600mm
Y 200mm
Z 400mm

Imperial Machine Size
X 24"
Y 8"
Z 16"

Both machines have the X and Y home in the center of travel.

## Tool table

Both variants run the unified database tool table ([EMCIO] DB_PROGRAM =
./tool_db.sh, TOOL_DB_FILE = rack_inch_tool_table.db or
rack_metric_tool_table.db, custom_config.yml wires the DBToolTable plugin
with the mill extras table) instead of a flat-file .tbl -- LinuxCNC and the
tool page both read/write the same SQLite file, so they can never disagree.
The tool page gets the unified table editor: core columns, the Mill Extras
group, and user-defined custom columns (right-click the header).

To re-seed a database from a .tbl file:
    python3 -m qtpyvcp.lib.db_tool.import_legacy_tbl old.tbl new.db --units inch
(or use the Tools menu importers with Probe Basic running). To try a
different database file, point [EMCIO] TOOL_DB_FILE at it and restart.


## Original Vismach Readme
This is a Vismach simulator config intended for testing out tool-changer configurations
The Vismach model combined with the sim_vmc.hal file features three axes
with home and limit switches, a carousel with both gray-code and pulse/index outputs, 
a locking bar and a power drawbar. 
There are two alternative configs, one demonstrating gray-code carousel coding and the other demonstrating
pulse/index.
Note that the carousel component also supports straight-binary and individual sensors. 

The "virtual" VMC is created by the sim_vmc.hal file and defines the following signals
that my be used in the other HAL files

Axis positions
x-pos
y-pos
z-pos

Axis limits
x-pos-lim
x-neg-lim
y-pos-lim
y-neg-llm
z-pos-lim
z-neg-lim

Simulated Spindle
spindle-cmd - set spindle speed in rpm, negative for reverse
spindle-pos - the simulated spindle position (revs)
spindle-vel - the simulated spindle speed out

Toolchanger arm
arm-act - actuate the arm
arm-in - arm in limit switch
arm-out - arm out limit switch

Carousel lock
car-lock - activate the lock
car-locked
car-unlocked - limit switches

Drawbar
tool-release
tool-released
tool-locked

Carousel
car-fwd rotate clockwise
car-rev rotate anticlockwise
bit0
bit1
bit2
bit3
bit4 - Gray-coded carousel position 



