sliding2.xml
This version works under codegen It takes about 3.5 minutes to run. sliding.xml modified to run. This version uses the custom Sign actor.

Below are instructions on how to run this model

  1. You may want to turn off virus checking so as to get the maximum speed.
  2. Run
    cd $PTII
    jar -xf lib/diva.jar
    
    so that $PTII/diva exists (This is bug that will be fixed some day)
  3. Make the Sign actor in $PTII/ptolemy/apps/cg
        c:\users\cxh\ptII\ptolemy\apps\throttle\cg 
    
  4. Start up Vergil and display this README file.
    $PTII/bin/vergil ptolemy/apps/throttle/cg/README.htm
    
  5. Select sliding2.xml
  6. Run the demo, go to the window where you started up vergil.
    You will see the memory usage:
    1622 ms. Memory: 11372K Free: 4828K (42%)
    
  7. You may want to create a copy of sliding2.xml that has a SequencePlotter instead of a FileWriter and run that.
  8. View -> Generate Code
  9. Change the directory, compile options and run options to match your system For example, in directory,
        c:\users\cxh\ptII\ptolemy\apps\throttle\cg 
    
    becomes
        c:\ptII\ptolemy\apps\throttle\cg
    
    compile and run change from
        -classpath "c:\users\cxh\ptII;"
    
    to
        -classpath "c:\ptII;"
    
    If you make these changes and save the model, then you will not need to make them each time
  10. Hit the Generate Button. The run will take roughly 3.5 minutes
    Note the timing and memory results, and compare them with the interpreted run above.
  11. The output will be in the current directory $PTII/ptolemy/apps/throttle/cg/
  12. To run the generated code by hand, run
    java -classpath "$PTII" ptolemy.apps.throttle.cg.Main
    
  13. To display the java code, run the following command in a Cygwin window:
    $PTII/bin/jode ptolemy.apps.throttle.cg.Main
    
    Another interesting class is
    $PTII/bin/jode ptolemy.apps.throttle.cg.CGModelsliding
    
  14. To run the model by hand:
    java -classpath "$PTII" ptolemy.actor.gui.MoMLSimpleStatisticalApplication sliding2.xml
    
Controller.xml
Composite Actor written by Edward A. Lee
Edward wrote:
Attached is the model I started modifying. It currently just outputs a sinewave, which is probably right... Without hooking it up to some sort of model of dynamics, we can't expect much more. But code generating this would certainly be a good starting point, and make a decent demo.
and
Note: Tunc's model is likely to be better, so if you have already made some sense of his, go with that... But if you haven't started with his, this one will probably be more straightforward.
sliding.xml
Portion of tunc.xml
tunc.xml
Complete throttle body model from Tunc Simsek

Tunc wrote

here is the file without modifications. to make it run using a single sdf controller you would need to do the following:

replace "tunc.controller.sampled controller.real-time controller" with the refinement of the "driver" mode of "tunc.controller.sampled controller.real-time controller.servo controller.modal controller"

And that should give you a purely SDF pedal tracking controller.

Best,
Tunc

ps. the version of ptolemy i'm using is the one i checked out and compiled on the 9th(or 10th) of January.