Sunday, February 28, 2010

Mar.1 DualMotorBot and LDD

LDD = Lego Digital Designer
Dual-Motor-Bot = Lego Robot with just 2 motors (instead of the usual 3 with tribot)


Construction Instructions using LDD:
After finishing the robot, the LDD (Lego Digital Designer)  can generate building instructions automatically.  However the order is not  necessarily the order it was created in and not always logical.  (ex. 2 connectors beside each other, one left as hole until several steps later). The building instructions  html generated provide good images of the finished robot and smaller Lego parts. The larger Lego parts are too small and have noticable jagged edges.

So currently creating my own building/construction instructions using hopefully a more logical and modular building order. The images are a combination of the LDD generated images and  my own creations via paint. Pictures may be included later.

Forms provided by LDD:
  • HTML  
  • in Lego SW specific form.
Forms needed:
  • Sourceforge wiki (will probably link to pdf file)
  • pdf (use FreePDF XP printer)

Friday, February 26, 2010

Feb.26 Line Follower refinements and test

From observing a HTL class working on their line followers (in Lejos)

Robot:
light sensors closer to "floor" have less interference
if sensors are not close to the wheels then a small angle still has a longer radius
ie. sensor make a bigger turn  away from the line than expected.
This is true of the basic tribot, which has a third motor the middle (for support)


Algorithm:
Calibrate the light sensors so the background can be a brown or gray table top. 
The color blocks on the new track can confuse the robot if light sensors are not calibrated right
Slow down in curves
Try the direction it was turning in first if the line is lost

Testing:
straight line
test circle 
line the curves back and forth


Next application:
Maze made up of black lines







Feb.26 Alt. Blinker using E_CYCLE and _E_SWITCH


The composite FB util.FlipFlop in previous post could use the first 3 FBs here instead.

Feb.26 Composite FBs with just FBDK FBs Tricks

Blinker with Flip-flop logic in a composite FB type in group util and named flipflop.

Tricks needed:
In 4DIAC 
1. create the composite FB as desired
2. use the composite FB from the palette in an application
3. map application to FBDK device via System

Before testing:
In 4DIAC preferences for FBDK
  • add the group util to the list of packages 
In FBDK editor 
  • open the xml for the composite function block
    • Fix what ever it complains about. In this case:
      • removed standard in
      • removed xml statement with no explicit beginning xml statement
      • add imports needed (import fb.rt.hmi.*;) 
      • to Compiler Info / Header
      • press Enter (lose what typed if forget)
      • press OK button
  • then save as and check XML and Java then the press the OK button 

Ready to test in 4DIAC deployment  using launch FBDK / (check appl) download.


Note: Received updated 4DIAC from Monika, because can't delete FB in composite FBs  in    last pre-edition.

Failed attempt:  Composite blocks had a problem with spliting and merging events using connectors so tried with E_SPLITs and E_MERGEs. The updated 4DIAC from Monika fixed this problem, too.

Thursday, February 25, 2010

Feb.25 Tutorial options

Prefer:
  • Interactive
  • Some self-checks
Form? 1 or more of following:
  • pdf 
    •  
  • video preferred method - how?
  • guided learning with self-check
Access options?
25 Feb. already solved: in 4DIAC sourceforge wiki 
  • pdf file to download
    • con: not interactive
    • good for a start
  • in CMS= Content Mangement System  
    • Moodle 
      • pro: used by TU e-Learning
      • SW reqts: php, sql DB, apache server 
        • ? Can TU courses be left open so no key is required?
        • otherwise con: someone must install and maintain on the 4DIAC website
        • can use / interface to other tools like a wiki
    • Joombla
      • new and currently popular
    • Mediawiki 
      • like Moodle: SW reqts: php, sql DB, apache server
      • pro: easy to update
      • con. same as Moodle
    • Web page
      • pro: just include
      • con: not SCORM standard


Feb.24 Tutorial 1: Linefollower Stepwise refinement

Tutorial 1: Linefollower Checklist


1a. Create Line Follower with LeJos with 1 to 3 light sensors
       eCos with Forte is not ready yet (soon?)
  • LeJos Environment and SW:
    • see Lejos Tutorial
    • Lejos Hints:
      • Firmware flash at the end of the install did not find the NXT brick, so long as my USB stick was plugged in. It disconnected the USB stick, too. Fortunately no files on USB stick were affected.
      • can set-up so whole installation can be copied or used from USB stick
    • Eclipse with LeJos Hints:
      • import Sample Project (C:\Users\Carolyn\leJOSNXJProjects) for examples  see tutorial for details
      • In Preferences don't forget to set lejos_home
      • Know project converted with Other libraries includes java.nxt class.jar
      • Download problems? - current - reinstalling
1b. Formalize a stepwise refinement approach
see Feb.10 Line Follower Steps entry for start
Worksheet: Fill-in a table for the 2^n cases (n=1-3 sensors) from Bratislava presentation
2. simulate Function Blocks with FDBK that think need
see Feb. 15-19 flip-flops and lego.setFloodlight entry for start

3. Formalize construction instructions
    will use both 
then if
  • standard Lego links change still have 1 construction still available
  • Lego kit changes, then instructions for new kit available via links
4. Create stand-alone Tutorial
see Tutorial options entry for start


Wednesday, February 24, 2010

*IEC 61499 References / Links


Lewis, Robert, Modelling control systems using IEC 61499, The Institution of Electrical Engineers, London, 2001.

Vyatkin, Valeriy, IEC 61499 Function Blocks for Embedded and Distrubuted Control Systems Design,  N.Z.,O3-neida 200x
Tutorials for 61499 and FBDK (java)


Fischer, John ; Boucher, Thomas; Workbook for Designing Distributed Control Applications using Rockwell Automation’s HOLOBLOC Prototyping Software, Working Paper No. 05-017,Rudgers 2005.
http://ise.rutgers.edu/automation_sciences/Publications Documents/DCWorkbook.pdf downloaded 3/10

http://knol.google.com/k/iec-61499#

See links on right side
http://aut.informatik.uni-halle.de/mitarbeiter/gerber/


Examples:
With FBDK
http://ise.rutgers.edu/automation_sciences/
Curriculum development material for distributed control
Testbed with Function block examples

Monday, February 15, 2010

Feb. 15-19 flip-flops and lego.setFloodlight

Started trying various applications that might be useful with sensors
   (or at to be more comfortable with 4DIAC)
Need 1 or more palletes for use with Legos

Simple FBs using only FBDK:

  • Flip-flop of LED 

  • SetFloodlight using Radio_Bool and OutBool in 1 device resource


  • setFloodlight Basic FB type working
    • LCD_IN: Set on/off Bool with check box and send; [out_bool shows value sent]
    • LEGO_FORTE: Here the real light sensor would be sent the bool, but for now just passed thru.
    • LCD:OUT: Recieves the value set back, which is shown via an out_bool
  1. With just bool value just passed through using bool2bool:


2.  With a lego.setFloodlight basic function block (placeholder for actual FB interface to NXT)


(pre)4DIAC Errors:
 -1 with 4DIAC 3.7 pre-release so went back to using  3.6
 ==> -1 can be ignored.

After creating a new application must exit and restart 4DIAC to see the new system everywhere.
(similiarly for system deletes)

Friday, February 12, 2010

Feb.12 Imports and Flip-flops

FBDK imports and more 61499
Importing the FBDK Flasher_test.sys into 4DIAC results in errors when saving. A major problem is the FBDK applications were often implemented in the resources (=sub-device) instead of applications.

Flasher with 1 led= flood light of light sensor in Mindstorms is turn on and cycle for 1 sec.; turn off and cycle for 1 sec.  Two options in 61499 are use E_Cycle with E_Switch and E_RS to toggle the light LMS_LED or
2 E_Delays to set R and S in E_RS to toggle the LMS_LED.

Assignment: Use OUT_BOOL so can see this process.
(-1 error in System Config after creating new system with pre-release)

LeJos
Firmware download

Program to test light values. Buttons: Left=off; Right=on;Enter=display light sensor value; ESCAPE=exit

Thursday, February 11, 2010

Feb. 11 HTL Vienna and Bratislava classes together

Line Follower Day
(link with pictures to be supplied)
1 hour presentations 
  • line follower history, applications, algorithms (1-3 sensors); 
  • intro to LeJos NXT Java  (complete set-up in 1 directory loaded on every computer)
1 1/2 hours work on Robots and programs and first 2 teams tested.
After lunch about half the around 10 group teams started testing.
Time tests started about hour later, so the Bratislava class could catch their train.

At least some of the Bratislava class had experience with LEGO NXT robot building, but no java.
Austrian class had never built any LEGO NXT robots, but knew java. The Austrian class took about 1/2 to 1 hour longer to start testing.


Course was made with electrical tape on a set of square white boards pegged together.


2 light sensor robots had the best times.
Only 1 group used 1 light - only worked in 1 direction
3 light sensor robots zigzaged too much.


Tricks: Slow down when in a curve so don't get too far from the line
Shield line around the sensors.


The line follower robot construction varied alot: Ferrari red model  with big wheels, basic 4 wheels with brick on top, and models with brick up high etc.

Feb.10 Line Follower Steps


 Line Follower: Basic Algorithm
  Black then forward
  White then left or right to find line

Robot:
1. See if / how to go straight
Answers: Is the robot build so it will go straight
2. Alternate left and right - Does go in a straight line?
3. Need to move slightly to get started.
4. Keep light sensor close to floor/line and/or shield to avoid interference from ambivalent light

Program:
5. Calibrate sensor by taking the average of reading on white and black rather than setting to particular value.
6. Program "switch"  or if-then-elseif statements to cover all cases
    # cases = 2^n where n is the number of light sensors
7. Slow down in when line curves so you don't over shoot and lose the line completely.

Following the Line Tests:
Basic
1. Straight
2. Curves 
    (right/left) 
    (gradual/sharp)
Advanced:
3. Break in light
4. Crossing lines
5. Find line in the beginning

With Touch Sensor
Object on the line

Also see more hints in:
Feb. 11 HTL Vienna and Bratislava classes together...

Tuesday, February 9, 2010

*LEGO NXT Software Links

Links for comparing LEGO NXT software. This includes firmware for now.
Mindstorms / Labview
Labview Event Programming
Various C versions

Firmware /OS
nxos  French open source OS for NXT and intro to embedded systems
another nxos or same?    Bare Metal on the NXT
 
eCos open source RT O/S intended for embedded applications.
how to write a driver

http://www.sparkfun.com/datasheets/DevTools/SAM7/at91sam7%20serial%20communications.pdf

http://blog.gmane.org/gmane.os.ecos.devel

*LEGO Blogs, forums and general info


Blogs 
Five minute bot (NXT 2.0=different wheels)

http://thenxtstep.blogspot.com/2009/09/nxt-20-five-minute-bot.html
  with links to a Labview and NXT forums
http://thenxtstep.blogspot.com/ also has links to good constructions
Links 

 Non-Lego HW Options:
Robot using TI Calculators
http://mste.illinois.edu/resources/ti/robot/about/index.html

In Austria
http://forum.lgoe.at/index.php?topic=702.0

*Education / Didatics Links and Notes

Tutorial set-ups:
CMU
Use Video. Example of stepping through Tutorial steps:
Connect / Construct / Contemplate / Continue
Each step ends with a summary review with a couple for understanding questions.
http://www.education.rec.ri.cmu.edu/previews/nxt_products/nxt_video_trainer/partial_product/behaviors/repeatingbehaviors/repeatingbehaviors.html
interative design preview video is especially good 
 
Good explanations 

Good example of explaining names of Lego parts as beams, etc.
Tagbot

Good example of explaining light sensor
http://www.education.rec.ri.cmu.edu/products/robolab_vid_trainer/light1/index.htm#



In Schools / Lego Leagues etc

*LEGO Simulators

Is buying or using a LEGO NXT set required? For schools / universities the kits will be reused, but companies find the idea of buying a toy questionable. So is using a simulator possible or useful for design even when LEGO NXT will be used.

Most articles can only be downloaded with a subscribtion or from a school with one
Realistic simulation of a Lego Mindstorms NXT based robot  IEEE article

older JRE is included which causes problems with 4DIACs use of FBDK.

 

Monday, February 8, 2010

Feb.9 IN_ANY / minor Lego tests

Std Pallet chg: IN_ANY had XML problems

   some with REQ need both IND and CNF
Lego Tests: Blink works in Mindstorms
Line Follower:
 straight line tests - result motor power is not same. Always turns right.
 Need to test with different motors





Feb.8 Gleaning 61499 details from X2Y2 Tutorial

Started a clean 4DIAC system to help my understanding of what is exactly happening: 
(which it has) 

IEC6144 devices can execute 1499 so FBDK and FORTE are virtual devices.
On a pc they simulate the behavior of a control device.

On a real control device like lego they are performing the task of a device.

IEC61499 resources  are created in a device
Service Interfaces to "devices" that can't run 61499 use Service Interface blocks to send/receive messages. SIFBs are also used for accessing stuff outside of a 61499 device like sensors, motors, and even things like databases.


The 4DIAC-IDE FORTE preference should point to where the forte application is that is updated by Eclipse. That could be some bin\pc\src\FORTE_ver#.exe
  • in 4DIAC directories:  (ex:...runtime\bin\pc\src\FORTE_0.3.6.exe)    
  • default currently C:\Training\forte_mc\bin\pc\src\forte.exe -  (doesn't exist by default)
  • location of FORTE version used: (ex: .....\FORTE_0.3.7\bin\pc\src\forte.exe)
  • If Project copied into Eclipse workspace, then its of course the Eclipse workspace:            (ex: .....\workspaceX2Y2\FORTE_0.3.7\bin\pc\src\forte.exe)
4DIAC-IDE workspace contains the XML files for each project and its applications, the system configuration, and the device mappings.


4DIAC User Interface annoyances / funnies :
  • When add a fb type doesn't show up right away in list, but its there. 
  • Drag/ Drop for Composite Function Blocks: 
    • didn't allow dropping except on left bottom 
    • plus connectors didn't connect if instances moved before connecting
    • after connecting drag/drop was allowed anywhere
Standard connections: Connect all:
  • INITOs to next logical INIT and first INIT connected to cold START (in System Config)
  • QOs to the next logical QI and first QI initialized to 1
  • for X2Y2 tutorial: associated CNFs or INDs to next logical REQ
    Standard Pallet events: Usually REQ goes with CNF in the same device and IND if REQ is from another device.

    Saturday, February 6, 2010

    *LEGO NXT Robot construction links

    The following are links with examples of good or standard (or both) NXT Robot constructions.
     *+ means tried it and good   ** will try soon  *- tried it, but has drawbacks

    Basic Models /Linefollowers
    http://pille.iwr.uni-heidelberg.de/~mindstorms/data/CastorBot.pdf


    CMU National Engineering Center: Robotics Academy : Building Instructions
    3 good and standard robot examples + a general construction guide

    **Taskbot improves on Tri-bot with 2 motors by stablizing the sensor at 90 degrees.
    http://www.education.rec.ri.cmu.edu/content/lego/building/build_shows/taskbot.pdf

    Line Follower with light and ultrasound sensors; Good pictures so construction can be repeated.
    Earlier Blog entries has links to other construction websites

    Tagbot - flashlight tag- names the Lego parts

    5 Minute bot
    NXT Linefollower

    Philo's Fast NXT 2.0 Ball Sorter (Dec.27, 2009) Stone Hedge (PNP) easy enough for a 10 year old



    Friday, February 5, 2010

    Feb. 6 Surfing for examples Lego, simulators, 61499

    Found a hodge podge of Lego and 61499 links.
    The most useful Lego models will be moved a general post:
    LEGO NXT Robot construction links 


    * = now reference in another Blog entry.


    LEGO 
    comparison of Lego SW like mindstorms, LeJos etc

    http://www.teamhassenplug.org/NXT/NXTSoftware.html

    http://www.education.rec.ri.cmu.edu/products/robolab_vid_trainer/light1/light1quiz.html
    http://www.education.rec.ri.cmu.edu/products/robolab_vid_trainer/light1/index.htm#

    Taskbot improves on Tri-bot with 2 motors by stablizing the sensor at 90 degrees.
    *http://www.education.rec.ri.cmu.edu/content/lego/building/build_shows/taskbot.pdf

    LEGO Mindstorms simluators  
    so 4DIAC 61499  LEGO tutorial users to learn 61499 can use it or try it out before/without buying LEGO  (1 time usage training online by firms and 1 time usage - not schools)
    LMS http://ddi.uni-paderborn.de/en/software/lego-mindstorms-simulator.html
    licensed for educational usage only by schools and universities
    Note: Seems to change Java installation backwards, which caused me 4DIAC/FORTE problems, since a reinstall of Java seemed to fix the problem.


    More recent:
    LEGO NXT Mindstorms and the MS Robotics Developer Studio, it is a package which contains a 3D simulation of the TRIBOT. 




    IEEE article - download at TU
    Realistic simulation of a Lego Mindstorms NXT based robot
    http://www.google.com/url?sa=t&source=web&ct=res&cd=2&ved=0CAsQFjAB&url=http%3A%2F%2Fieeexplore.ieee.org%2Fiel5%2F5268173%2F5280693%2F05280986.pdf%3Farnumber%3D5280986&ei=F2ttS9vaLonL_Qa19J2sBQ&usg=AFQjCNG8nyPw_mArNcOnQB1GZcOoKLihAA&sig2=pn0cQovSmDe9FDAi9dXv_Q

    4DIAC
    Finish Tutorial CFB and SFB

    LDD = Lego Digital Designer (build model online)
    Mindstorms NXT simulator?


    Can LDD=Lego Digital Designer be installed on VT1?

    In Tool_library I updated IN_OUT and anything else in HMI palette that had REQ with IND to CNF.
    IN_ANY consistently gets an Java NULL pointer exeception - so its not up dated.
    See http://robots61499eduprojectnotes.blogspot.com/2010/02/feb4-change-hmi-to-match-standard.html

    Standard FB is not mentioned in 61499?
    SI FB:When is COMPOSITE NETWORK needed / used?


    What is Switch Workspace in 4DIAC?
    How do you see what your workspace is in 4DIAC?

    Tutorial:
    Use Video. Example of stepping through Tutorial steps:
    Connect / Construct / Contemplate / Continue
    Each step ends with a summary review with a couple for understanding questions.

    http://www.education.rec.ri.cmu.edu/previews/nxt_products/nxt_video_trainer/partial_product/behaviors/repeatingbehaviors/repeatingbehaviors.html
     interative design preview video is especially good 


    Links
    There are many interesting and possibly useful links here that need to categorized!
    Carnegie Mellon Robotics Academy / Nactional Robotics Center/ Robotics academy
    http://www.education.rec.ri.cmu.edu/ General reference - covers many topics
    *http://www.education.rec.ri.cmu.edu/content/lego/building/index.htm - Construction
    Lego CMU Research



    Labview Event Programming


    Lego and Math
    http://www.education.rec.ri.cmu.edu/content/educators/research/robot_algebra/index.htm

    http://nxtbuildingmodels.blogspot.com/

    Mindstorms book from 1980 - Turtle graphics

    http://en.wikipedia.org/wiki/Mindstorms:_Children,_Computers,_and_Powerful_Ideas
    http://www.thecb.state.tx.us/index.cfm?objectid=CA77487B-CC8D-51AA-B13A5C010E1A99E9
    http://www.education.rec.ri.cmu.edu/content/lego/competitions/index.htm


    NXT BlueWii (9/08)  http://nxtasy.org/category/projects/  search on Wii

    LMSimulator http://ddi.uni-paderborn.de/en/software/lego-mindstorms-simulator.html
    LeJos example with non-Lego parts http://www.juanantonio.info/jab_cms.php?id=228

    German too http://www.matthias-paul-scholz.homepage.t-online.de/lego/nxt/index.html

    Even in Austria: http://legoleague.schule.at/index.php?PHPSESSIONID=&design=legoleague&url=community&cid=9312&modul=1&folder=83780&

    61499 examples
    http://at.iw.uni-halle.de/forschung/enas_demo/enas_gripper/

    Collection of Typical (Beginner) 4DIAC User errors / Tips

    Path problems
    • space in path
    Hardware mapping
    • Forgot Hardware Mapping.
    • If multiple applications, forgot to unmap previous application.
    • Can't see HW mapping so think its not there!. Scroll down. Hardware mapping shows up in system in the same place in the interface. Since

    Thursday, February 4, 2010

    Feb.4 Change HMI to match standard

    In Tool Library.HMI changed Event  in and out names in Interface to match standard since often the input event REQ (request) is matched with output event IND(indicator) and should be matched with CNF(confirm).

    • How are pallet changes made available to everyone? 
    Feb.9 update: REQ should have both IND and CNF like comment says
      For in events REQ changed out event from IND to CNF:
      IN_CHOICE
      DIAG_LOG
      FB_SLIDER
      FB_TABLE
      IN_ANY (save_all failure - NULL Java pointer)
      IN_COLOR
      IN_ENUM


      FB type has output event  IND, but no matching input event. Should it be changed?
      CHOICE_TABLE
      IN_BOOL
      IN_EVENT
      IN_MATRIX
      RADIO_BOOL

      Wednesday, February 3, 2010

      Feb.3 No Output solved and Line Followers


      No Output solved 
      Basic Function Block Tutorial - 4DIAC /FORTE3.7
      FORTE(VIS_IN) to FBDK(EMB_RES) to FORTE(VIS_OUT)
      Problem was input shown, output send, but not recieved.

      First changed from FORTE 3.6 to 3.7 - fixed not being able to close input window.
      Then found several small problems: 
      Send / Recieve ip addresses were different (Fooled since ports were the same)
      Was using Forte 3.6 in 4DIAC (changed, but didn't save the change and never checked again until today)
      QI was changed to 1 instead of through data flow,but should have no affect.
      Also had + for * - easy to see when have output.

      Hint: To see in console:
      in x2y2_BFB:: alg_REQ(void)
      fprintf("x: %d, y:%d, OUT: %d\n",x.operator short int( ), y.operator short int( ), OUT.operator short int( ));


      Line Followers
      Building instruction links:
      http://www.active-robots.com/products/mindstorms4schools/building-instructions.shtml

      Modify the tribot so just uses light sensor and no motor in middle.
      Using Kinder Uni lego NXT 1 set.


      Mindstorms Linefollower - - same as last year very inexact. Line sensor has hard time seeing black. Worse when flood light is on. Will try with direct light.
      The Mindstorms software gets errors.- Insane object. Seems to come from draggin objects around on the screen - when testing what values are needed.


      Next Lejos - last year line follower was much easier/exacter in Java.