Subversion Repositories HomeAutomation

Rev

Rev 1735 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*
  2.     linearAct started by dberg 2011.
  3.    
  4.     This module is written to control an old linear actuator from Landis & Gyr, but should work
  5.     with a broad range of linear actuators and other stuff that conforms to its simple protocol:
  6.    
  7.     Movement is controlled by two signals, typically controlling two relays. Feedback of
  8.     position is sensed by pulses connected to the hardware counter.
  9.    
  10.     The two control signals are ON/OFF and DIRECTION - one relay to control actuator engine on/off
  11.     and the other one to change the polarity.
  12.    
  13.     The position is always relative and must be calibrated manually. Use CALIBRATION command to
  14.     give the module full moving space.
  15.    
  16.     Posible features to add:
  17.     - automatic recalibration by external switch (one or perhaps two)
  18.     - PWM speedcontrol
  19. */
  20.  
  21. #ifndef ACT_LINEARACT
  22. #define ACT_LINEARACT
  23.  
  24. /*-----------------------------------------------------------------------------
  25.  * Includes
  26.  *---------------------------------------------------------------------------*/
  27. /* system files */
  28. #include <avr/io.h>
  29. #include <avr/interrupt.h>
  30. #include <stdio.h>
  31. /* lib files */
  32. #include <config.h>
  33. #include <bios.h>
  34. #include <drivers/can/stdcan.h>
  35. #include <drivers/timer/timer.h>
  36. #include <drivers/mcu/gpio.h>
  37. #include <drivers/adc/adc.h>
  38. #include <drivers/mcu/pcint.h>
  39.  
  40. #include <util/delay.h>
  41.  
  42. void act_linearAct_Init(void);
  43. void act_linearAct_Process(void);
  44. void act_linearAct_HandleMessage(StdCan_Msg_t *rxMsg);
  45. void act_linearAct_List(uint8_t ModuleSequenceNumber);
  46.  
  47.  
  48. #ifndef act_linearAct_USEEEPROM
  49. #define act_linearAct_USEEEPROM 0
  50. #endif
  51.  
  52. #if act_linearAct_USEEEPROM==1
  53.     struct act_linearAct_Data{
  54.         ///TODO: Define EEPROM variables needed by the module
  55.         uint16_t pulses_ee;
  56.         uint16_t min_ee;
  57.         uint16_t low_ee;
  58.         uint16_t high_ee;
  59.         uint16_t max_ee;
  60.     }; 
  61. #endif
  62.  
  63. #endif // ACT_LINEARACT
  64.