LEGO MINDSTORMS TUTORIAL ESWEEK 2009 Module NXT LEGO MINDSTORMS TUTORIAL
Total Page:16
File Type:pdf, Size:1020Kb
LEGO MINDSTORMS TUTORIAL ESWEEK 2009 Module NXT http://nxtgcc.sf.net LEGO MINDSTORMS TUTORIAL Outline ESWEEK 2009 http://nxtgcc.sf.net Rasmus Ulslev Pedersen [email protected] Please sit close to the screen: there will be lots of small code shown... NXT.1 LEGO MINDSTORMS Presentation Overview TUTORIAL ESWEEK 2009 http://nxtgcc.sf.net Overview Non-technical overview of LEGO c MINDSTORMS c NXT from a community and user standpoint HW and SW Description of NXT hardware and Outline software from a developer perspective Examples (1) Using TinyOS as a firmware, (2) an intelligent algorithm Q&A There will be time for discussion and future research ideas Lab Drawing for the NXT 2.0 and lab exercise using it Note 1: LEGO has sponsored a NXT 2.0 kit Note 2: LEGOr, MINDSTORMSrare trademarks of LEGOr. The tutorial contains pictures from Atmel ARM7 documentation, and from LEGO documentation. Note 3: There is additional material included: Many slides are supplementary and included for future reference. NXT.2 LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net Module NXT LEGO MINDSTORMS Outline Aim of Tutorial Introduction Open Source Sensors Inside NXT C 101 Firmware Programming ARM7 NXT Software Debugging NXT ESWEEK 2009 http://nxtgcc.sf.net Rasmus Ulslev Pedersen [email protected] NXT.1 Outline LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net 1 Aim of Tutorial 2 Introduction Outline 3 Open Source Aim of Tutorial Introduction 4 Sensors Open Source Sensors 5 Inside NXT C 101 Inside NXT C 101 Firmware Programming 6 Firmware Programming ARM7 NXT Software 7 ARM7 Debugging NXT 8 NXT Software 9 Debugging NXT NXT.2 Aim LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • How the open source universe around Lego Mindstorms NXT is structured Outline Aim of Tutorial • Talk about a world that stretches from high-schools to Introduction adults and from building bricks to programming in Open Source assembler Sensors • Emphasis on the overview and the programming aspects Inside NXT C 101 Firmware • Participants will be able to see where in the NXT Programming programming spectrum their interest match most ARM7 NXT Software • Use the tutorial to get started with open source Debugging NXT programming on NXT NXT.3 Introduction LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net Outline • Description of open source hardware and software Aim of Tutorial Introduction • LEGO business models are discussed Open Source • The old RCX Sensors • NXT in several (online) communities Inside NXT C 101 Firmware • Overview of how NXT can be programmed in different Programming environments ARM7 NXT Software Debugging NXT NXT.4 Some Mindstorms History LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • 10 years since Mindstorms was released Outline • First LEGO Mindstorms was the LEGO RCX: Successful Aim of Tutorial Introduction • LEGO intended it to be a closed source product, but... Open Source • It was soon hacked:-) Sensors Inside NXT C 101 • The open source strategy was pursued even more with the Firmware present LEGO Mindstorms Programming ARM7 • A Goldplated NXT and a limited edition Black NXT was NXT Software produced in relation to the 10 year anniversary Debugging NXT NXT.5 NXT Development LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • Development of NXT started in the 2004 • Initial group was Ralph, Steven, John, and David Outline • First prototypes were circulated on a limited number basis Aim of Tutorial inside the current MUP group and a select few outside that Introduction Open Source group Sensors • MUP: Jan 2006, 5 people Inside NXT C 101 Firmware • MUP II: Nov. 2005, 11 people Programming • MDP: 2006 ARM7 NXT Software • MCP 2: 31 persons, 100 chosen from 10000 applicants Debugging NXT • MCP 3: 2008-2009 • MCP 4: Next slide NXT.6 LEGO Design Routines LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • Lego has a group of people who has the privilege of talking directly to LEGO staff Outline Aim of Tutorial • Under non-disclosure Introduction agreements (NDA) Open Source • First group of MCPs Sensors (MUP) were a select Inside NXT C 101 Firmware group Programming • Used as a sounding ARM7 board for the ideas that NXT Software went into developing the Debugging NXT first LEGO MINDSTORMS NXT. • MCP 4 is commencing as we speak NXT.7 Lego Education LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net Outline • Lego has a website for educational activities Aim of Tutorial • Strong focus on university segment Introduction • LEGO MINDSTORMS NXT comes in educational sets Open Source Sensors • Rechargeable battery and extra building pieces Inside NXT C 101 • Firmware Sold with site licences that accompany the NXT Programming • Different sales curve from retail (slow start, longer product ARM7 life) NXT Software Debugging NXT NXT.8 Mindstorms Community LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • MINDSTORMS Outline community is large and Aim of Tutorial diverse Introduction • Blogs, forums, large Open Source events, books, the MCP Sensors program and more Inside NXT C 101 Firmware • NXTStep and the Programming NXTasy blogs ARM7 NXT Software • Lugnet is a large LEGO Debugging NXT fanclub NXT.9 Schools LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • Many schools participate in First LEGO League Outline Aim of Tutorial • A tournament where Introduction current theme is played Open Source out Sensors • The idea is to have Inside NXT C 101 Firmware adults lead or mentor a Programming team of children aged ARM7 9-14 (16 outside the US) NXT Software Debugging NXT • NXT is used to complete a challenge put out by the FLL management NXT.10 Business Models LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • LEGO earns money on NXT by selling the kit itself • Licences to educational institutions are also revenue Outline source Aim of Tutorial Introduction • First version of LEGO MINDSTORMS NXT was released Open Source in the beginning of 2007 Sensors • A second version appeared in the fall of 2009 (biannual Inside NXT C 101 Firmware release schedule:-)?) Programming • NXT 2.0 is shipped with a different set of standard sensors ARM7 (color sensor) NXT Software Debugging NXT • Spring releases at toys fairs which is then ready for Christmas sale NXT.11 LEGO SYSTEMS LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • LEGO partly produce and package NXT on their factory in Billund Outline • Staff around NXT Aim of Tutorial development is not big Introduction Open Source • Firmware development Sensors team is in control of the Inside NXT C 101 software development Firmware Programming • National Instruments ARM7 (NI) designs the NXT-G NXT Software environment Debugging NXT • The careful selection of close partners makes for long-time stability NXT.12 Firmware Releases LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net Outline • NXT is a complex product compared to other LEGO Aim of Tutorial products Introduction • Requires focus on quality Open Source Sensors • Updated versions released on the official MINDSTORMS Inside NXT C 101 website (http://mindstorms.lego.com) Firmware Programming • First firmware had the version number 1.1 (or 1.0...) and ARM7 the current released version for NXT 2.0 is versioned 1.28 NXT Software Debugging NXT NXT.13 Partners LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • Many institutions, companies, groups, and individuals have a stake in NXT • National Instruments is Outline presumably the most Aim of Tutorial Introduction important Open Source • MIT, Tuft, Carnigie Sensors Mellon, and others are Inside NXT C 101 Firmware also active Programming • Others such as ARM7 nxtprograms NXT Software Debugging NXT • Number of large events • This includes Brickfest • There has also been a MINDSTORMS NXT Sumo Competition NXT.14 NXT Alternatives LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • NXT is not completely alone... • Sun Spots from Outline Sun/Oracle Aim of Tutorial • Fisher-Technic offers a Introduction new robot controller Open Source Sensors which is is based on an Inside NXT C 101 ARM9 processor Firmware running at 200MHz Programming ARM7 • Various evaluation kits: NXT Software mbed, IAR, etc. Debugging NXT • However, it is difficult to match dealer network, community, and history of LEGO NXT.15 Source and Documents by LEGO LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net NXT Firmware Open Source Complete software for the NXT firmware, which can be compiled with a compliant C compiler Outline Aim of Tutorial Software Developer Kit A kit with software for controlling NXT Introduction remotely from a host computer. It includes a Open Source description of the NXT virtual machine. Sensors Hardware Developer Kit Description of the possible sensor Inside NXT C 101 Firmware and actuator interfaces for NXT. This is Programming extensively used by thirdparty sensor vendors. ARM7 Bluetooth Developer Kit It includes the communication protocol NXT Software for controlling NXT over a Bluetooth connection. Debugging NXT Demo Show PDF files which are important for firmware replacements... NXT.16 Schematics LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net Outline Aim of Tutorial • Lego published the schematics Introduction • Can see which pins of the ARM7 MCU is connected to Open Source what ports Sensors Inside NXT C 101 • Lego uses Orcad for its schematics, which is a commercial Firmware program Programming ARM7 NXT Software Debugging NXT NXT.17 Analog/Digital Protocols LEGO MINDSTORMS ESWEEK 2009 http://nxtgcc.sf.net • NXT features both analogue and digital interfaces to its Outline sensors. Aim of Tutorial • Sensors are based on an analogue to digital conversion Introduction