Your SlideShare is downloading. ×
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013

351
views

Published on

Published in: Technology, Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
351
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Alden Hart & Rob GiesburtCo-foundersSynthetosTales of Evolution
  • 2. Hardware Innovation Workshop - 5/15/13Alden Hart - alden.hart@synthetos.comRob Giseburt - rob.giseburt@synthetos.com
  • 3. Make the motors move (yay!)Features:- Pulse integrity- Motion profiles- Inverse kinematics- Sensor integration- Limits and exclusion domains- Gcode library support- Speed, speed, speed, speedSingle Motion DomainSTART HERESystem Integration Level Features:- Optimal job planning- Collision avoidance (or not)Acceleration management Const JerkCoordinated movement XYZPath planning Optimal path planningHardware device integrationMultiple motion domainsCross-domain coordinationException handling and reactionABC UVW
  • 4. Accessibility•Arduino-level users•Web programmers (e.g. JavaScript, node.JS, Python)•Domain experts with little or no programming experience (or desire)•Professionals: system builders, process engineers, etc.Components•Canned motion components and other pre-packaged functions•Simple way to package arbitrary hardware componentsTools•Motate hardware abstraction and simplification•Kinen standards provide a powerful toolbox without soldering•Hardware mashups / RESTful hardwareHow do we get from motion domains to complete systems?
  • 5. Easy enough for beginners.Powerful enough for pros.Making beginners into pros.
  • 6. For Beginning Programmers:Motate is an easy to learn embedded “language.”OutputPin<13> ledPin;ledPin = 1; // set to highledPin = 0; // set to low“Turn pin 13 on and off”InputPin<12> buttonPin;if (buttonPin) {// do something}“Read the level of pin 12”Timer<1> myTimer(kTimerUpToMatch, 50000);// in a routine:myTimer.setInterrupts(kInterruptOnOverflow);myTimer.start();// define your interrupt:namespace Motate {MOTATE_TIMER_INTERRUPT(1) {dda_timer.getInterruptCause();// do something}}“Tell timer 1 to run my special routine at50kHz”
  • 7. For Beginning Programmers:// enable write to registersREG_TC1_WPMR = 0x54494D00;TC_Configure(TC1, 0, TC1->CMR0);// set frequencyREG_TC1_RC0 = (VARIANT_MCK / 50000UL / 2)// enable interruptsREG_TC1_IER0 = TC_IER_CPCS;NVIC_EnableIRQ(TC3_IRQn);pmc_enable_periph_clk(ID_TC3);TC_Start(TC1, 0);// define the interuptvoid TC3_Handler(void) {// read SR to clear interrupt conditiondummy = REG_SR_DDA; // do something}}}Native(Atmel SAM3X8E ARM on the Arduino Due)<< Code for Atmel ATMega line >><< Code for Atmel ATTiny line >><<Code for Atmel ATXMega line >><< Code for Atmel ARM line >><<Code TI MSP430 line >><< Code TI ARM line >><< Code for LPCARM line >><< Code for ST ARM line >>Nativetimer_number myTimerNum = 3;Timer<myTimerNum> myTimer(kTimerUpToMatch, 50000);// in a routine:myTimer.setInterrupts(kInterruptOnOverflow);myTimer.start();// define your interrupt:namespace Motate {MOTATE_TIMER_INTERRUPT(myTimerNum) {dda_timer.getInterruptCause();// do something}}Motate“Tell timer 3 to run my special routine at 50kHz”
  • 8. For Professional Programmers:Motate is hardware abstraction layer, written in optimized C++.All the good parts of C/C++, none of the bad ones:Bad:•RTTI, virtual functions, malloc, exceptions•C++ Standard IO, C++ STLGood:•Good UI design techniques for designing APIs.•An API is a UI.•Don’t compromise performance for usability.•Play with the compiler, not against it.•“If it’s hardware, it’s compile time.”•Use mirage interfaces, opaque interfaces that, uponcompiling, boil down to nothing.•Judicious use of metaprogramming.
  • 9. For Professional Programmers:How fast is Motate?With mirage interfaces, the HAL can boil away.With this definition:OutputPin<13> ledPin;This code:ledPin = 1; // set to highCompiles down to one instruction on the AVR, andexecutes in two cycles!On the SAM3X8E ARM Cortex-M3, it compiles to two orthree instructions, which executes in two to fivecycles.
  • 10. Hardware Mashups•System with multiple coordinated domains and/or devices•Controlled as single unit•REST basics: resources, representation, state transfer•Complex systems are composite resourcesWhy JSON?•Flexible•Relatively concise•Already in most modern languagesOn the device itself•Running on ARM, ATXmega and ATMega328p•Kinen project to define protocol and hardware compatibilitythings line of JSON get it, set itmany different thingsRESTful hardware•REST does not require HTTP. We run over USB, SPI, RS-485
  • 11. What you can do with JSONWhat we’ve learned about JSON•Subset of the JSON spec• 7 bit ASCII only• Single line, limited length (e.g. 128 to 256 chars)• Limited number of name:value pairs (e.g. 24 per line)• Decimal only, no hexadecimal•Dispatch tables, tokens and indexes•No mallocsCommands: {"gc":"n20g0x20"}Configuration: {"2":{"ma":1,"sa":1.800,"tr":36.540,"mi":8,"po":1,"pm":1}}Status reports: {"sr":{"posx":1.230,"posy":4.375,"posz":-2.500,"posa":0.000,"vel":175.0,"stat":5}}Filtering: {"sr":{"posx":2.670}}Addressing & Routing: {"a_master":{"2":{"ma":1,"sa":1.800,"tr":36.540,"mi":8,"po":1,"pm":0}}}{"a_slave":{"2":{"ma":1,"sa":1.800,"tr":360.0,"mi":4,"po":0,"pm":1}}}
  • 12. What about efficiency?•It’s not as bad as you think•Timings for set-X-axis-max-velocity to 16000 mm/min {"xvm":16000}•NoJSON command is $1=16000SAM3X8E Xmega192A3 atmega328P No JSONCommands / sec ~1000 cps ~1000 cps ~1000 cps ~1600 cpsFP marshaling (strtof()) <7.5 uSec <25 uSec <70 uSec <70 uSecFLASH footprint ~8 Kbytes ~8 Kbytes ~4-6 KbytesRAM footprint ~2 Kbytes ~2 Kbytes ~500 - 800 bytesmalloc() no no no noAssumptions•USB running at 115,200 baud•FLASH / RAM footprints include JSON parser/serializer, dispatcher, floating point libs
  • 13. For More Information: Synthetos.comAlden Hart - alden.hart@synthetos.comRob Giseburt - rob.giseburt@synthetos.com