Friday, October 22, 2010

Oct.22 Back to project progress blogging

Daily progress will go in blog
... now summary information is being collected in the portable wiki not in blog entries.

Environment changes:
Virtual Boxs (Win7, Ubuntu) and portable Wiki  on different USB devices
Want 4diac/forte also on a fast USB.
(so can document when waiting on VB to start) 
Built hg versions
4diac hg:
  1. hg clone
  2. import into Galileo (modelling tools) Eclipse 
  3. syncronise, test, export to build 4diac-ide
  4. copy into the built 4diac directory:
    • hg template directory
    • typelibrary directory which will be used for default 
    • know where an fbdk is for 4diac-ide preferences
Forte hg on:
  1. laptop C: and H: drives
  2. Alex's PC C: and Q: drives
  • lms set_up shell
  • make all 
    • need to edit make file so only FBs needed are included
    • Lab Nov. 8 Di. Blinky (Flip-Flop) 45 Minutes''' - need tutorial
  • Problems: 
    • cygwin errors when on USB
    • Spaces in directory or filename cause cygwin problems
    • cd to pwd will be removed from lms shell script
Flashed LMS with SAM-BA by downloading Lego Firmware and sending it to Lego
  • VT1 (win98) saw it was an ecos device although no drivers installed
  • Plugged lms into laptop with ecos - had no idea any device was attached.
  • Plugged into laptop (WinVista) nothing!
  • Plugged into Alex's PC (Win98) and nothing at first. Powered on with reset button pushed. Then Sam-ba recognized it.
Noted links in wiki to:
cmake (easier to have makefile configuration per application) - coming to 4diac in Nov. (I hope)
and hg to set up a repository and branches for lms fb palette.


in Virtual Box: Win7
Can LMS be used with standard LMS SW and downloaded from a Virtual Box (VB)?
1.  Lego Mindstorm NXT 2.0 Software is installed in VB (not on host= laptop)
     Goal to program LMS and download program
Did Program the LMS provided RoboCenter >Machines>Color Sorter example

Connected the LMS to the laptop:
  • Host (Vista) reaction:
    • Installed unknown device
    • Couldn't find in device list, but when turned off device list refreshed
  • VB reaction:
    • crashed  
      • when tried to switch back to it in full screen mode. 
      • first a message about needing more memory
    • would not restart - gave error
    • restart of vista system ok
    • after restart: Win7 VB started in safe mode
    • after Win7 restart - able to program again.
  • Finish program - save after every step
    • Just like it did 2 years ago when I first used LMS - the UI is very, very slow and you can see everything. In this case the motor blocks at the end. 
    • Finished - but not tested
  • Will want to compare to what event driven program would look like.
Snapshot of VB
  • Connected LMS to VB (check under USB devices)
  • It kept going on and off
  • Finally managed to start download while it was detectect
  • And ColorSorter.rbt downloaded from VB on to the LMS!!!
  • (details: lms ACIN = USB Devices> unknown device 0694:002)

Wednesday, October 13, 2010

Oct.13 Lego, ecos, Samba and usb Drivers

  • Lego NXT Mindstorms 
  • ecos
    • Put the following files in their own directory. 
      •  usbser.sys 
        •  C:\WINDOWS\system32\drivers\usbser.sys
        • hint in an ecos forum about ecos slave devices:  "For windows, copy the INF file and the 'usbser.sys' driver from your version of Windows into a directory, plug in the device, and when prompted, navigate to the INF file."
      •  eCosUsbSerial.inf
        • C:\sourceware_ecos\ecos-3.0\packages\io\usb\serial\slave\v3_0\host\windows\ eCosUsbSerial.inf
    • When Windows asks for the local of the driver. Enter this directory name.
  • Samba
  • libusb-win32
    • to create your own usb .inf and .sys for any generic USB device
    • NOT needed for LMS
    • libusb can be used with any good .inf and .sys files for usb devices

Wednesday, October 6, 2010

Oct. 5 Sampling - ECycle

Started using EDelays just to get the applications to work when trying out the algorighms using GUI on PC for simulation. But on real device need to sample at regular intervals. Since EDelays do not guarentee time between samples because of delay time to execute other Function Blocks. 

Better Solution: ECycle - sends out request at regularly timed intervals. 
Of course the sample rate chosen must be greater than the execution time of all FBs used in the cycle.

Wednesday, September 15, 2010

Sept.15 PNP built

PNP model (Lego Bonus Model #4)  that will be used as starting point for the 3rd tutorial has been built. Took 4.5 hours over 2 days (3+1.5). 


Thursday, September 9, 2010

Sept.9 LineFollower Video

After creating an E_SPLIT4 to send events to both motors, led indicator, and light sensor reader,  
the Simple Line Follower using forte 3.x works. It follows a straight line and curves in one direction. There may still be memory issues, but they take longer to show-up!

I forgot to unplug the USB cable and it kept following the line after being unplugged!



Forte IEC61499  LF1 Application:


Tuesday, September 7, 2010

Sept.9 Line Follower now

Wanted to just run the line follower and make a video.
But doesn't work because of changes documented here. 
This is typical since the FBs for Lego NXT are not stable and there is too little space for FORTE.

1.  To save space in FORTE the  HYST_UINT and calcBnd FBs were commented out in the src/Makefile.am Too bad can't connect the application XML and FB makefile.

2. Names were shorten to fit in space available, but changed to longer names for documentation.  Must be changed back.

3. Motor FB was updated to add STOP event.

4. Seeing if changing to -O2 helps

Still doesn't work... so more to come
At least one problem was the JTAG cable connection

Sunday, September 5, 2010

Sept. 5 Media Wiki started

One goal of this blog was to avoid having to ask the same question twice. But as I learn the same topic comes up multiple times, each time with more depth. So information is scattered over time or blog entries are no longer date related.  

To solve this problem and provide a place to work on the (formal) tutorials, a media wiki has been started.  For better or worse this media wiki is not online. It uses MoWeS Portable, so it is a Wiki on USB stick.

So far the tutorial outlines are in place with more details for Tutorial 1.