mmz

command module
v0.0.0-...-f7e302d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 13 Imported by: 0

README

mmz

Build Status Build status Coverage Status

Command line interface to configure and log data for a Manzanita Micro Zilla controller.

Usage

Download the executable for your chosen platform from the releases page. Feel free to rename the executable to mmz or mmz.exe depending on your chosen platform.

You will need to know the location of the USB serial port which the dongle is plugged into. The MK3 Digital Perl Scanner Software documentation describes how to find this for Windows as a COM port number. For Unix based systems you can use dmesg | grep tty as described in the link.

Examples
mmz -dongle /dev/tty.usbserial-A904RBQ7 -settings

mmz -dongle /dev/tty.usbserial-A904RBQ7 -realtime

mmz -dongle /dev/tty.usbserial-A904RBQ7 -cmd ./samples/set_settings.yaml

Options

Dongle Location (required)

The path to the USB port where the Hairball is connected.

mmz -dongle /dev/tty.usbserial-A904RBQ7
Path to Commands File

The path to the file containing the commands to execute against the Zilla. Available commands are listed in the all_commands.yaml file.

mmz -dongle /dev/tty.usbserial-A904RBQ7 -cmd ./samples/set_settings.yaml
Send Raw Command

Send a command as detailed in the Zilla DC Motor Controller and Hairball 2 Manual.

mmz -dongle /dev/tty.usbserial-A904RBQ7 -raw "XXX"
Settings

Prints the current setting values applied to the controller.

mmz -dongle /dev/tty.usbserial-A904RBQ7 -settings

Outputs YAML to stdout with the following structure;

BatteryAmpLimit               int      // a) BA
LowBatteryVoltageLimit        int      // v) LBV
LowBatteryVoltageIndicator    int      // i) LBVI
NormalMotorAmpLimit           int      // a) Amp
SeriesMotorVoltageLimit       int      // v) Volt
ReverseMotorAmpLimit          int      // i) RA
ReverseMotorVoltageLimit      int      // r) RV
ParallelMotorAmpLimit         int      // c) PA
ParallelMotorVoltageLimit     int      // p) PV
ForwardRpmLimit               int      // l) Norm
ReverseRpmLimit               int      // r) Rev
MaxRpmLimit                   int      // x) Max
RpmSensorMotorOne             bool     // a) On
RpmSensorMotorTwo             bool     // b) On
AutoShiftingSeriesToParallel  bool     // c) On
StallDetectOn                 bool     // d) On
BatteryLightPolarity          bool     // e) Off
CheckEngineLightPolarity      bool     // f) On
ReversingContactors           bool     // g) On
SeriesParallelContactors      bool     // h) On
ForceParallelInReverse        bool     // i) Off
InhibitSeriesParallelShifting bool     // j) Off
TachometerDisplayMotorAmps    bool     // k) Off
TachometerSixCylinders        bool     // l) Off
ReversesPlugInInputPolarity   bool     // m) Off
ActivateHEPI                  bool     // n) Off
notUsed                       bool     // o) Off
IsZ1k                         bool     // p) Off
CurrentState                  string   // 1311
Errors                        []string // 1111, 1111, ...
Realtime

Prints the current state of the controller every 100ms.

mmz -dongle /dev/tty.usbserial-A904RBQ7 -realtime

Outputs YAML to stdout with the following structure;

Timestamp                      int64
RxCtrlFlagByte                 int
AverageCurrentOnMotor          int
AvailableCurrentFromController int
ArmDC                          int
BatteryVoltage                 int
MotorVoltage                   int
ControllerTemp                 int
SpiErrorCount                  int
CurrentError                   string
OperatingStatus                int
MotorKilowatts                 float64
StoppedState                   bool
ShiftingInProgress             bool
MainContactorIsOn              bool
MotorContactorsAreOn           bool
DirectionIsReverse             bool
DirectionIsForward             bool
MotorsAreInParallel            bool
MotorsAreInSeries              bool
MainContactorHasVoltageDrop    bool

Setup Development Environment

Requires a Go environment.

git clone git@github.com:ricallinson/mmz.git $GOPATH/src/git@github.com/ricallinson/mmz
cd $GOPATH/src/git@github.com/ricallinson/mmz
go get ./...
go install

Test

cd $GOPATH/src/git@github.com/ricallinson/mmz
go test

Code Coverage Report

cd $GOPATH/src/git@github.com/ricallinson/mmz
go test -covermode=count -coverprofile=count.out; go tool cover -html=count.out

Help

Connecting to Hairball Directly

On a UNIX based system you can directly connect to the hairball from a terminal session.

screen /dev/tty.usbserial

Exit from Hairball CTRL + A + \.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL