ChipShover Python API Documentation

ChipSHOVER is the Precision Position Producer, and consists of the full chain of a physical XYZ table, mounts, electronic controller, and Python interface. The control electronics (called ChipShover-One) are based on the Marlin 3D printer firmware, meaning they use standard G-Codes for PC based control of its position and various other functionality.

This Python API is designed as a simple way to control the ChipSHOVER-One from Jupyter notebooks or other Python scripts/programs. You can use this ChipShover Python API with other 3D printed based mainboards - we specifically used standard 3D printer firmware & G-Codes to make it easier to maintain the same Pythin API interface.

ChipShover API Documentation

For typical usage, after starting the ChipShover, you should first home the stepper motors. This serves as a calibration step:

Example

>>> from chipshover import ChipShover
>>> shv = ChipShover('COM5')
>>> shv.home()

From there, you can use the API to set the ChipShover’s position:

>>> shv.move(10, 20, 190) # x=10, y=20, z=190

Note that the Z-axis default position is typically 200 to start with.

The ChipShover can also be swept along the XY axis:

>>> for x,y in shv.sweep_x_y(0, 5, 0, 5, step=0.5):
        print("at %f, %f"%(x, y))

While using the ChipShover, it may become necessary to pause or stop the ChipShover. This can be done by either the stop or kill command. With the former, the ChipShover can continue on as usual after the stoppage; however, the latter will stop the ChipShover until it is power cycled.

>>> shv.stop() # can continue on from here with new movement commands
>>> shv.kill() # require a power cycle to continue operation

Note that if a stop command is used, the ChipShover’s measured position may become incorrect. As such, it is recommended that a homing command be performed after a stop is issued. In practice, the position seems to still be fairly accurate after a stop and so this is only recommended and not required.

If using most commands interactively (from a Jupyter notebook), hitting Ctrl-C should issue a stop() command. The assumption is if you interrupt the program with Ctrl-C that is because bad things were about to happen. Without the stop() command, the controller will finish executing the last command, such as a move.

class chipshover.cs.ChipShover(comport)[source]

ChipShover is a controller for XYZ tables. Assumes Marlin-based firmware for commands.

auto_program(fw_path=None)[source]

Erase and reprogram the chipshover

Args:
fw_path (str): Path to firmware. If none, use default firmware.

Defaults to None.

If com port detection fails, reprogramming must be done with firmware_update()

close()[source]

Closes serial port

erase_firmware()[source]

Erases the firmware of the SAM3X on the ChipShover

Reprogram with:

from chipshover import update_firmware
firmware_update("comport")
get_position(forcefinish=True)[source]

Gets the X/Y/Z position of the table.

By default will wait for any movement to finish, as reading position during movement will return incorrect (final not current) position.

home(x=True, y=True, z=True)[source]

Perform homing operation using G28 command.

Calling this will home the X, Y, and Z axis (you can disable specific axis as well). The command will block until the homing operation is complete.

kill()[source]

Calls KILL command (M112) to stop all movement.

This will stop all table movement and shut down the controller, requiring a power cycle to recover. Useful when you have a serious error condition you want to ensure someone physically clears.

move(x=None, y=None, z=None, debug=False)[source]

Move table to commanded X, Y, Z location.

Uses a G0 command to move the table. The function will use a M400 command to wait for the movement to complete before returning.

WARNING: The z is an absolute position - the default

home z is often the MAXIMUM value. Thus a move to z=0` may slam your table into the ground. You can use the move_zdepth() function for moving a depth from the home position instead.

move_zdepth(z_depth)[source]

Sets the Z axis to a given ‘depth’, as referenced from home.

The default Z-Axis homing sets the Z axis to some positive value, with Z = 0 being the axis bottom. Most of the time you’d like to specify depth below home position instead, this function lets you do that.

set_fan(fan_speed=100)[source]

Sets cooling fan speed, range of 0 - 100

status()[source]

Gets the status of the ChipShouter

This function CANNOT tell whether a fuse or emergency stop event has happened.

Statuses:
  1. Idle

  2. Unhomed

  3. 5V fuse blown

stop()[source]

Calls EMERGENCY STOP command (M410).

Stops movement, but allows further commands. Sending this will cause positionvto be wrong if table was moving at the time.

sweep_x_y(x_start, x_end, y_start, y_end, step=0.1, x_step=None, y_step=None, z_plunge=0)[source]

Sweep X-Y range, yielding at each point.

This function should be used in a simple sweep, for example:

for x,y in cs.sweep_x_y(0, 5, 0, 5, step=0.5):

print(“At %f, %f”%(x,y))

If you call your fault injection probe to active at the point, you will get a simple fault injection performed over a linear X-Y range.

The z_plunge parameter can be used to specify a certain amount of z-plunge performed at each point. This is normally used with BBI or similar probes that must be put in contact with the die.

If using interactive Python (Jupyter), hitting Ctrl-C during this function run will call stop() by default.

wait_done(timeout=5, debug=False)[source]

Wait for a command to be acknowledged by checking for ‘ok’ response.

Some G commands return immediatly, for example G0 returns an ‘ok’ and does not wait for the command to execute. Others will block until the command finishes executing, for example the homing operation (G28) does not return ‘ok’ until it is done.

By default if a KeyboardInterrupt is detected (from a Ctrl-C operation) then stop() will be called. This is done in case you are using ChipShover interactively and hit Ctrl-C to try and abort a move operation.

wait_for_move()[source]

Wait for current movement to be done

This documentation is part of the ChipShover Python API.

Permission is hereby granted, free of charge, to any person obtaining a copy of this ChipShover Python API software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ChipShover is a registered trademark of NewAE Technology Inc.

Indices and tables