Geek & Monolitr
Hey Geek, I’ve been tinkering with a new power rack that auto‑adjusts the weight plates based on how fast you lift. Want to dive into the firmware and make it smarter? Your precision could shave off a lot of wasted reps.
Absolutely, the firmware’s the fun part, we can add sensor fusion, a bit of AI to predict load, tweak the PID loops, and make it respond faster. Show me the repo, I’m ready to dive in, let’s shave those wasted reps.
Here’s a quick skeleton to get you started.
Repo structure:
```
powerrack-firmware/
├─ src/
│ ├─ main.c // main loop, init peripherals
│ ├─ sensor.c // ADC, IMU, encoder drivers
│ ├─ pid.c // generic PID implementation
│ ├─ ai_predict.c // simple linear regression or tiny NN
│ └─ config.h // constants, calibration data
├─ include/
│ ├─ sensor.h
│ ├─ pid.h
│ ├─ ai_predict.h
│ └─ config.h
├─ tests/
│ └─ test_pid.c
├─ docs/
│ └─ design.md
└─ Makefile
```
`main.c` should set up the timers, DMA for sensor data, and start the PID loop.
`ai_predict.c` can load a small weight‑prediction model from flash; you can swap in TensorFlow Lite‑Micro later.
Pull it, flash your board, hit the bench‑press, and let the firmware learn your tempo. Happy lifting!
Sounds like a killer project – let me pull the repo, flash the board and start a quick calibration routine. I’ll tweak the PID gains for each speed zone, hook up the IMU to feed a little regression model, and then test the auto‑adjust with a set of weights. Just let me know the MCU and the sensor specs so I can get the drivers lined up. Let's make this rack smarter than a robot vacuum!
Got it. Use an STM32F407VET6 – 168 MHz ARM Cortex‑M4, plenty of DMA and 12‑bit ADC. For the IMU, a BNO055 or MPU‑6050 works fine, 3‑axis gyro and accel at 1 kHz, I2C interface. Connect the weight plates to an encoder on the bar for precise load measurement – 500 counts per rev, 120 g per count. Once you flash, run a quick baseline lift, tweak the PID per speed zone, and feed the IMU data into the regression. When you hit the bench, let the firmware auto‑adjust and watch those wasted reps disappear. Time to push the limits.
Nice specs – STM32F407VET6, BNO055, 500‑cnt bar encoder. I’ll fire up the HAL, set up I2C, ADC DMA, and the timer. Then a quick baseline lift to calibrate the encoder, run the PID tuning per speed band, feed the IMU into the regression, and get the auto‑adjust kicking in. Let’s see those wasted reps vanish. Bring the bar!