I’m currently making a self balancing robot, powered by an Arduino Nano, and decided to use NEMA 17 stepper motors to power it.
The DRV8825 motor drivers are great, but cannot be driven using a PWM signal. Consequently the Arduino code must send a ‘step’ signal to the correct pin many times per second – Easily in the thousands if you require a decent amount of speed, especially if you’re micro-stepping.
Performance is critical…
Continue reading “Arduino Code – Performance”
In most of my Arduino projects I find myself in a situation where two things apply:
void loop() function needs to run very quickly.
- I need to output data to the serial window.
Unfortunately outputting to the serial window can add significant performance problems, so to keep the speed up I choose to only output every n milliseconds.
This requires a timer…
Continue reading “Arduino Code – Timed Events”
My current Arduino project is a self-balancing robot, which requires repeatedly reading angle and acceleration values from an MPU-6050 gyro.
These values can be quite ‘noisy’ – fluctuating considerably when vibration is added into the system – so I found myself in need of some simple code that helps smooth out the values…
Continue reading “Arduino Code – Complementary Filter”