We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

First understand that myStepper.step(x) method is relative steps not absolute. So if you want the motor to do two rotations of 45 steps back to back you should write myStepper.step(45); myStepper.step(45); /// NOT myStepper.step(90) <-- that's 90 MORE steps Second, it looks like your code will increase steps taken by 45 while HOLDING the button down ...


0

The event of a button press is not deterministic in your case. Generally, your delay()-approach combined with reading the current button state is not how sth. like this works. Instead, you have to detect when a button is pressed/released. One way to do that is the following: #define buttonPin 8 bool last_state=false; void loop(){ if(!digitalRead(...


0

DC Motors with a feedback line (so called PID Controller; https://en.wikipedia.org/wiki/PID_controller) would be the best way to do it. You need the motor as an actor and some sensors that sense the direction of the axis's of the gimbal. The PID controller should be very fast for smooth operation. (Perhaps an ESP32 is a better MCU for this purpose). The PID ...


0

A stepper motor might work, but it is certainly not the best choice for what you try. Instead you should use brushless motors. There are not so hard to use, as you think. Driving them directly is difficult, but no one does that. Instead just buy an ESC (Electronic Speed Control) (one for each brushless motor). That is an extra chip/board, where you need to ...


1

When motors stuck their current draw increases, you can sense that increase in the current and then change the rotation of the motor. The simplest way to measure current is with using a shunt resistor, for sensing high currents, current sensors based on hall effect sensors is usually used. ACS712 is one example. How to sense current using a shunt? ...


Top 50 recent answers are included