Commit 339b760b authored by Jake Read's avatar Jake Read
Browse files

1st

parents
jake/
**.elf
**.hex
**.bin
**.lss
**.map
**.srec
**.o
**.d
**.DS_Store
**.b#*
**.s#*
**/ASF/
embedded/atsams70-usbcdc/
embedded/usb-adafruit/
embedded/usb-xplained/
js/node_modules/
sim/js_code.txt
sim/TinyNets/nbproject/
# AutomataKit
AutomataKit is a collection of open hardware and software developed to enable non-experts (and experts) develop various machine-building, process development, and robotics projects.
All of these tasks require a similar subset of tools: motor control, sensor acquisition, motion coordination, power delivery, etc. AutomataKit offers solutions to most of these problems, and is always growing.
To make these tasks modular, Automatakit uses a very simple networking scheme to deliver commands and get feedback from various hardware endpoints. Hardware endpoints recognize low-level commands from controllers which can be written in any software package that can successfully communicate over USB to a serial port. There is virtually no limit to the number of endpoints that can make up a system.
## Examples
- reich
- motion
## The Network
- port-forwarding packet automata inner life and diagrams
## The Endpoints
- [ATKRouter](https://gitlab.cba.mit.edu/jakeread/atkrouter)
- [ATKStepper17](https://gitlab.cba.mit.edu/jakeread/atkstepper17)
- [ATKStepper23](https://gitlab.cba.mit.edu/jakeread/atkstepper23)
- [ATKBLDCDriver](https://gitlab.cba.mit.edu/jakeread/atkbldcdriver)
## Mods
- how to plug into / use mods / serial
## Interfacing with AutomataKit
- atkterminal app and /atkterminal
- command structures, general use w/ any given serial port
# Reproducing and Extending Automatakit Work
To reproduce Automatakit Circuits and software, see the [automatakit reproduction guide](reproduction)
# Documentation ToDo
- board projects should have BOMs
- network, examples, mods config
\ No newline at end of file
# AutomataKit Reproduction
All automatakit works are open source, and while we cannot sell you boards, if you have an interesting application, get in touch to ask about collaborating.
## Circuit Building
Each AutomataKit project includes circuit schematic and board files, as well as some notes (if I've been feeling verbose) under the /circuit directory, and should include a BOM.
Circuit Manufacturing is practically a commodity these days. I use [JLCPCB](https://jlcpcb.com/) in Shenzhen, and [OHS Park](https://oshpark.com/) is popular among the open source community. On both of these websites, you can drop the .zip folder from a projects' /circuit folder into their quoting system and get an estimate for cost. Normally, you can get 5 boards for $10 or so, OHS Park may be more expensive (also more awesome, and purple). Boards typically arrive in one week. I highly recommend also ordering a solder stencil.
To assemble circuits, you'll have to order parts as well, I use [DigiKey](https://www.digikey.com/), which is easy for you because I'll include DigiKey Part Numbers on my BOMs.
For final assembly, I recommend a readthrough of [sparkfun's documentation](https://learn.sparkfun.com/tutorials/electronics-assembly) or [adafruit's documentation](https://learn.adafruit.com/smt-manufacturing?view=all#overview)
Essentially, when boards arrive with a stencil, you can solder-paste squeegee paste onto the boards. While some people use a jig for this, in small volumes it's totally reasonable to do by hand (make sure you get a stencil with a 'framework'). Of course, you can also use a syringe of paste and dot each component off individually, but stencils seem like the way to go.
Then, find an old microscope (or don't, and squint!) and tweezer the components into place. This isn't as hard as you'd think, as the melting solder paste surface-tensions everything into the right alignment.
Now, you'll also need (or want) a reflow oven. I used the [controleo](http://www.whizoo.com/) to convert a toaster oven into a reflow oven. If you or your fab-community is not stoked about investing too much time into this, you can also do some [frying-pan reflow](https://www.youtube.com/watch?v=3drirgNktQg).
## Firmware
To build, program and debug firmware, I use Atmel Studio 7. Code for all of the endpoints is kept in their respective repositories, under the embedded/ directory.
While the code is kept in the repositories, supporting libraries and build tools are not - we need Atmel Studio to do this for us.
In Atmel Studio, start a new project, select 'GCC Executable Project' and set the location to be the sub-directory where the .c and .h files are kept.
![atsuo-1](/images/atstudio-01.png)
On the next page, select the Device to be an ATSAMD51J19 (or J18) - this is the microcontroller most of the Machine Kit endpoints run. A J19 is the 512kB version, the J18 is the 256kB version.
![atsuo-2](/images/atstudio-02.png)
Now Atmel Studio should be set up, but we need to have it include the existing .c and .h files.
In the Atmel Studio 'Solution Explorer' (might not be open, go to View -> Solution Explorer), right-click on the Solution (mkembedded-example in this case) and do Add -> Existing Item
![atsuo-3](/images/atstudio-03.png)
Now select all of the .c and .h files from the example code.
![atsuo-4](/images/atstudio-04.png)
Your Atmel Studio environment and project embedded director should look something like this:
![atsuo-5](/images/atstudio-05.png)
Now we should be ready to build the example:
![atsuo-6](/images/atstudio-06.png)
To load a program onto the device, connect the programmer (in this case, I'm using an Atmel ICE) and do Ctrl + Alt + F5, or hit the little 'play' button underneath the 'window' menu item.
If you get an error saying you don't have a tool connected, hit OK and select the Atmel-ICE from the menu that appears. Otherwise, to set up a programming tool in Atmel Studio go to 'Tools -> Device Programming' or right-click on the solution and open the properties. From there you can select a tool in the 'Tool' tab on the left.
\ No newline at end of file
# AutomataKit
automatakit
automatickit
# Ambitions for this page
- landing page for all users, consider FAB14 workshop landing here
- is machine / robot control for fungible machines
- show video examples Reich, MoControl
- explain scheme, idea, statelessness and event-basedness
- practicum
- how to mkterminal, what is
- how to atk api javascript
- explain example application entry point
- explain example C code
# Global Commands
All members of the automatakit hardware family will accept the following commands:
### Test
Keycode: **127**
- to test networking, this will reply with a payload packet containing ```127, 12, 24, 48``` and will toggle an LED on the board
### Reset
Keycode: **128**
- issues a software microcontroller reset
- if the microcontroller is already hung up, this will not work
XX Is a collection of hardware, firmware and software that lets you build machines in the same way we build software: quickly, with great joy, and with rapid reconfiguration of resources.
With XX, all of the motors, sensors, and end effectors in a machine are connected via a low-latency network that we call [APA](link). An API allows us to interface with this network to build applications for machine control.
```JavaScript
Stepper.trapezoid(entry,steps,rate,exit);
Stepper.onPacket(packet){
// on return packet
}
DCRotary.setPos(pos);
DCRotary.onPacket(packet){
//
}
// all have
Endpoint.sendPacket(packet);
Endpoint.onPacket(packet){
// returning
}
```
Entry points to the network are through the [mksocketserver](link) and [mkterminal](link) interfaces. These open hardware ports on a host computer to send and receive messages across the network.
Endpoints are hardware objects that receive control commands, and execute them faithfully: move motors, read sensors, heat things, control positions and currents, etc.
## APA Networking
- clean nomenclature: 'routers' are 'nodes' and can be just-routers or endpoints, etc, anything that lives on the network is a node
### The Packet
*Asynchronous Packet Automata* is a networking scheme from Neil Gershenfeld, wherein packets traverse a network not based on destination addresses, but on designated routes. In Technical Networking Language, is is a source-routed port-forwarding scheme, which means that routing is done at the source of the packet, and upon arriving at a position in the network, packets are forwarded along another port, or consumed at that position, based on the route contained in the packet. As the packet traverses the network, pieces of the route are 'consumed' and replaced with a reversed route, such that the destination knows how to return the packet.
The structure of a packet is typically broken into bytes (8-bit long 'words') and is structured like this:
![apa-packet](/images/apa-packet-structure.png)
The 1st byte of any packet denotes the length of the complete packet, in bytes, and is used to parse packets arriving at nodes. For example, when a node starts receiving a packet, it takes the first byte arriving to be the length, and counts bytes until the end is reached, when it can then act on the packet.
### Routing
Bytes in the route-header section of the packet designate the order of ports the packet should be forwarded on. When the packet arrives at a new network node, the node shifts-out the last port, and adds to the tail of the route-header the port that the packet arrived on, effectively adding return information to the route. The 'pointer' (we designate the byte representing 254, or ^ diagramatically), denotes the packet's current position in the route.
We can see an example packet traversal here:
![apa-packet-traverse](/images/apa-packet-traverse.png)
![apa-packet-route-shift](/images/apa-packet-shift.png)
Because of the route-header shifting, the 1st byte in the route-header always denotes the port number which the packet should leave the current node on. If the 1st byte in the route-header is the pointer (^ or 254) the packet is at its destination and should be consumed by that node. At this point, the tail of the packet-header contains a route which, when reversed, forms a route back to it's original source.
![apa-packet-reply](/images/apa-packet-reply.png)
### The Physical Layer
APA does not designate a particular Physical Layer (in Networking Nomenclature, referred to as a 'PHY', or Layer 2). AutomataKit uses a microcontroller's UART peripheral for the PHY layer, but we are expanding to use FPGAs and a per-bit token-passing scheme, as well as exploring wireless links.
### Hardware Implementation
The network nodes implemented in AutomataKit use a UART Physical Layer. This means that network packets arrive on a per-byte basis, and are parsed into packets in the microcontroller's C code (firmware).
... etc
## Endpoints
Endpoints are hardware...
Global API
**127** test, turns on a light and returns the packet
**128** reset, resets the board
**129** setpos,
**130** getpos,
**131** trapezoid,
### MKRouter
### MKStepper17
### MKStepper23
### MKBLDCDriver
### MKBreadBoardBoard
### MKSmallRotary
## Applications
- example applications do:
- mocontrol acceleration
- dynamic control
- feedback?
# Global Notes
## W/R/T ATSAMD51
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment