Commit Graph

22 Commits

Author SHA1 Message Date
Scott Bezek
9903ac63e6
NanoFOC/ESP32-S3 support (#117)
- New PlatformIO env (`nanofoc`) for the NanoFOC hardware
  - Huge thanks to @lgc00 for the initial NanoFOC configuration and prototyping!
  - Uses `HWCDC` rather than `UartStream` as the serial `Stream` interface (ESP32-S3 specific change)
  - Support for MAQ430 magnetic encoder sensor
  - Motor-specific PID tuning constants moved to separate header files

---------

Co-authored-by: lgc00 <lgcasd1+1@gmail.com>
2023-05-29 17:17:55 -07:00
Scott Bezek
acfc85f72b
Python software example (#106)
Add protobuf/cobs/crc32 framework code and a really basic python example
2023-02-04 12:34:12 -08:00
Scott Bezek
9431ed3971
New detent configurations (magnetic and biased-to-center) and demo React app (#105)
Breaking change to protobuf messages to support new detent configurations - adds more flexibility compared to existing config parameters (e.g. min/max position rather than just number of positions).

New magnetic detent mode allows for config to specify up to 5 nearest detent positions (with smooth scrolling in between them); the intent is a higher-level controller (e.g. connected demo app, see below) to dynamically update that list as the position changes, in order to support an unlimited number of magnetic detents.

---

React demo app implements a mock video editor timeline, with the ability to interact with it via the SmartKnob connected over USB serial. (Currently uses a node backend to stream config/state to the frontend via websockets, but it would probably be possible to do everything on the frontend with webserial in the future?).

The 3 demo input modes are:
- Scroll: quickly smooth-scroll through the timeline, with magnetic detents at clip boundaries. Scroll speed is determined by zoom level (currently only controllable by mouse scroll wheel)
- Frames: small detents (1.5 degrees) to move frame-by-frame through video
- Speed/playback: "spring-loaded" speed control, biased to return to center (paused), with detents at powers of 2: 1x, 2x, 4x playback

Currently the frontend app has some bugs, particularly with the current playback position when switching modes and zooming, but planning to merge anyway to get the other breaking changes into master along with the initial demo framework.
2023-01-16 13:58:03 -08:00
Scott Bezek
ae28d523e0
Protobuf serial protocol (#101)
- Firmware
  - Refactor all code to use a log interface rather than `Serial` directly
  - Moved platformio.ini to root, so you can load the entire repo in VS Code and still use platformio
  - Reduced graphic buffer bit depth to 8 bits (short on RAM :( )
  - Implemented threadsafe log interface in interface_task (using a queue for posting log message)
  - Created serial protocol interface and 2 implementations - plaintext (default) and protobuf (selected by sending a NULL byte)
  - Protobuf protocol is roughly the same architecture as Splitflap's:
    - PacketSerial (cobs) framing with NULL delimiters
    - CRC32 checksums for packets
    - nanopb generated code for encoding/decoding (generated firmware code is checked in, since it should change less frequently and this reduces burden to build the project from scratch)
- Software
  - Typescript example host-side code:
    - smartknobjs-proto
      - Autogenerated types/encoding/decoding protobuf code (using protobufjs)
    - smartknobjs
      - Helper library for interfacing the with smartknob via serial/protobuf. Implements basic outgoing queue (with retries and ACK checking) and message callback for responding to messages from the SmartKnob
    - example
      - Basic demo CLI app that uses smartknobjs to connect to the smartknob, send a haptic config, and print state changes and log messages to the console
2022-10-22 17:27:35 -07:00
Scott Bezek
b286cfabe1 Firmware cleanup 2022-10-04 22:21:51 -07:00
Scott Bezek
604f21dcb6 Fix compilation error if SK_ALS=0 but PIN_SDA and PIN_SCL are set 2022-05-27 18:57:07 -07:00
Scott Bezek
e35319af6d Increase motor task stack
Avoid accidental stack overflows from small stack.

Updates #37
Updates #50
2022-04-07 10:20:24 -07:00
Scott Bezek
45fd9f4e3e Cleanup old pio envs, fix some compilation issues with compile flags
Removed some legacy platformio envs that are not actively being maintained. But also fixed some bugs with different build flags that caused compilation issues.

Fixes #49
2022-04-06 21:53:41 -07:00
Scott Bezek
b47fcf7da4
Firmware updates - sensors, calibration, View support, etc (#9)
- Modify TLV493d library to expose frame counter in order to check for lockup, and implement auto-reset in tlv_sensor in case of lockup
 - Implement MT6701 SimpleFOC sensor
 - Make display optional
 - Add optional LED, strain, ALS support
 - Connect ALS to LED and display brightness
 - Hardcoded strain gauge thresholds and haptic feedback
2022-03-10 19:05:49 -08:00
Scott Bezek
1c75fa0bb0 vscode recommendations 2022-02-13 09:38:39 -08:00
Scott Bezek
ad86663a6d Cleanup 2022-02-08 20:32:21 -08:00
Scott Bezek
f362039a95 Detent tweaks 2022-01-27 09:27:20 -08:00
Scott Bezek
723396f588 Reduce noise on coarse detents 2022-01-16 11:24:57 -08:00
Scott Bezek
b92b805e13 cleanup 2022-01-15 21:21:23 -08:00
Scott Bezek
b380a756c3 Better demo UI, show config name, tune for re-mounted motor 2022-01-15 21:13:23 -08:00
Scott Bezek
26373a9b4e firmware checkpoint 2021-11-01 22:38:36 -07:00
Scott Bezek
a33c46b29b Add button support 2021-10-25 21:44:37 -07:00
Scott Bezek
0b5785ecf3 Demo! 2021-10-24 22:23:05 -07:00
Scott Bezek
bbc51702ff Auto-adjust centerpoint when idle 2021-10-24 14:42:21 -07:00
Scott Bezek
51f43cf727 dead zone and end stops 2021-10-23 20:47:24 -07:00
Scott Bezek
d9b97f8a2a Basic detents 2021-10-22 15:59:51 -07:00
Scott Bezek
bb4ba9df1e initial checkin 2021-10-22 12:35:39 -07:00