About this Blog

This blog is an engineering log book; for me to record the progress on my many projects and hopefully to inspire you.

Some projects do not get off the ground, they remain as interesting thoughts, a select few get some work done on them, even fewer get close to completion, and none get completed because unfortunately I subscribe to the theory: "If something ain't broke then it doesn't have enough features". If you'd like to collaborate on some work to get something to a useable state then send me some communications.

Being a blog, posts are listed in chronological order. However I usually have multiple projects on the go and will try to post some of my earlier work. With this in mind I'll try to add labels to each post so all posts relevant to one project can be easily extracted.

Enjoy and happy hacking.

Tuesday, September 9, 2008

Software Plan - First Run

Minimum specifications:
  • Use the existing hardware.
  • Run at 4MHz = 1MIPS on the internal RC oscillator to free up two extra pins.
  • Servo communications,
    • Bit bash a one-wire serial communications protocol,
      • based on dallas 1-wire bus?
    • Bit bash a two wire bus (maybe easier),
      • I2C.
    • Traditional servo pulse width command.
  • Each Servo individually addressable,
    • 255 unique addresses 0x00 - 0xFE,
    • one broadcast address 0xFF.
  • Servo action - position control,
    • PID controller,
      • Adjustable P, I and D gains.
    • Other controller (LQR?).
    • Dead band adjustment.
  • PWM power control for motor.
  • Debug LED(s).
  • Store configuration in EEPROM (128 bytes),
    • Address.
    • Controller gains.
    • Control limits,
      • Position extremes.
      • Torque\Current extremes.
    • Home Position.
Optional features:
  • Current sensing,
    • additional current sensing amp hardware required.
    • use additional ADC pin (GP4).
  • Constant torque controller.
Design Overview:
At startup:
  1. Load the configuration data from EEPROM data memory into RAM.
  2. Configure device.
    1. GPIO, GP1 and GP2 output (H-bridge).
    2. GPIO, GP4 and GP5 (comms).
    3. ADC, GP0 input (Pot).
    4. TIMER0 (8bit, 1MHz, prescaler 1,2,4,8,16,32,64,128,256) for PWM.
    5. TIMER1 (16bit, 1MHz, prescaler 1,2,4,8) for Comms.
  3. If startup bit START_CONTROL set then initialise control to "home position", else disable motor.
  4. Initialise communications protocol, begin listening for address.

No comments: