- 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.
- Current sensing,
- additional current sensing amp hardware required.
- use additional ADC pin (GP4).
- Constant torque controller.
At startup:
- Load the configuration data from EEPROM data memory into RAM.
- Configure device.
- GPIO, GP1 and GP2 output (H-bridge).
- GPIO, GP4 and GP5 (comms).
- ADC, GP0 input (Pot).
- TIMER0 (8bit, 1MHz, prescaler 1,2,4,8,16,32,64,128,256) for PWM.
- TIMER1 (16bit, 1MHz, prescaler 1,2,4,8) for Comms.
- If startup bit START_CONTROL set then initialise control to "home position", else disable motor.
- Initialise communications protocol, begin listening for address.
No comments:
Post a Comment