Shop OBEX P1 Docs P2 Docs Learn Events
This may make a cool Propeller emulation project - Apollo landing computer - Page 2 — Parallax Forums

This may make a cool Propeller emulation project - Apollo landing computer

2»

Comments

  • heaterheater Posts: 3,370
    edited 2009-07-19 00:46
    Hanno: That's very cool. Does it take into account the decreasing mass of the lunar lander as the fuel is consumed? Does it take into account that when the gas is all gone and your are not on (or very near) the ground it's game over?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BADHABITBADHABIT Posts: 138
    edited 2009-07-19 05:51
    heater said...
    Do they still teach Newtonian Physics in high school ?

    Not since fuzzy logic was invented

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BH skull.gif
  • HannoHanno Posts: 1,130
    edited 2009-07-23 23:00
    Heater-
    Here's the code to land both a "fuzzy-logic" controlled lander, and a human-controlled lander. Currently, it does not take mass/fuel into account. Should take 2 lines of code- want to add them?
      repeat                   'keep landing forever...
        height:=start_height   'initialize lander's height and speed
        speed:=start_speed
        height2:=start_height   'initialize lander's height and speed
        speed2:=start_speed                
        repeat while height>0
         'Fuzzy Control
         f.fuzzifyA(height,FMHeight)      'fuzzifies Height into fuzzy register A
         f.fuzzifyB(speed ,FMSpeed)       'fuzzifies Speed into fuzzy register B
         f.doandRule(FRThrottle)          'calculate new Throttle with ThrottleRule
         throttle:=f.defuzzify(FMThrottle)'defuzzify Throttle to a number
         f.share(@fuzz)                   'share fuzzy result with Viewport
    
         'Physics     
         speed+=(acc_gravity-throttle)/dt 'moon's gravity increases lander's speed
                                          'throttle decreases speed
         height-=speed/dt                 'each dt, height decreased by speed/dt
         'same for lander #2
         speed2+=(acc_gravity-throttle2)/dt 
         height2-=speed2/dt                
         waitcnt(cnt+clkfreq/dt)          'wait by dt   
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • AleAle Posts: 2,363
    edited 2009-07-27 15:06
    According to Eureka they landed on '62 but didn't go public till the '69. But how to believe them when everything science-related sucks in that series ?. Well, I love the "ultra-high-tech" oscilloscopes, from the 60s and 70s that pop-up from time to time (Have a look at the last episode). Haven't seen any real top-of-the-class Oszi so far... The Tek 425 must be from the Original Galactica...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Sign In or Register to comment.