Notes on Electronics Project

Table of Contents

1 PREPENDIX: Useful links

2 PREPENDIX: Terms of art

  • ESC: Electronic speed control

3 We have one faulty board and are scared by a spark

  1. We have boards which connect to the various motors.
  2. We solder an ethernet jack and the four wires of the stepper motor to a board. As shown in the video, the four wires of the motor are internally connected to two pairs of pins. You use the multimeter to determine which pairs of wires are connected to each other. Then, you solder them to the board so that connected wires are adjacent to each other: A,A;B,B.
  3. "Stepper 23" board. Stepper 23 is the type of motor. 23 indicates the size of motor. The board is named after the motor it connects to.
  4. We have a power supply but do not know how to use it safely. It has screw attachments for AC high, neutral, and low (presumably from the wall), and for DC high out and DC low out. It seems dubious to simply thread wires through screws at wall voltages, so we don't.
  5. Instead, we retrieve a different power supply that has actual aligator clips. We turn on the machine. We connect V+ to + and gnd to -. The connection sparks, and we turn off the machine. (What we ought to have done was connect the supply first, then turn on the power.)
  6. We try with a different board (because we didn't initially realize that the spark was a nonfatal problem). Turning on the power supply at 24V creates a jet of grey smoke from a component on the board (which we later determine is the voltage regulator). We turn off the power supply.
  7. We attempt ramping up from 12V to 24V to see how that fares. At around 20V, it creates additional smoke. We turn off the power supply.
  8. We test the magnitude and polarity of the voltage being supplied. It is correct.
  9. We test connectivity of the board itself. The smoky ATK stepper board is 20Ω — oops! at 20V, this is basically a short circuit. In contrast, the other stepper board is 5 MΩ. It is unclear whether the board was damaged to begin with
  10. We look at the datasheet for the buck converter. We use a magnifying glass to read the identifier of the component we fried. It is 3001208097.
  11. We begin to suspect that the spark was a mostly-harmless consequence of the way we turned on the power before attaching leads, rather than attaching before turning on the power. We plug in the board and send power. The light turns on. We prepare to try programming.
  12. (Our current standing is that we have one fried chip which we will try to replace later, and one apparently-functioning chip that temporarily scared us away by sparking. We have a power supply with screw terminals that we do not know how to use, and another power supply with alligator clips.)

4 Chapter two

  1. Atmel ICE is a programmer. It can talk PDI. Check application notes ("datasheet" for device).
  2. We download the Atmel programming environment per the instructions on the website, although we resolve to run the workflow through non-proprietary avrdude, time permitting.
  3. We replace the default (nearly empty) main.c file with the main.c file supplied by Jake on the website. The circuit doesn't work.
  4. Within the ATMEL programming environment, we have to manually rebuild the project so that
  5. XMEGAs don't choose clock sources via fuses. You can change clock source in your startup software.
  6. Interlude: we learn how to use the screw-terminal power supply. Limiting the strain by taping the wire to the board. Fuse in series with the live wire:
    ===[+]------[fuse]------[+]===
    ===[-]------------------[-]===
    
  7. TA confirms that most multimeters are safely rated for testing 24V supplies. (Incidentally, For testing wall voltages, one uses a non-contact measurer. It senses field at a distance. For this reason, it only works on AC — DC produces a magnetic field but the field doesn't change so it can't induce current in a neighboring probe wire.)

Atmel development environment has its own standard library which may or may not have a different API. PDI header is proprietary.

Connecting to AVR and SAM target devices.

The proprietaryness is a property of the programmer; avrdude can probably talk PDI to boards.

The way the network works is you plug the router into the computer. It has a ton of ethernet ports on it, and each one connects to a board that controls a motor, whether it's the stepper board or the spindle board (which controls the spinning bit). Stepper 23 boards are made to size to fit the stepper 23 motors. There are sort of free-form modular boards for the spindle motor. So the spindle controller has to be set up in hardware.

  • Router (1), Bread (2), Stepper (4, but one was destroyed)
  • [ ] Solder ethernet ports to boards.
  • [X] Put firmware for the atk router onto the board.
  • [ ] Assemble the breadboard according to the instructions on the website.
  • [ ] Get the router board to talk to the stepper and the breadboard. There is a mods-like server.
  • [ ] Get any firmware onto the breadboard
  • [ ] Program breadboard to talk to spindle motor. (Plug-looking model aeroplane motor.)
  • [ ] Program it.

4.1 Adventures in avrdude

  • According to the avrdude manpage: Atmel-ICE (ARM/AVR) is supported in all modes (JTAG, PDI for Xmega, debugWIRE, ISP).
  • avrdude -p ? produces a list of possible parts.
  • Reading the motor chip's part, I see that it is an ATMEL XMEGA 256 A3U, corresponding to the part entry x256a3u = ATxmega256A3U
  • Same process with the -c flag for determining the controller. Filtering for the ICE options yields:
    atmelice         = Atmel-ICE (ARM/AVR) in JTAG mode
    atmelice_dw      = Atmel-ICE (ARM/AVR) in debugWIRE mode
    atmelice_isp     = Atmel-ICE (ARM/AVR) in ISP mode
    atmelice_pdi     = Atmel-ICE (ARM/AVR) in PDI mode
    jtag1            = Atmel JTAG ICE (mkI)
    jtag1slow        = Atmel JTAG ICE (mkI)
    jtag2            = Atmel JTAG ICE mkII
    jtag2avr32       = Atmel JTAG ICE mkII im AVR32 mode
    jtag2dw          = Atmel JTAG ICE mkII in debugWire mode
    jtag2fast        = Atmel JTAG ICE mkII
    jtag2isp         = Atmel JTAG ICE mkII in ISP mode
    jtag2pdi         = Atmel JTAG ICE mkII PDI mode
    jtag2slow        = Atmel JTAG ICE mkII
    jtag3            = Atmel AVR JTAGICE3 in JTAG mode
    jtag3dw          = Atmel AVR JTAGICE3 in debugWIRE mode
    jtag3isp         = Atmel AVR JTAGICE3 in ISP mode
    jtag3pdi         = Atmel AVR JTAGICE3 in PDI mode
    jtagmkI          = Atmel JTAG ICE (mkI)
    jtagmkII         = Atmel JTAG ICE mkII
    jtagmkII_avr32   = Atmel JTAG ICE mkII im AVR32 mode
    

    Maybe atmelice_pdi = Atmel-ICE (ARM/AVR) in PDI mode is the right option?

sudo avrdude -px256a3u -c atmelice_pdi

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9842 (probably x256a3u)

avrdude done.  Thank you.

4.2 Getting dataflow machine controller working

Reference: https://gitlab.cba.mit.edu/jakeread/rndmc

  • Install node.js and npm (package manager).
  • Clone the repo at https://gitlab.cba.mit.edu/jakeread/rndmc
  • CD into the directory and run npm install to install from the repository's json file. (This works! fails, so install manually using npm install […] )
  • Confirm installation of cp210x usb to uart bridge vcp drivers. When I run modinfo cp210x on my linux machine, the kernel module appears to be installed.
  • Run node main to start the server.
  • Navigate web browser to localhost:8080.

5 Sending signals over ethernet

  • We prepare a few more ethernet cables.
  • We install node js and the necessary node modules for Jake's rndmc.
  • We are unsure what to connect to what so as to send messages to the motor via the network controller.
  • We discover a microusb port on the network board. It is a usb-to-uart converter, according to Jake's page. We decide that the computer sends software commands to the board from usb on the computer to microusb on the board.
  • We can't plug in the microusb cable because there isn't enough space—the plastic head runs into the side of the board. Fortunately, that part of the board is actually removable! It's a thin piece of plastic attached via a pre-perforated shear line. We pry it off with pliers, being careful not to damage or bend the rest of the chip. Then it plugs in.
  • The nodejs server fails to connect due to permissions error. As a stopgap, it connects to usb when run as root.
  • Nothing happens when we attempt to test each node in the sample network.
  • We send a bug report:

We are stuck on attempting to send signals from the computer to the network board to a servo board.

  • Network board is powered by usb and shows up properly as Bus 001 Device 009: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
  • RNDMC is running on nodejs, and is able to find and open the port ttyUSB0.
  • However, nothing seems to happen when we attempt to test the network, either when using the built in network program template, or by wiring up our own network with a single servo motor.
  • We are unsure how to send the test signal 127 through this interface, so we resorted to using pyserial. We attempted to send a single byte [127] and listen for a response, but didn't get any. The only parameters of the Serial object I set was the baud rate (250000), which I found in the atkseriallink.js file.
  • We are unsure about which LED is supposed to be toggled anyways in response; we assume it's the error LED on the network board.

6 Turning the breadboard into a spindle motor driver.

7 Experiments with the working network

Here's an empirical experiment to determine which of our new motors is functioning, attempting to limit external factors.

In preparation: Connect the network board to the computer via microusb. Prepare to run rundmc in a terminal. Ensure that power supply will supply more than 12V and less than 24V. Check all cables for connectivity.

  1. Turn off the power supply, if on.
  2. Quit the rundmc server, if running.
  3. Wire motor to power supply.
  4. Connect motor to network board.
  5. Turn on power supply.
  6. Turn on the rundmc server.
  7. Refresh the browser page.
  8. Create the atkstepper module.
  9. Click "Find and connect" to find the tty port.
  10. Set the address for the stepper module (0,n)
  11. Send a test network command.
  12. If successful, send a test motor command.
  13. Go to step #1.
Motor id Network address Test network Test motor
A (0,1) success success
B (0,1) success success
C (0,1) success success
D (0,1) success flashing yellow, but no motor motion. no resting motor stiffness (no power?)
E (0,1) success success
spindle (0,0) success [TBD]

To test the spindle motor, we attached a ribbon cable to a six-pin header and plugged it in. We used a multimeter (not the best tool for the job but most convenient) to measure the average voltage being send via pulse-width modulation to the spindle motor pins on the breadboard. The middle pin is high; one of the other pins is low; and the third is the signal from the microcontroller. We wanted to measure the difference between the microcontroller signal and ground.

Network setup

We have four stepper motors (A, B, C, E) and one spindle motor (spindle).

Six things need power: the four stepper motors, the spindle motor, and the spindle motor's electronic speed control (ESC).

[Y axis] A --- B     (0,0) (0,1)
[X axis] C            (0,2)
[Z axis] E --- spindle --- ESC  (0,3) (0,4)

Author: Electronics group

Created: 2018-11-20 Tue 20:58

Emacs 24.5.1 (Org mode 8.2.10)

Validate