Thursday, November 4, 2010

Nov.4 HW / Ports

Dominik using Windows 7 - the same Lego 
Alex's PC the Device Manager shows:
JTAG LINK as Universal Serial Bus controllers --> J-Link driver 
  • in the middle between the list of USB2 Controllers and USB Composite Device
eCos Lego 
= flashed with forte.bin with eCos included 
  •  (com3, com4, com5)



Samba
  • Put the LMS in reset mode, then plug in USB to PC so:
    • the Atmel Samba device driver is used
    • the LMS is not recognized as eCos or Lego device 
      • if its device driver is loaded,  then it shows up as a COM device, which is wrong!
      • so it is recognized as a USB/ARM0 device ready to be flashed

     

    Nov.4 Touch Sensor as Button Applications

    E_CYCLE is better to use than E_DELAY in many cases:
    • E_CYCLE: Sends sample request at regular intervals, independent of other FBs
    • E_DELAY: Waits a specific length of time. A total sample cycle time can be influenced by the time variance in FB execution times.
    Simple example: Touch sensor as start application button 
    E_CYCLE + E_PERMIT
    E_SWITCH+E_DELAY

    Nov.4 IEC 61499 LMS "Segway" application

    Here is a IEC 61499 LMS "Segway" application ready to be tested.
    Test results will be posted here.

    Wednesday, November 3, 2010

    Nov.3 Clean lms 4diac Pallete

    Clean lms 4diac Pallete on AlexPC - not compiled/tested  AND needs PID1 FB before Segway

    Since there doesn't seem to be any copy of the LMS Sept. workspace where the System Manger works, need finish moving the working/finished LMS Function Blocks to their own clean local hg repository. clean = no extra code + use of static const

    4DIAC-IDE managed somehow to get the same FB type (PID1) in the same group. Since good copy was lost, just deleted both copies and started over.

    forte1103 lms pallete FBs with working code from summer:
    • OFF(was shutdown); 
      • added message sent via USB back to 4diac "LMS OFF"
    • LED; 
    • LT (was RD)
    • TOUCH; 
    • SOUND; 
    • M_PWR (was motor.basic)
    Clock skew problem on Alex's PC (slow clock) is annoying since build leaves a directory when it sees it. 
    Cause: Files copied from a computer with a normal clock time.
    Solution: Wait the 10 minutes the PC clock is behind and the problem goes away.


    cntlr.PID1 Basic FB 
    Kp=25,Ki=1,Kd=10 values taken from LMS NXTG "Segway" code 
    Since the FB has been lost due to 4DIAC several times a screen capture backup - PID1 is currently in the Nov lms directory. The FB should work, but is not polished.
    • Several "Segway" application versions. 
      • Refining how to get the desired value = first read
      • Should LT FB should do its initial read when INIT event is sent?
    • PID FB 
      • Does it need an event when OUT is out of reasonable range is QO= false enough?
      • or is a separate event needed?
    • M_PWR
      • Similiarly is STOP event needed when finished with motors?
    Created sample applications for:
    • Using touch sensor as start button 
      • T_SWITCH:    with E_DELAY and E_SWITCH 
      • T_SWITCH2:: with E_CYCLE and E_PERMIT
    Tutorial0 for Blinky restructured  in usb wiki

    ECC interface is a mixture:
    event & condition in structured text 
    so might need both &s and ANDs
    ex. REQ & ((-1000 <= OUT) AND (OUT<= 1000))

    Tuesday, November 2, 2010

    Nov.2 KISS CBC day

    Dave Miller gave a quick introduction toBotball CBC robot.
    Its UI is touch screen.   Download is similar to Lego NXT.
    We did the typical first time things. Move the motors and follow a line.
    The function to start the motors returns as soon as the motors are started.
    Later a separate function can be set to wait for the motor function to complete.

    BUT BC Botball has a very nice camera which works as a color light sensor.
    The range of light is chosen from a spectrem, not restricted to ranges or 3 colors. 
    Also you see a picture via the camera and can see what it is detecting.

    For Thursday its hoped I can get a Scheme language interface workng on CBC.

    Sunday, October 31, 2010

    Oct.31 LMS 61499 Segway is possible now!

    This application can be created now with the existing LMS FBs


     Hardware:
    • Light Sensor
      • red light turned on 
    • 2 Motors
      • adjusts based on PID
        • direction  forward/backwards base
        • duration based
    • Ultrasonic Sensor - not connected - used to look like a head.
    Two topics:
    1. NXT Segway description vs. actual results
    2. What is needed for a lms event driven (IEC 61499- fordiac) Segway?


    1. NXT Segway description vs. actual results
    The NXTprograms NXT Segway with Rider   "This robot simulates a Segway PT "
    The project construction was straight forward. With the exception of the axle between the wheels, parts were easy to find and could be used as is. The axle had to be modified. The 2 wheels are connected so they move together to avoid drifting to the side.

    The Usage Information in the Building Instructions were extremely helpful.
    The NXT-G program worked as described and is well commented. And was it was nice surprise it worked on both a solid tan and solid gray surfaces with normal lab lighting.


    There are links to PID descriptions and alternative LMS self-balancing robots such as the
    alternative NXTway with both light sensor and gyro sensor versions.
    Fail safe: The program shuts off, if the PID value is not reasonable indicating it has probably fallen down.

    The blue tooth version is unique to this construction.


    2. What is needed for a lms event driven (IEC 61499- fordiac) Segway? 
    The basic NXT-G code / algorithm  is:
    1. Initialize using the robot's initial value as the goal value
    2. Adjust motors forward or backwards based on the PID correction 
    3. If the correction value unreasonable - Stop

    In theory this can work now in fordiac. The only known potential for error is, if the signal to motor is not sent timely. 1st Draft Application/Tests can use existing robot and lms FBs from summer.

    FBs needed:
    • Provided: 
      • E_CTU,; 
      • F_NOT; 
      • E_DELAY (3 pre-calibration/balance warnings); 
      • E_CYCLE;
    • lms pallete: 
      • LED; 
      • LT (read light reflection); 
      • MOTOR (sent power setting)
    • utility/ cntlr pallete:
      • PID; 
      • BTW (is # BeTWeen 2 numbers)

    Friday, October 29, 2010

    Oct.29 clean lms Forte; laptop dev; NXT-G Segway

    For break at the end: downloaded NXT-G NXT Segway with Rider  
    It works on solid gray desktop and solid tan table. Trick is balancing it well by the third beep.


    Note: Video edited and clipped with MPEG Stream Clip.

    clean lms Forte - continued creating a clean version of lms forte with minimum files


    Development on laptop

    The main open issue is how to install drivers so it works and Vista funnies.

    JTAG-edu : recognized by both Alex's PC and my laptop

    On Alex's PC:
    Samba ok following blog instructions for flashing
    OpenOcd let me flash

    On Laptop:
    LMS:   recognized as a libusb-win32 device --> eCos USB Serial Device
    It only shows up after the boot squence blinking if finished. When Forte adds the LMS_DEVice.
    Sometimes thought eCos device was Lego... then could flash it through LMS Firmware update back to Lego. Still don't have a pattern how Windows choses a  device driver!

    BUT Sam-Ba doesn't see it.  (main open issue!)
    Sam-Ba 2.9 sees JLink, but not the .-.l--ö-------------------------------ööööööööööööööööööööö----ö-öö_
    !
    Miscellaneous Links: 
    Flashing LMS with SamBa
    Sam-Ba for Vista: (installed on laptop)
    specifically:


    Driver info: USB CDC/ACM Class Driver for Windows 2000, XP, Vista, 7

    C++ style links: http://www.possibility.com/Cpp/const.html

    Interesting "Examples":

    MakerLegoBot: Lego Mindstorms NXT 3D Lego Printer

    NXT Segway with Rider (also with tilt control via BT) 

    Sideline: Dave Miller from KISS BoeBot is here and will hold a workshop Tue at TU and Th. at TGM.   Will possibly try to install (PLT) Scheme on CBC.