AnkleSoftwareSpec2007Sep

From DIDEAS Wiki
Jump to: navigation, search

AnkleHardwareSpec2007Sep

SM Software

  • ability to reprogram controller over ASYNC serial
  • 2 DMA controllers run the two ADC units at 12 bits, 400 KHz total sample rate
  • Input capture measures PWM period of magnetic rotary encoder / QEI captures encoder position
  • DMA controller sends/receives SPI to digital accelerometer
  • Main code loop runs at 500 Hz
    • decimation of analog inputs
    • reads ankle position
    • reads IMU, estimates orientation
    • reads motor controller status (motor current, motor position, status)
    • processes external communication interface

deep sleep / sleep / initialization

  • when entering a sleep state, some parameters may be written to EEPROM. Specifically the SG offsets will be checked against the stored value, and updated if the offset changes "significantly".

deep sleep

  • (<10uA, <0.25uW) when battery is near death. Disconnect as much of the system as possible from battery.
  • motor leads are shorted with "zero power"

sleeping

  • (<10mW) when ankle is inactive for period of time
  • the motor controller is is very lower power state (only activity is listen on Rx), motor leads shorted
  • On SM only the accelerometer is active (all other sensors are unpowered)
    • the accelerometer is programmed to generate an interrupt on certain acceleration conditions
    • the CPU will periodically (10Hz) awake and check the state of the accelerometer and conditionally enter a "mid-power" state to test other sensors.
    • if sensors suggest the ankle is active, the initialization state is entered

initialization

  • state entered upon connection of battery is attached or when waking from sleep
  • all sensors and hardware are powered, but motor leads remain shorted
  • SM will watch for a transition from ankle on ground (loaded) to ankle in the air.
    • shortly after ankle in the air the K3 strap will force the ankle into the zero position. The set point for the virtual spring is zeroed to this location
    • A small (1amp) current can be used to further guarantee the ankle is against the K3 strap.
    • strain gauges offsets can be zeroed at this point.
    • At this point the motor controller is commanded to enter current mode and the SM proceeds to normal operational mode.


Motor Controller Software

  • ability to reprogram controller over ASYNC serial
  • low power mode (5mW) where controller responds to ASYNC serial
    • PWM off
    • hall sensors periodically powered and monitored
    • encoder power off,
  • standby (<<5mW) by where processor sleeps, wakes on serial RX
    • all sensors and outputs are off
    • motor leads are shorted
  • SM controller will periodically send ASCII commands to command current and mode
    • controller PID will implement commanded current
    • controller will respond with status (encoder position, actual current)
    • absence of valid communication with SM (after 5mS):
      • set desired current to zero (and after 100mS)
      • enable motor lead short sub-circuit