0

I have a DC motor (controlled by an arduino MEGA) and I plan to move some 3D Printed gears and a pulley.

I have a problem with the belt jerking when power is applied to the motor through the arduino and I'd like to know what type of formulas I can use to modify the function that makes the motor calls.

I found a guy on here who has a similar question but his is for stepper motors, not for DC. I see his approach and wonder if I can use this as well? (I just don't want to try it and break something)

Smooth A Motor Movement

I would comment on his post, but I guess you are not allowed to ask question on other people's posts, so I have to do my own to get insights on how to impliment something like that for my application.

I'm using this belt and this motor

Frank
  • 11
  • 1
  • 3
  • 8
  • 1
    Have you tried using a PWMed ramp on startup? – uint128_t Feb 27 '16 at 03:28
  • Are you needing precise control over speed up/slow down distances/times & total 'distance travelled,' or is your main concern just eliminating the driveline lash? – Robherc KV5ROB Feb 27 '16 at 03:45
  • If you have an encoder for feedback you can make a trajectory planner, like simple trapezoidal motion trajectory. If you don't position the motor (no feedback) then you can ramp the speed up/down at start/stop. – Marko Buršič Feb 27 '16 at 08:24
  • 3D printed gears... Are they a good approximation to the correct involute tooth form, with their axes separated by half the sum of the PCD of each gear? (or alternatively, "depthed" so thy run smoothly? There is an art to gear generation and entire books about it http://www.amazon.co.uk/Gears-Gear-Cutting-Workshop-Practice/dp/0852429118 which I'm not sure 3D printers have caught up with, so there's definitely room for troubles like jerky motion here. –  Feb 27 '16 at 11:16
  • @uint128_t no as i have no idea about that, i only know how to declare HIGH or LOW using digital write or 0-255 using analogwrite, thats it... – Frank Feb 28 '16 at 19:30
  • @MarkoBuršič im using linear potentiometers in my setup for feedback, pretty much a typical servo setup – Frank Feb 28 '16 at 19:35
  • @BrianDrummond i hear you but the 3D printer at not at fault here who is at fault is the designer/engineer who model the given gear and that being said there is nothing wrong with my gear setup, thanks for the link though – Frank Feb 28 '16 at 19:36
  • @RobhercKV5ROB yes i am, i need to smooth a travel of a given "unknown/arbitrary " trajectory while visual servoign is in progress – Frank Feb 28 '16 at 19:38
  • Guys i am NOT the operator in this application so i cannot physically control anything once the model is switched on, yes i see that i would have to mess with the voltage applied to the motor via a potentiometer for speed and another pot for the current maybe? but like i said this is not a RC model its a autonomous prototype – Frank Feb 28 '16 at 19:44
  • @Frank if a small amount of overshoot/undershoot in the overall motion can be accepted, you could always add a cored inductor+freewheel diode across the motor contacts. This would use the inductor to 'buffer' the starting & stopping of the motor similar to adding a physical/inertial flywheel hanging off the side of your gears. End result: slight added inaccuracy of exact start/stop points, but very simple smoothing of power on/off 'jerking.' – Robherc KV5ROB Feb 28 '16 at 20:29

2 Answers2

2

You can use simple trajectory planer from linuxcnc.com https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/motion/simple_tp.c
A planner of course just outputs setpoints: position and velocity, now it is up to you to use them for setpoints of a closed loop:

schematic

simulate this circuit – Schematic created using CircuitLab

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Tp_Notes

Marko Buršič
  • 23,562
  • 2
  • 20
  • 33
0

Mixing @uint128_t's comment with the solution the other guy found, yes, you can use this trapezoidal profile for speed.

As you didn't provide the circuitry between the Arduino and the motor, I can only guess it's linear. If it is, you can modulate the input of the driver so to control the speed of the motor. You can achieve this by using one PWM channel of the Arduino and connecting a low-pass filter on the pin to remove the modulation frequency, thus creating an analog control voltage for the driver.

If you need some fine control over distance/position, you'll have to integrate the speed trapezoidal shape (calculate the trapezoid's area) to get the total distance.

Notice the acceleration on the other answers graphic. It's a constant value that determines at which rate should speed change.
The faster you rise the speed, the bigger will be the acceleration.

The smaller the acceleration is, the less force will be applied to the belt and the smoother the motor will perform.

You can define an acceleration value and a maximum speed to create the trapezoids at runtime, pre-calculating when the speed will start to decrease based on the distance you need the belt to travel.

Filipe Nicoli
  • 838
  • 7
  • 13
  • what ? what do you mean ? how? "achieve this by using one PWM channel of the Arduino and connecting a low-pass filter on the pin to remove the modulation frequency, thus creating an analog control voltage for the driver" WHAT? – Frank Feb 28 '16 at 19:48
  • Sorry, from the information I provided I thought you could find your way. On the Arduino website you can find examples on how to create a PWM signal. There's an example on the Arduino IDE on controlling a LED's brightness using a changing PWM signal. You can try to figure that example out and change some things. – Filipe Nicoli Mar 05 '16 at 20:16
  • You may also found several tips on the Arduino forums from people building low-pass filters for their PWM signals. A PWM signal is nothing more than a pin holding a logical 0 or a 1 for a determined amount of time. If you hook a low pass filter on this pin, you'll get the mean voltage. Example: If the PWM signal is 50%, you'll get the same amount of time for the 'on time' and for the 'off time'. If your Arduino is running on 5v and you measure the output of the low pass filter, you should get 2.5v. Using PWM and a low-pass filter, you can create an analog voltage from a purely digital circuit. – Filipe Nicoli Mar 05 '16 at 20:22
  • You can then use this analog voltage to drive the motor. Again, I don't know how you are driving your motor. I don't know if you are using a bipolar transistor, a mosfet, I son't know. If the way you're driving your motor accepts an analog voltage as a controller, now you should be able not only to control whether the motor is on or off, but also some control over it's speed. Now you can use that PWM example code and ramp up/down the variable that controls the PWM. You can possibly apply @Marko Buršič's answer and let that code generate the PWM signals for you, altough I have not read it yet. – Filipe Nicoli Mar 05 '16 at 20:25
  • everything you mentioned i already know about, so this is not answer for my question, notice this link http://electronics.stackexchange.com/questions/38573/smooth-a-motor-movement they are formulas for what it is something similar to what im looking for, – Frank Mar 06 '16 at 22:43
  • Sorry, I won't do your homework. I explained everything you need to know to keep searching. Stack's help guide advises me not to answer questions that require too much guidance for me to answer in full. About the formulas, they can easily be found online. (https://en.wikipedia.org/wiki/Equations_of_motion#Constant_translational_acceleration_in_a_straight_line) Good luck. – Filipe Nicoli Mar 14 '16 at 02:25