A very simple haptic device. Inspired by Scott Bezek's Smart Motor Knob and Karlitos/Binaris.
It uses my fork of haptic-bldc-lib by VIPQualityPost.
It can be interfaced with using I2C.
This uses a special gimbal motor.
And a simple MT6701 Encoder (the big ones).
In combination with a SimpleFocShield.
Everything running on a STM32F4.
STLs for a simple mount are included.
Also checkout the Onshape Document for the Motor Mount and the very basic Shield Holder, feel free to adapt them to your needs.
There is also a compatible Linux Driver plus Yocto Layer available.
Plus Demo Application using it.
communication.h
contains all the i2c/SMBus logic.
I used a form of SMBus, it basically reads and writes words (2 bytes) per command, because this is supposed to interact with Linux a Driver.
First Byte: Address Register
Second Byte: Lower Data Byte
Third Byte: Upper Data Byte
adheres to SMBus standard for reading a word
needs the address MSB set to 1
position can't be written
e.g:
0b10000001 (0x81) writes end position
0x81 0x10 0x00 -> Sets end position to 16.
adheres to SMBus standard for writing (except the extra write bit)
0x00
start position0x01
end position0x02
detent count0x03
position
Bit 8 is reserved and indicates a Write command.
SMBus protocol always starts by sending a write with the register it wants to read/write. Then it either sends more data or sends a empty read package. That's why I need to set a write bit in the initial write command for the address. ¯\(ツ)/¯ atleast that's how I got it running communicationg with Linux host.
- This is very basic
- Currentsense is disabled (just stopped working with my setup)