Hm, so my Vref problem is solved, I found spec-sheet.
The next problem is that grbl uses a buffered queue to store the next movements, so I need an effiecient way of emptying the buffer after each step, because now the robot balances from previous set of movements and not what the mpu is telling it right now it should do.
Any idea how to kill the buffer in grbl ?
I've tried using jog-mode and using "!" -> "~", but this only stops and restart the steppers, it doesn't clean the buffer.
A g-code interpreter is completely unsuitable for a balancing robot. You must send the commands direct to the motors, with as little in between as possible. Microseconds matter in this case.
Thanks for the warnings, but this is a "is it possible with grbl" project, so step into that frame of mind, I know it's not perfect, but I think it is possible. I found out there is a "CTRL-C " reset command, I will check the delay on that, hope it's not doing too many calculations.
Okey, so that works, but my mpu gyro is of the charts because of the vibration of the steppers, are there any clever way of using the accelerometer as stabilizer for the gyro ?