Controlling Position of 10 DC motors with the feedback from seperate encoders

Hi there,

I'm new in this forum and arduino things. I'm sorry for any mistakes about this topic.
I am about to graduate from school and i am working on a project which is due to tomorrow. :o :o :o

Luckily i do not need to build the project. I just need an arduino connection scheme which i can represent in the project. I can

I need to control position of 10 DC motors seperately. Each DC motor has its own encoder. I dont know where to look and what to write into the search box. I need a little push for the start.

I know it is not something i can learn in one day pls dont judge. I dont need to learn just represent a scheme and bill of materials for cost analysis.

I am appreciated for any help and again sorry for any mistakes.

Unless your motors are turning VERY SLOWLY I don’t think a 16MHz Arduino will be able to work fast enough for 10 encoders.

How many pulses per revolution does each encoder make and how many revolutions per second at the maximum speed you will be using.

And it will require reasonably complex code to get a single DC motor to maintain position.

…R

Firstly, Thanks for the reply..

The reason that make us to choose DC motor was cost. We were planning to build this at first, but we changed our minds to just presenting it.

We do not have any minimum speed limitation. It can be around 20-30 rpm.

I know the numbers and the setup seems silly and maybe DC motor for this application is impossible.

My dad told me that i can drive these motors with a pic circuit, but the project consultant teacher said that we should use arduino.

Actually the motors drive linear actuators.

I dont really know what information i can or should give you other than these. :confused:

An Arduino uses Atmel microprocessors which are like PIC microprocessors in the same way the Volkswagen cars are like Fords.

You can tell us how many pulses per revolution your encoder has. Better still, post a link to the datasheet for your motors.

30 rpm is 0.5 revs per second. If there are 64 pulses per revolution that means 32 pulses per second per motor. With 10 motors that means 320 pulses per second or, on average, one every 3125 microsecs which would be manageable. However the pulses from the different motors won't be evenly spaced so you could get 5 or 6 pulses in the same microsec and if so some of them will be lost.

You can do your own calculations for higher speeds.

My inclination would be to have no more than 2 motors per micro-processor.

In any case the first thing to do is learn how to control a single motor.

...R

I think too much research cause me to mix up all the terms.

I use an analog potentiometer to figure out the position and i compare the desired voltage with output voltage of potentiometer. When they are equal motor should stop. This is the general idea of our control system.

I saw encoder word somewhere and i think it mixed up the things here.. Idk

does this change things?

Btw I have choosen motors only with the constructional concerns. Mainly dimensions. Its not a proper way to choose a motor, but i dont have any load on the motors other than some little friction.

As a result the motors do not have any datasheet. Just some spec information like:
Working Voltageı: 12V
Speed: 120Rpm
Unloaded Current: 75mA
Strain Current: 2A
Diameter: 24mm
Length:72 mm

mechanio:
I use an analog potentiometer to figure out the position and i compare the desired voltage with output voltage of potentiometer. When they are equal motor should stop.

That sounds like you are trying to make something that functions like a hobby servo?

Post a diagram showing the sort of thing you are planning to make? Also tell us what the whole project is.

Are you using a step-down gearbox with the motor.

...R

PS. I just noticed in your Original Post that your project is due on 28th May 2018. Sorry - starting from where you are now that won't happen.

mechanio:
I think too much research cause me to mix up all the terms.

I use an analog potentiometer to figure out the position and i compare the desired voltage with output voltage of potentiometer. When they are equal motor should stop. This is the general idea of our control system.

I saw encoder word somewhere and i think it mixed up the things here.. Idk

does this change things?

IF you don't have encoders on the motors, do you have potentiometers connected to the motor shafts? Where does the motor change the voltage you are measuring to find an equal?

Paul

Must the motors turn several rotations? Or just some 180 to 270 degrees, which is what a potentiometer can turn.

The job i am trying to get done is to similar to in this link:
https://shiftautomation.com/linear-actuator-control-programmable-positions

My arduino connection diagram is attached.

One of my friends told me to connect the DC motors like this. He also said that this is not realy a proper way to control these things.

It is two platforms controlled by 10 motors. Each has 5 motor. These platforms hold the wheels of a vehicle and by controlling these links vehicle will change its width etc.

Its not changing the length while moving though. Just editing length and starts moving.

The first link i shared is a good example since they use a linear actuator with feedback from a potentiometer.

Although i have an example, i need to apply this to 10 motors. This is where i stuck.

Thanks for Helps!

EDIT: photo didnt show up even though i attached.. This is the link
https://ibb.co/cQMfay

Robin2:
T

Are you using a step-down gearbox with the motor.

PS. I just noticed in your Original Post that your project is due on 28th May 2018. Sorry - starting from where you are now that won't happen.

Yes i am using a speed reductor with the motor.

Yeah i know that is the reality, but if i cant figure this out i will present it for just 1 of the motors. Its just this part of the project which is missing. So i am trying to complete this part too..


I will use 10 turn potentiometer directly connected to the shaft of the motor. There are multiturn potentiometers as i found..

The links in Reply #9 are not useful. I think there may be a video in the first link but it does not appear for me. The second link is far too complicated to be useful.

If you seriously want help then just concentrate on a single motor for now.

Post a link to the datasheet for your motor.

How will the potentiometer be connected to the gearbox output shaft?
Is the multiturn pot designed for use with a motor or will it wear out after 5 minutes?

Are you familiar with the Arduino PID library? You will almost certainly need to use it to get stable position setting.

...R

PS. for future images see this Simple Image Guide

So you don’t need to build it but just say how you would build it? Easy.

10 potentiometers need 10 analog inputs. Use an Arduino Mega which has 16 analog inputs.

10 DC motor drivers need 10 PWM pins and 10 direction pins. If you want dynamic braking (always a good idea) then add 10 more digital pins. Still within the capacity of the Mega although you don’t have a lot of spare pins for pin-hungry devices like LCD screens. Plan on using SPI and I2C for screens and sensors.

Physically wiring to 10 motor controllers will be messy but that can be ignored for now.

So, does the Mega have the processing power to run all 10 motors? Just doing one analogRead() and ignoring the result, you can only do 10,000 reads per second. Lets say your code will take a reading, do some calculation and output the result to a motor with analogWrite() on the PWM pin. That might take 10-20 times longer. So you can do that 500 times per second.

500 motor updates per second lets you touch each motor 50 times per second. How far can it move away from the desired output in a 50th of a second? Not far at all. Even if the motor is moving fast, say 100 revolutions per second, you commanded it to move fast. If your command asked for 105rps then it is only moving away from the desired position at 5rps so measuring 50 times per second means it can only be 0.1 turn away before you look at the potentiometer and update the output.

So how do you determine the correct output? Use the PID library and create 10 PID objects.