I am using arduino uno R3 to build an inverted pendulum project. in my project, I am using 1. TB6600 4A 9-42V Stepper Motor Driver 2. Stepper Motor Nema 17 Bipolar 1.7A 3. (2)Optic encoders and a relay and some swithces
I am using the tone() funtion to run the stepper at different frequencies. the problem is that at low frequencies, I do not have any issues but at high frequency close to 15000, the arduino code resets.
I am using microstepping (1/8). offcourse when I double the microstepping to 16, the issue would be at around freq=30000 for the tone() function.
I increased the current to my driver from 1 to 4 and the voltage from 20 to 30, but the frequency of 15000 that caused the issue did not change.
In order to troubleshoot, I disconnected the power for the driver and ran the code by itself, it did not have any issues or limitations. it seems like the driver is causing the arduino to crash. maybe noise. please let me know if you have any ideas on what could be causing this.
Also another trouble shooting was: I took the load off the stepper motor and ran the code, in this case I did not have any issues neither, so it seems like the high torque on the motor causes issues.