b u i l d i n g r e a l t i me e mb e d d e d a p p l i c
play

B u i l d i n g R e a l - T i me E mb e d d e d - PowerPoint PPT Presentation

B u i l d i n g R e a l - T i me E mb e d d e d A p p l i c a t i o n s o n Q d u i n o MC A We b - c o n n e c t e d 3 D P r i n t e r C a s e S t u d y Zhuoqun (Tom) Cheng,


  1. B u i l d i n g R e a l - T i me E mb e d d e d A p p l i c a t i o n s o n Q d u i n o MC A We b - c o n n e c t e d 3 D P r i n t e r C a s e S t u d y Zhuoqun (Tom) Cheng, Richard West and Ying Ye

  2. 2 3D Printing HOW-TO CAD Model Melt the fjlament Move in 3D space Extruder Slicing Program Deposit onto the table Y Table Serial Serial X Printed Object Firmware G-code Serial

  3. 3 Web-connected 3D Printer

  4. 4 Web-connected 3D Printer Remote Job Submission Local Slicing Correctness Verifjcatjon Print

  5. 5 Printrbot Simple Metal Motor Motor Controller Extruder Motor Microprocessor Atmel AVR, 8 bit, 20 MHz Web Server SRAM 8 KB I/O UART, SPI, I2C, PWM, GPIO

  6. 7 Custom Controller 64 bit dual-core Atom E3825 1.33 GHz 2 GB memory 86 GPIOs, I2C, SPI, UART, PWM RAMPS shield: I/O extension board Intel MinnowBoard MAX

  7. 8 Custom Controller RAMPS shield Companion Analog Circuits MinnowMAX

  8. 9 Marlin Firmware Timer1 Motor Interrupt Main G-code loop Interpret Motor Data Data Read G-code Variable Period Motor Stepper Translate to motor rotatjon Timer2 8ms Period Interrupt Temperature Adjust Temperature Control fan & PID output PID Extruder heater Temperature

  9. 10 Marlin on Linux Original Marlin Linux Port Main loop + interrupts handlers Multjple threads Timer interrupts Periodic nanosleep AVR I/O instructjons Intel MRAA IoT library All computatjons in the main loop Betuer code structure lightupd daemon + custom spooler Jituer of the extruder, when submittjng relatjvely large fjles lightupd Is this bad? Why? Marlin Spooler Spooler Linux MinnowMAX

  10. 13 The Timing Problem γ d H L T T T

  11. 14 10 kHz Pulse Train struct timespec period = {. tv_sec = 0 , . tv_nsec = 100000 }; while ( 1 ) { nanosleep (& period , NULL); /* sleep for 100 us */ mraa_gpio_write ( GPIO6 , HIGH ); /* write 1 to gpio6 */ mraa_gpio_write ( GPIO6 , LOW ); /* write 0 to gpio6 */ } Frequency Period Theoretjcal 10 kHz 100000 ns Measured 7.91 kHz 100000 ns + 26422 ns Unstable Original PrintrBoard 9.96 kHz 100000 ns + 401 ns

  12. 15 10 kHz Pulse Train struct timespec period = {. tv_sec = 0 , . tv_nsec = 100000 }; while ( 1 ) { nanosleep (& period , NULL); /* sleep for 100 us */ mraa_gpio_write ( GPIO6 , HIGH ); /* write 1 to gpio6 */ mraa_gpio_write ( GPIO6 , LOW ); /* write 0 to gpio6 */ } 2.2% 9.2% 29.3% 15.7% 3.9% 40.1% Lack of API with low and predictable overheads Kernel hrtjmer Scheduler Crossing framework GPIO gpiolib sysfs Driver framework framework

  13. 16 10 kHz Pulse Train struct timespec period = {. tv_sec = 0 , . tv_nsec = 100000 }; while ( 1 ) { nanosleep (& period , NULL); /* sleep for 100 us */ mraa_gpio_write ( GPIO6 , HIGH ); /* write 1 to gpio6 */ mraa_gpio_write ( GPIO6 , LOW ); /* write 0 to gpio6 */ } Real-tjme environment setup PREEMPT_RT patch Settjng scheduling priority Locking pages into memory Lack of a simple and uniform programming interface Further optjmizatjon Shield a core from the scheduler: isolcpu, cset… Disable tjmer interrupt on a core: CONFIG_NO_HZ_FULL ….

  14. 17 QduinoMC Goals Design Easy to use Simple APIs based on Arduino Easy to port existjng Arduino program Multjthread loops Take advantage of the multj-core Pinning loops to cores Interrupt routjng Allow QoS specifjcatjon Loop budget and period Low I/O access overhead User-level I/O access loop (loopID, budget, period, [coreID]) noInterrupts (device, coreID) noTimer (coreID) interruptsVcpu (device, budget, period, [coreID]) digitalWrite () / digitalRead ()

  15. 18 Marlin on QduinoMC loop (1, 10, 100, 1), loop (2, 30, 100, 0), loop (3, 1, 80, 0) interruptsVCPU (I2C, 10ms, 100ms), interruptsVCPU (NIC, 10ms, 100ms) noTimer (1), noInterrupts (ALL, 1) Web server / Spooler -- default

  16. 19 10 kHz Pulse Train Again void setup ( ) { pinMode ( GPIO6 , OUTPUT ); noInterrupts ( ALL , 1 ); noTimer ( 1 ); } void loop ( 1 , 100 , 100 , 1 ) { delayBusyNanoseconds ( 100000 ); digitalWrite ( GPIO6 , 1 ); digitalWrite ( GPIO6 , 0 ); } Frequency Period Theoretjcal 10 kHz 100000 ns Measured QduinoMC 9.569 kHz 100000 ns + 4504 ns Stable Measured Linux 7.91 kHz 100000 ns + 26422 ns Original PrintrBoard 9.96 kHz 100000 ns + 401 ns

  17. 20 Test Object Higher quality Faster printjng 10% code size reductjon Intuitjve and clear code structure

  18. 21 Conclusion & Future Work Designed and built a platgorm to ease the development of IoT applicatjons with critjcal tjming requirements Built a web-connected 3D printer as a case study analyzed 3D printers’ real-tjme propertjes Future work will extend web connectjvity to support local slicing and print verifjcatjon

  19. 22 Q&A Thank you! Questions?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend