DC Motor Challenge
graef685 wrote 10/17/2016 at 21:48 • 1 pointWe have 2 DC-Motors with wheels assembled, controlled by any Microcontroller or Computer, e.g. an Arduino.
We have built a vehicle out of these and now we want to perform a 360 degree spin with it under the following requirements:
- One motor runs forward and the other backward with the same speed
- Motor speed is a variable and can be set between 0 and 255
- Charm of a DC-Motor: It takes some little (unkown) time to get them running at full speed and to stop them completely
Our Goal to reach is to spin the vehicle exactly by 360 degrees under following circumstances:
- Motor speed should be customizable, thus still a variable
- this leads to, that the time needed to perform the spin is not fixed, but depends on the motor speed
Create a formula for this or realize it with additional components like sensors. Anything is allowed. Post your code and thoughts here.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Well, to precisely control DC motors you basically need servo control. This is typically done with an incremental encoder. But this is not a simple feat to do.
https://hackaday.io/project/11583-odrive-high-performance-motor-control tried to do that but uses an FPGA to provide fast enough feedback. You may not need that level of control, but is still won't be easy.
With the level of skill I suspect behind your question you should consider using stepper motors as does everyone else who gets started with this kind of project.
Are you sure? yes | no
Solenoid to engage Sharpie drawing on the ground. Stop when you encounter the start of the circle again : )
Are you sure? yes | no
add a BMI160 (acc + gyro), calculate rotation and drift, "learn" kinematics of the device and apply iterative forward corrections. Still, proper servo control for the motor would be the way to go. Industrial solution: multipole magnet on shaft, two cheapo hall switches next to is for quadrature signal. Servo loop implemented in software.
Btw. since the motor current is torque dependent, voltage control is more benign than current control (I've had my share of the fun with automotive window lifters). Suggest using FET bridge with tracking POL DCDC module (cheap and efficient).
What sort of challenge is this anyway?
Are you sure? yes | no
Use a hall effect sensor near the wheel and a small magnet to check the position.
Are you sure? yes | no