Advice for Project

I'm working on a project to control 2 12v dc motors with encoders in order to make sure the 2 motors are in synch. We're using these motors (http://www.andymark.com/CIM-Motor-p/am-0255.htm) and these encoders (http://www.andymark.com/encoder-p/am-3314a.htm) from AndyMark.

My questions are: 1. Will the Arduino read the data output from the encoders (the speed of the motors in rpm)? (I see AndyMark also sells speed controllers, and I'm not sure if I'll need them in addition to the encoders). 2. How difficult would it be to write an algorithm that will continuously monitor the encoders and ensure the motors get the correct power input so they are always moving at the exact speed? 3. Will we need a separate power source for the Arduino? Or can we use the same power source for the motors to also power the Arduino? 4. I'm being asked to determine how quickly the Arduino will read and react to changes in speed. How could I determine that?

Thanks in advance!

If all you want to do is control the speed of the motors that encoder is overkill. Something simple that produces one pulse per revolution of the motor would be quite sufficient and would require a lot fewer CPU cycles on the part of the Arduino. have a look, for example, at the Sparkfun QRE1113. I am using a QRE1113 to detect a blob of white paint on a small black disc on a motor shaft.

You will need a motor driver between the Arduino and the motor because an Arduino cannot produce the current required by a motor. Make sure that you get a driver that can comfortably manage the current and voltage required by the motor.

...R

Thanks Robin. The problem is that the motors will probably get different physical loads. So, one of them is bound to slow down, and we need a way to be sure they will always be in sync.

I forgot to mention that we will be using an L298N dual motor controller. http://www.instructables.com/id/Control-DC-and-stepper-motors-with-L298N-Dual-Moto/

Looking at the link above for the L298N above, it does mention that the 12v we supply to that board can also be used to power the Arduino, so that answers my question number 3 in my OP.

sderek: Thanks Robin. The problem is that the motors will probably get different physical loads. So, one of them is bound to slow down, and we need a way to be sure they will always be in sync.

What exactly do you mean by "in sync"? I assumed that you mean "running at the same speed. However if you mean that they need to hold the exact same relative angular position I reckon you have a big challenge in front of you.

I forgot to mention that we will be using an L298N dual motor controller. http://www.instructables.com/id/Control-DC-and-stepper-motors-with-L298N-Dual-Moto/

IMHO an L298 would be completely unsuitable for those motors. They have a stall current of 133 amps and, as far as I can see a no-load current of 2.7 amps and need 68 amps for max power. I suspect you need a driver capable of 70 amps continuous with overload protection against a stall.

Of course maybe a much less powerful motor would be suitable for your project.

...R

@Robin I do mean that they both need to be running at the same speed, even if one slows down.

Robin2: IMHO an L298 would be completely unsuitable for those motors. They have a stall current of 133 amps and, as far as I can see a no-load current of 2.7 amps and need 68 amps for max power. I suspect you need a driver capable of 70 amps continuous with overload protection against a stall.

Of course maybe a much less powerful motor would be suitable for your project.

We do need those motors. We plan to run them at about 1700 rpm (the max rpm is 5310), but I doubt that makes much difference when trying to find a suitable motor driver.

What specs should I be looking at in order to find a driver capable of 70 amps? Is it total DC current (it looks like the L298 is rated at 4amps)?

sderek: I do mean that they both need to be running at the same speed, even if one slows down.

That does not make sense. if one of them slows down it won't be running at the same speed.

If you explain what you are trying to make it will be much easier to make sensible suggestions.

What specs should I be looking at in order to find a driver capable of 70 amps? Is it total DC current (it looks like the L298 is rated a 4amps)?

Yes. Maybe look for an Electronic Speed Control (ESC) as used for model cars. Some of them can deliver high currents relatively cheaply. But 70 amp capability will not be cheap.

Do you need forward and reverse?

...R

Robin2: That does not make sense. if one of them slows down it won't be running at the same speed.

If you explain what you are trying to make it will be much easier to make sensible suggestions.

What I envision is a case where one motor is physically slowed down because of an increased load... Wouldn't I have to have some kind of a closed loop speed control that continuously monitored the speeds and made corrections? Something like this: http://controlsystemslab.com/dc-motor-speed-control-part-ii-pid-feedback/ (only for 2 motors, instead of one).

Yes. Maybe look for an Electronic Speed Control (ESC) as used for model cars. Some of them can deliver high currents relatively cheaply. But 70 amp capability will not be cheap.

Do you need forward and reverse?

...R

We do need forward and reverse... Is it the case that these speed controllers (https://www.andymark.com/Talon-SRX-p/am-2854.htm) would take the place of a motor driver, and are they compatible with the Arduino? It looks like they must be compatible, because AndyMark sells them in this kit (http://www.andymark.com/product-p/am-2972.htm)

  1. Yes you can write a program to do this.

  2. This is not a complex program.

3.It depends but probably yes.

  1. The Arduino can react as fast as the encoder sends it information. If you have 200 counts per revolution, you can make 200 speed corrections per rev.

MorganS: 1. Yes you can write a program to do this.

  1. This is not a complex program.

3.It depends but probably yes.

  1. The Arduino can react as fast as the encoder sends it information. If you have 200 counts per revolution, you can make 200 speed corrections per rev.

Thank you! Any advice as where to start when programming the Arduino for this project? I've never programmed one before.

You typically would use an encoder if you were concerned with the phase position of the motor or you need it to be very very accurate (as others above have said).
It sounds like you just want 2 motors run at a constant RPM despite the load.

If it were me I would use magnetic hall switch to sense each revolution. Also, I would not the arduino as the controlling element in the closed looped<< though it is entirely possible to do this, you need to know a least a little bit about digital control systems to get it to work robustly.

I would use a counter, timer and parallel DAC to get an analog read out of the RPM and have that go to compensator which controls the speed control electronics ( the speed controller can just be a voltage control current source).

Ugh. An Arduino can do it by itself.

Car ABS uses about 200 pulses per revolution. We haven't been told what the application is but for a skid-steer robot this would give good control whereas one pulse per rev will wander a little.

Look up phase-locked loop. That is one way to keep the wheels in sync, if that actually is a requirement.

The most efficient and reliable way of keeping two motors always running in sync and at the same speed is a pair of sprockets and a sturdy chain.

sderek: What I envision is a case where one motor is physically slowed down because of an increased load... Wouldn't I have to have some kind of a closed loop speed control that continuously monitored the speeds and made corrections?

Yes you need closed loop control but that should work perfectly well with a simple detector that produces one pulse per revolution. That's how I control the speed of my model train and it stays within 1% of the set speed.

We do need forward and reverse... Is it the case that these speed controllers (https://www.andymark.com/Talon-SRX-p/am-2854.htm) would take the place of a motor driver,

I'm not sure why you say "take the place of". That things is a motor driver. And it seems to be suitable.

...R

wvmarle: The most efficient and reliable way of keeping two motors always running in sync and at the same speed is a pair of sprockets and a sturdy chain.

I've suggested that option, but I'm being told that we need closed loop control.

If anything is a "closed loop" it'd be a chain! (and if the loop isn't closed, it's time for a new chain).

Anyway your problem is pretty tough to solve, in part because you have to control both motors, and the amount of change in voltage or current supplied depends on the current load of each motor.

To keep them in sync is a lot harder than keeping them running at the same speed, as you would have to make one run a little slower or faster than the other at times to have them catch up with each other if they run out of sync.

Wouldn't I need a 60 amp breaker for this project? I see the company that sells the motors only sells breakers as high as 30amps.

wvmarle: To keep them in sync is a lot harder than keeping them running at the same speed,

I understood from Reply #6 that he just needs them running at the same speed.

If they really have to be in sync then I agree that a chain or a toothed belt is the simple answer. Of course that leads inevitably to the question why not just use a single higher powered motor? It would probably work out cheaper.

sderek: Wouldn't I need a 60 amp breaker for this project? I see the company that sells the motors only sells breakers as high as 30amps.

So, buy your breakers from another supplier. And I reckon it should be rated for much higher than 60 amps. Of course that means that you must use high capacity wiring and connectors that will function reliably at loads well above the breaker's limit so that the breaker is the first thing to fail.

...R

On reading this through, I would want stronger confirmation of the 'sync' requirement.

Consider this scenario:

  • Both motors are running 1700rpm
  • The first motor experiences a greater load and drops to 1650rpm
  • Your control increases power to the first motor bringing it back to 1700rpm

Are the motors now in sync? Keep in mind, that in the time that it took the correction to occur, the first motor may have lost 3 revolutions compared to the second motor.

Is 'catching up' to the same RPM considered in sync? Or do you require the first motor to increase rpm above 1700 until it 'catches up' to the second motor, having turned the same number of revolutions as the second motor?

Both are doable, but I want a better understanding of your goal.

Speaking of which, can you give a bit more background on what you are trying to do? That is often very helpful to those of us who are trying to help you. Don't make us play 20 questions. Tell us what you are trying to do.

Oh, and start reading up on PID. You will want to understand it for either flavor of 'sync' control.

Another possible scenario: One motor is running at 1700 rpm, the other under load at 1650 rpm. Now the power is increased, but at maximum current it is doing only 1670 rpm - so the other motor has to slow down to match the speed?

What we're doing is using 2 motors with pulleys and a rope between them. The idea is that this needs to lift about 600 pounds. We want the motors to turn at the same speed, because we're not sure what it will do to the rope if one slips.

We did consider using 1 motor, but because of cost and weight, we decided against it.

I suspect that there will have to be enough pressure on the rope that the motors will essentially be mechanically linked... and if there is any doubt, then I suggested that we just physically tie the motors together (geared or chain). But, I'm part of a team, and I'm being told that my task is to use the Arduino and create a closed loop control.

wvmarle: Another possible scenario: One motor is running at 1700 rpm, the other under load at 1650 rpm. Now the power is increased, but at maximum current it is doing only 1670 rpm - so the other motor has to slow down to match the speed?

At this point, I'm open to suggestions...