Trim Controller
General notes
Idea for vendor to make the boards https://www.pcbway.com/
Trim system controller is based on this board:
https://www.rugged-circuits.com/microcontroller-boards/ruggeduino-smalls-tcrmx
Which has the same pinout of this board:
Power supply circuit:
We also need the following:
- (1) DRV8871 Motor controller
- (1) digital pot MCP4651 (not MCP[1|2]XX because those are SPI which needs more pins)
Inputs are:
ADC
- ADC for linear resistor 1
- ADC for linear resistor 2
- ADC 4 for i2c
- ADC 5 for i2c
Digital
- Encoder A
- Encoder B
- Trim up (both up/down goto neutral)
- Trim down (both up/down goto neutral)
- Trim up (both up/down goto neutral)
- Trim down (both up/down goto neutral)
- Motor IN 1
- motor IN 2
- motor driver A
- motor driver B
- transistor for sinking current to discrete input.
MCP4651 notes
Tie A0, A1, A2 to get the default first i2c address.
This code can probably work with some changes. https://github.com/uChip/MCP4551/tree/master
Notice that the code sets the default address to 0x2E
- define MCP4551_DEFAULT_ADDRESS 0x2E // A0 is connected to GND
That won't work on the 2 pot 4651. See this note in the datasheet:
The default 4551 with A0 low is '0101 11`b + 0 where b is a 0 to make a byte so 0101110 or 0x2E. With a 4651 with A0, A1, A2 all low, we should get 0101000 or 0x28. As for writing to the second resistor array looks like the first 4 bits change.