Hello and thank you for welcoming me to your forum (I hope!)
I am hoping to learn if Arduino is the right environment to learn so that I can create a controller for a system (some have referred to it as a state machine?) I have developed with the following minimal requirements:
At the closure of a switch a pair of brushed dc motors with integrated hall encoders need to be smoothly accelerated to a constant speed and then smoothly decelerated to a stop while remaining synchronized and traveling over a known number of revolutions to a limit. During this transit and at a specified count of revolutions of the above pair of motors a third brushed dc motor with integrated hall encoder needs to be smoothly accelerated to a constant speed and then smoothly decelerated to a stop over a known number of revolutions to a limit.
At the opening of the same switch the single motor with needs to be smoothly accelerated to a constant speed in the opposite rotation direction and then smoothly decelerated to a stop over a known (the same) number of revolutions to a limit. During this transit and at a specified count of revolutions of the above motor the other pair of motors needs to be smoothly accelerated to a constant speed, also in the opposite rotation, and then smoothly decelerated to a stop over a known (the same) number of revolutions to a limit.
This seems doable with what I have read about Arduino and I have a mega board and ordered a single and dual Cytron motor driver shields and am willing to learn the fundamentals to figure this out but would like to know if I am going to run up against the limits of what an arduino can do. I am especially interested that the motor control be smooth and steady and no perceptible pause happens when the second motor action is started while the first is still running.
I would love to take advantage of the unanticipated downtime due to the Corona Virus to figure this out, thanks in advance for your comments!
How many pulses per second does each encoder produce? If three of them are working at the same time it might be hard for a 16MHz Arduino to keep up.
However I would expect that the bigger problem is getting the motor to stop at a specific position. DC motors tend to run on or stop short depending on the load on them. And they won't stay in a precise position if the load tries to move them.
It will be much easier to give useful advice if you describe the whole project rather than just a small part of it. Maybe stepper motors would be more suitable?
Just to make it even clearer what you are attempting to achieve with the motors, you could present a diagram with a time axis. The vertical axis would be motor speed ( minus X RPM to plus X RPM). Have a trace for each motor starting from the operation of the switch.
Thank you for your responses! let me see if I can answer them:
Robin 2- Not worried about the precision available in my system with the motors I am using, I should have been more specific from the beginning: all three motors are worm drive gearmotors engaged in drivetrains. The synchronized pair each turn a mechanically synchronized pair of jack screws while the single motor drives a rack and pinion system so they always have a load. The motors themselves are manufactured by Ketterer specifically for a similar purpose to what I am using them, the worm drive prevents backdriving when no power is applied which is essential to my application.
My problem has been that the OEM controllers available from Logicdata cannot be adapted for the use I need for a variety of reasons and it would serve my purposes better to have a ground up understanding of how to make this work.
I am not sure how many pulses per second but will endeavor to find out.
Koepel- these are the two I ordered: SHIELD-MDD10 & SHIELD-MD10
6v6gt- great idea, is this what you mean? see attached
jambonay:
all three motors are worm drive gearmotors engaged in drivetrains.
If the encoder is downstream of the worm drive you get two benefits - a huge reduction in the number of encoder pulses per second and a much greater probability that the shaft will stop at a particular encoder position. Nevertheless you may need to decelerate the motor as comes close to the desired end-point.
I understand how moving the encoder would give those benefits. I am not interested in reengineering this entire design to move encoder downstream of worm drive, the ripple effect would be devastating for a multitude of reasons.
I have attached cutsheets of the motors I am using. They are used in similar applications to mine by the thousands using off the shelf controllers. My original intention was to use the OTS controllers from Logicdata. Those controllers work perfectly in terms of precision and repeatibilty in conjunction with these motors in the system I have built for either of the discrete motor transits including keeping the pair of motors sychronized. So I think using the motors and encoders as designed is possible. Choreographing them togther was a much harder task to accomplish and after working with the sales engineer at Logicdata and a tech he referred to me we were unable to get the results I want.
I would rather use a more capable microcontroller than Arduino if that is what is required.
Is there an easy way to count the number of pulses per second? I don't see that infromation from the OEM.
jambonay:
Choreographing them togther was a much harder task to accomplish and after working with the sales engineer at Logicdata and a tech he referred to me we were unable to get the results I want.
If the professionals can't figure it out ... ? ? ?
Is there an easy way to count the number of pulses per second? I don't see that infromation from the OEM.
You could create a short Arduino program to count the pulses and do nothing else. That should be possible with an Uno. If you access to an oscilloscope it would be even easier.
Until we know how many pulses arise per second it is impossible to know whether an Arduino would be capable. There are Arduinos (such as the DUE) with much faster microprocessors.
What you're trying to do can be quite easily achieved with stepper motors - exact same movement at the exact same time by different motors (as exact as exact can ever be in the real world, of course), perfect control over how far they rotate (provided they're strong enough to make the steps they will make the exact number of steps you tell them to) and at what speed, and stopping at the exact point you want them to.
“If the professionals can't figure it out ... ? ? ?“
Yes this has been very frustrating. I can hire an engineering consultancy to produce a very expensive one-off black box, but would like to learn how these things work so I can tweak and improve organically.
“You could create a short Arduino program to count the pulses and do nothing else. That should be possible with an Uno. If you access to an oscilloscope it would be even easier“
Let me see if I can get my hands on an oscilloscope
"Any reason not to use those instead of DC motors?"
several reasons but the most important two are the form factor and the integrated wormdrive transmission which provides a power off braking function and eliminates backdriving
jambonay:
“If the professionals can't figure it out ... ? ? ?“
Yes this has been very frustrating. I can hire an engineering consultancy to produce a very expensive one-off black box,
My point about the professionals is that you may find, with your present level of knowledge, that the DIY solution takes up so much of your time that is not worthwhile.
I always recommend people to consider the question "If I had know it was going to take so long / cost so much / I would not have started it" and decide realistically what would be "too long" or "too much" as the case may be.
Just because the price of a professional engineering solution is high does not automatically make it bad value.
“My point about the professionals is that you may find, with your present level of knowledge, that the DIY solution takes up so much of your time that is not worthwhile.
I always recommend people to consider the question "If I had know it was going to take so long / cost so much / I would not have started it" and decide realistically what would be "too long" or "too much" as the case may be.”
Exactly why I am trying to assess what is entailed in getting this done and whether or not the Arduino IDE is going to be capable of coordinating to these separate motor sets as I have described before investing a lot of time in it.
“Just because the price of a professional engineering solution is high does not automatically make it bad value”
Please understand that I wasn’t suggesting that in any way. I charge in similarly serious fashion for my own professional design and fabrication work. Value can be determined in many ways and one valuable intangible is the basic knowledge of the fundamental workings of some of these devices and how to write code for them, if I can gain that in this process and get my prototype working at the same time it will be invaluable to me.
jambonay:
“My point about the professionals is that you may find, with your present level of knowledge, that the DIY solution takes up so much of your time that is not worthwhile.
Not sure why this forum is so counterintuitive, at least to me, but will strive to learn how to post better. In the meantime will write a sketch to count pulses and will have to disassemble my prototype to free up a motor for testing
jambonay:
several reasons but the most important two are the form factor and the integrated wormdrive transmission which provides a power off braking function and eliminates backdriving
DC motors are indeed generally smaller, but steppers can also come with a worm drive, and can be powered down if power use is really an issue.
Your description though sounds to me like it's pretty straightforward to implement using steppers. A day's work maybe to implement, plus a day or two of testing and fine tuning for getting the acceleration just right and so. Can allow for smooth and highly controlled running. If two of the steppers are always moving together that makes it even easier, as they can be treated as one by the software.
Doing the same with DC motors is a whole different story due to the far lower lack of control. You're going to need feedback loops to adjust the motor's speeds constantly to keep them in sync, and especially the smooth acceleration and deceleration while keeping them in sync are going to be a major problem to implement: motors do not usually react perfectly linear to PWM, and the actual reaction depends on the momentary load the motor experiences.
Note that this assessment is based on your description in the OP, which may or may not be complete.