Thursday, February 16, 2012

Feb.16 Tacho Motor Encoder

Need interrupts to count the degrees from the tachometer in the motor.
If I understand right this is typically done by quad-code, 
where the signal changes indicated how much the motor has turned. 
Following are just good references found for now. 
The links will be needed for references if really help:
googled "quad-code for beginners" since that what I am.
Reviewing existing motor code:
motorAvrSetPwrBrake(cyg_uint32 pa_nOutputPort, cyg_int32 pa_nPercent, int pa_nBrake)
  • pa_nPercent is:
    • passed in as 32 bits, but ...
    • assigned to a 8 bit variable
    • sizes should match
  • ditto for   pa_nBrake
  • Also check for motor power between -100 and 100 should be in avr code. If in FB code, a new FB code could forget the check and bad data be sent.

Wednesday, February 15, 2012

Feb.15 Flip-Flop Tutorial 1st trial

Time to start testing the tutorials (text only - video coming)
Round 1
0. Pre-test and Brief IEC61499 overview
Used combination of  James Christensen's (AZ has permission) and Alios Zoitl's foils  and book figures. 
1. Existing TestSystem supplied with the release version of 4DIAC
Not everything was installed, so finished on my laptop. Changes made to 4DIAC 1.1 version
(post-test 1)  Understood it was event driven and the key models /views.
2. Flip-Flop tutorial using various ways to apply IEC61499 concepts and 4DIAC features to create a flip-flop. (WIll be long because repeat application ~5 ways)
Today. Finished install of forte and updated the Quick set-up page
Made it through creating the Flip-Flop application with existing block, but did not start System Configuration (time after set-up 1 hour)
Details update notes below.


Next: 2b.Flip-Flop using LMS as the target.


1. Existing tutorial system 
Quick-set-up page has not been reviewed probably in a year:
Changed so building Posix and other targets are in different sections now.
It would be good if there were links to set-up for other targets as they are added.


Flip-Flop tutorial: 
Summary:
  • It easy to miss details a beginner doesn't know
  • Video will hopefully help it go a bit faster
  • IEC61499 concepts need to pointed out when used
Specific Observations / Changes needed
  • Didn't know to open into the System
    • nor how to open System view
      • Interesting since both  file > new system  and so is  file > new application are from the menu bar, didn't even know he was in the wrong place at first.
  • System creation is followed by Import
    • add intro text because beginner thinks they need to both create and import system.
    • When asked: 
      • yes a video would be faster 
      • yes reading can be so slow you want to take a nap.
    • IDE feedback when looking for existing FBs:.
      • Without a FB search how should a beginner be told to look for existing FBs without having to explain alot more!?
      •  need a FB search in FB palette 
        • Was previously told this was planned, but no feature request - so added one
    • What are the differences between using F_AND and E_SWITCH to make a Flip-flop?
      • Why would a Elec.Eng. think to use an E_SWITCH without being told, since they using gates?
      • E_SWITCH description is confusing
    • Needs a next or back at the bottom of a section -didn't know where to go at end of a section.
    • IEC61499   things seen: Answered: INIT/INITO  
    • Tried to connect E_SWITCH.OUT to  both QI and IN of the "LED" FB at first


    Feb.15 Adaptors explained well

    Today adaptors were explained to me and a real example with a mechanical BotBall Lego arm shown. Maybe oversimplified, but in summary:


    Adaptors are like:
    Interfaces because they are used within other FBs
    Connectors because they can be used on the input or mirrored on the output of a FB 


    Their example opened questions about whether the LMS FB interfaces are really 1499 enough?

    • When should REQ and data inputs be used to set state like dir(ection).
    • When should an event like FWD / BK be used to set the direction state internally.
    • In part when the event will cause a state change.
    • Is it 1499 like enough, if the Event Control Chart has to look at the event && data for transition?

    The LMS FBs are SIFBs so no ECCs, but light calibration and line follower application could be.

    Sunday, February 12, 2012

    Feb.8 Smaller Stacksize

    When the LMS regression test didn't have enough space, the Dec.30 Stacksize information was useful.
    The eCos stack was reduced from 4098(=800 in hex) to 1536(=600 in hex).
    Using the Dec.30 Stacksize info. that's space for :
    the 29 minimum eCos variables + 19 more INT spaces.


    The avr_ctl thread stacksize was reduced from 2048 to 1312:
    the 29 minimum eCos variables + 12 more INT spaces.


    The LMS regression test now works with touch sensor, 3 leds, a motor, 1 button test, and 3 buttons pressed in same test case.


    Patches submitted