Event-based power reporting test vector generator.

Introduction:

  We have noticed some deficiencies in data recording systems when
  recording event-based power meters such as the Quarq.  The full
  capabilities of ANT+ transmission are not being utilized.

  While the data recording works pretty well for endurance training,
  more demanding uses will show some limitations.  And recording will
  fall over dramatically when presented with a carefully designed test
  signal.

  This script is a small collection of such signals.
 
System Requirements:

  Ant stick and Ubuntu computer.  (The test also works on my OS X and
  Windows systems with USB1 stick and appropriate drivers.)

  Alternately, Windows computer and ANTware II.  The tests are
  distributed as "antscripts.zip" with numbers associated with the
  tests below.

  You must edit in the ANT+ network key in the top of the file as
  we're not supposed to distribute this.

Usage: 

  ./ct_sim.py [TESTNUMBER]

  Run without TESTNUMBER to see defined tests.

  During the tests, the Ant stick will transmit as a Quarq power
  meter with device id 12345.

Test descriptions:

  All tests run for five minutes.  

  All tests produce an average power of 200W.

  Test 1: 120 RPM / 200 W constant power
    
    Description: A baseline test.  120 RPM cadence, no power variation
                 for five minutes.

    Expected outcome:  Average power is 200W.
  
    If this test fails: You've got problems.  Go download the ANT+
                 device simulator and get that working first.

  Test 2: 120 RPM / 100 W alternating with 120 RPM / 300 W
  
    Description: One crank revolution at 100 W / 120 RPM, followed by
                 one crank revolution at 300 W / 120 RPM.  The two
                 power levels alternate like this.

    Expected outcome:  Average power is 200W.

    If this test fails: You are losing data, possibly due to
                 inadequate resampling.  Did you forget the low-pass
                 filter before decimation?

  Test 3: One crank revolution at 60 RPM / 600 W alternating with a
                 crank revolution at 20 RPM / 66.7W.  The two power
                 levels alternate like this.  The 60 RPM stroke takes
                 one second, and the 20 RPM stroke takes three
                 seconds.

    Expected outcome:  Average power is 200W.

    If this test fails: Incorrect use of ZOH resampling. Crank-torque
                 messages report at the end of the stroke, not at the
                 beginning.  If this is not taken into account, the
                 result is three seconds of 600W and one second of
                 66.7 W.

  Test 4: 120 RPM / 100 W alternating with 120 RPM / 300 W (with
                 standard power messages).  Standard power messages
                 are less complex than crank torque messages, but
                 still allow power reporting in an event-based way.

    Expected outcome:  Average power is 200W.
		  		      
    If this test fails: See test #2.

  Test 5: 120 RPM / 200 W constant power with ten second RF dropouts.
                 ANT+ is carefully designed so that the integral of
                 important quantities is transmitted.  This allows
                 determination of average power over an interval of
                 missed messages.  For Crank Torque messages at 200W,
                 drops of up to 32 seconds can be corrected.

    Expected outcome:  Average power is 200W.

    If this test fails: Please review the ANT+ spec and make sure that
                 power is calculated over missing messages in the
                 appropriate way.


  Test 6: 120 RPM / 200 W constant power with three second RF
                 dropouts.  This test is redundant with test 5 but the
                 drop timeout is synchronized to Ant messages rather
                 than wall clock time.

    Expected outcome:  Average power is 200W.

    If this test fails: See test #5.  This test can also expose certain
                 decoder race conditions.

  Test 7: 60 RPM / 400 W alternating with 6RPM / 0 W, ten seconds per
                 setting.  This mode interleaves Crank Torque and
                 Standard Power messages in a manner similar to a real
                 CinQo.  Pedal Balance is hardcoded to 50%.

    Expected outcome: Average power is 200W.  Pedal balance is
                 a constant 50%.

    If this test fails: See test #5.  This test can also expose
                 certain decoder race conditions.  This test will show
                 if the power recording system records bogus pedal
                 balance values.

  Test 8: 40 RPM / 200 W constant power
    
    Description: Another baseline test.  40 RPM cadence, no power variation
                 for five minutes.

    Expected outcome:  Average power is 200W.
  
    If this test fails: You've got problems.  Go download the ANT+
                 device simulator and get that working first.

Data recording recommendations:

  We recommend recording every Ant message received from the power
  meter, with exact duplicates removed.  In the past, one reason to
  resample in the head unit is to collect all data sources together.
  But the .FIT file format allows mixing several data streams in a
  natural way.  Manipulation of power data on the recording device
  only loses information.

May all your tests pass.

Mark Rages, October 2012

Appendix 1:  ANT stick setup on Ubuntu:

  1. Copy "99-antstick.rules" to /etc/udev/rules.d

  2. Copy "ant-usb2.conf" to /etc/modprobe.d

  3. reboot.  "/dev/ttyANT2" or similar will appear when the ANT stick is
     inserted.

Appendix 2:  AutoANT notes.

  1. The AutoANT scripts are just recorded during a run of the py
     scripts on Linux.  The wall-clock timing may be skewed by some
     milliseconds.  The scripts still work fine for their intended
     purpose.

  2. The ANT+ network key is removed from the scripts.  Please edit it
     back in.  (Search for the "set_network" message near the top of
     each file.)

  3. Download the latest version of ANTware from
     http://www.thisisant.com.  Previous versions seem to bog down and
     crash on large files like this.

  4. ANTware has a facility to load several scripts and execute them
     in order.  This appears to be broken, as the first script in the
     list just executes over and over.  However, the scripts can
     simply be cat'ed together to make a combined script.
 NameLast modifiedSize

 Parent Directory   -
 headunit_test.tar.gz 2013-03-12 21:56 262K
 antscripts.zip 2013-03-12 22:01 209K
 resampling.pdf 2012-10-19 17:29 59K
 ant_quiz.pdf 2013-03-12 02:49 52K
 README.txt 2013-03-12 21:56 6.4K
 99-antstick.rules 2013-12-23 22:41 1.4K