CAN bus interface for OpenGrab - electro-permanent cargo holding magnet.
Based on libcanaerospace - open-source CANaerospace protocol implementation.
UAVCAN protocol support is scheduled for April 2014.
The set of CANaerospace messages used by this node is documented below. Note that the message IDs can be reconfigured via CLI.
- ID: 1820
- Type: CHAR
- Values:
- 0 - turn the magnet off
- 1+ - activate the magnet
- ID: 1821
- Type: CHAR
- Values:
- 0 - magnet OFF
- 1+ - magnet ON
- Transmission rate: 1 Hz
Grab your OGCAN hardware here: http://nicadrone.com/index.php?id_product=18&controller=product
Schematics and Gerber files are available in this repository; hardware design files are available upon request.
The firmware can be built with ARM GCC or any other GCC-based ARM toolchain.
- Place the libcanaerospace sources into the same directory with this repository.
- Build:
cd opengrab_can/firmware
make RELEASE=1
- Flash.
Use CLI via the TTL UART connector at 115200-8-N-1. Note that CLI will not be available unless the RX pin was pulled up at startup; that means that the UART cable must be connected before power-up.
Execute help
to get a short command reference.
Linux only! Clone and install the pycanbus library. This is the Python module that enables access to the CAN network under Linux.
Use script from the tools/
directory to switch the magnet or read it's state:
cd opengrab_can/tools
./canas_control.py <can-iface> # Simply prints all incoming CAN frames
./canas_control.py <can-iface> <0/1> # Sends the CANaerospace message to turn the magnet OFF/ON