Hybrid Computer

From TheAnalogThing

Hybrid computers

A hybrid computer is a computer consisting of an analog computer and a digital computer. The two worlds are connected with ADCs/DACs (analog to digital/digital to analog converters).

A simple Arduino based hybrid controller

Hc setup.jpg

This section describes a simple yet quite powerful hybrid computer consisting of THE ANALOG THING and an attached Arduino Mega 2650 micro controller board. Since THE ANALOG THING features a dedicated connector for attaching an external digital computer, only a few connections between this HYBRID connector and the Arduino are required to setup the hardware:

Caption text
HYBRID pin description destination on Arduino
2 analog x output AnalogIn 0
4 analog y output AnalogIn 1
6 analog z output AnalogIn 2
8 analog u output AnalogIn 3
9+10 GND GND
13 enable hybrid mode D2
14 MOP D3
16 MIC D4

These connections were made using a piggy back board suitable for an Arduino Mega 2650 which only contains a 2x8 pin header and the connections listed in the above table:

Arduino hc.jpg

(As tempting as it may be to power THE ANALOG THING by the 5V line of the Arduino - this does not work since the current requirement of the THAT is too high at about 300 mA which causes a substantial voltage drop, leaving only about 4.4 V at THE ANALOG THING which is not quite enough for correct operation. Thus, THE ANALOG THING should always be powered by a dedicated power supply with a USB-C cable while the Arduino is powered by its own USB-connection to the host computer.)

Software

The required software for this hybrid controller can be found at [1]. It requires two additional libraries, TimerThree and TimerFive, to compile. These two timer libraries are necessary for the accurate timing of operating modes and data logging and must be installed for your Arduino IDE before compiling the source.

Commands

  • arm: Arm the data logger. Data logging can be performed during a single run (see below) and will automatically start when the logger has been armed before starting the single run. After completing the single run, the logger is disarmed again.
  • channels=value: Set the number of analog channels to be logged. The value can range between 1 and 4.
  • disable: Disable the hybrid controller. This is the normal startup mode; THE ANALOG THING will work as a standalone analog computer when the hybrid port is disabled.
  • enable: Enable the hybrid controller. In this case, THE ANALOG THING is is under control of the attached microcontroller and the mode switch is disabled.
  • halt: Put THE ANALOG THING into HALT-mode.
  • help: Print a short help text.
  • ic: Set THE ANALOG THING to IC-mode.
  • ictime=value: Set the IC-time to value milliseconds. This is necessary for any single or repetitive run. Typically the duration of IC-mode is a few milliseconds. (If there are any integrators in an analog program with their time scale factor set to SLOW, the IC-time should be high enough so that these integrators can settle to the selected initial condition.)
  • interval=value: Set the sampling interval for the data logger to value milliseconds.
  • op: Set THE ANALOG THING to OP-mode.
  • optime=value: Set the OP-time to value milliseconds.
  • rep: Start repetitive operation. THE ANALOG THING will from now on cycle between IC and OP with the respective times set by the ictime and optime commands. Repetitive operation is ended when the computer is explicitly set into IC-, OP- or HALT-mode.
  • run: Start a single run with the IC- and OP-phase duration determined by the times set with the ictime and optime commands. Only during such a single run data logging is possible.
  • status: Return status information.

Typical operation

A typical sequence of commands to run an analog program once while collecting data looks like this:

ictime=50
optime=3000
interval=5
channels=1
arm
enable
run

This will print the AD converted values during the single run. These can then be copied to a file (by copy/paste) and plotted with gnuplot or the like.

The analog program shown in the picture at the beginning is a Hindmarsh-Rose model of a bursting and spiking neuron. [2] Plotting the data captured with the sequence of commands shown above with gnuplot yields a result like this:

Hindmarsh rose x.jpg