scottbez1 / smartknob

Haptic input knob with software-defined endstops and virtual detents
https://www.youtube.com/watch?v=ip641WmY4pA
Other
19.07k stars 1.1k forks source link

Issues using a MT6701 and ESP32 devkit #113

Open kiranscott opened 1 year ago

kiranscott commented 1 year ago

Hey everyone seeing that the SParkfun brushless motors are back in stock, I've started building a breadboard smartknob without the custom PCB. IMG_3616 I have a ESP-WROOM-32 devkit, and a MT6701 on a break out board acting as the hall effect sensor image https://www.aliexpress.com/item/1005004216058243.html When running the callibration I get the following: LOG: Electrical angle / mechanical angle (i.e. pole pairs) = inf LOG: Pole pairs set to 2147483647 I'm assuming this has to do with the sensor being read incorrectly / not at all. I've changed the CLK / DATA pins to correspond with 14,12 as they're the default HSPI_CLK and HSPI_MISO pins on my devkit. Anyone encountered a similar issue / got a similar setup

kiranscott commented 1 year ago

I should add that the board seems to default to Z, B, A or has a pad to short to set to i2c , so it might not be in SPI mode at all, and I can't seem to find schematics for it online to cross reference with the smartknob pcb schematic. This might be a super simple fix, I'm very much out of my comfort zone with this project haha

imBunyip commented 1 year ago

i think spi or ssi mode needs the mode pin on the encoder to be pulled up , if mode pin is pulled down you get abz or pwm modes, so i think you need to short the 12c pin and that will be fine. in the data sheet you can see the pin out ,and then use use a multimeter to find the circuit http://img.ekeic.com/ekeic/5001592712907.pdf.

kiranscott commented 1 year ago

Managed to get the screen and sensor working - but the motor is unstable / noisy. I've tried tuning the PID values but can't seem to get it behaving properly. Any idea what might be causing this?

https://user-images.githubusercontent.com/72805872/235312894-3367454e-2abd-42a8-8b00-ce50c5ef0b17.MOV

frank-f commented 3 weeks ago

The motor/motor controller has some quite high power demand spikes. I could imagine that these tiny wires and - sometimes questionable - DuPont connections could be a problem. Also make sure your USB port will supply more than the standard 5V 0.5A.