santhoshk1983
Posts: 3
Joined: Thu Aug 25, 2016 5:49 am

Controlling 40 Motors using Pi

Thu Aug 25, 2016 6:09 am

Hi,

I'm an Application developer and I'm new to Raspberry Pi and as well as Electronics. I have some requirement to control different types of Motors (Servo, Stepper, Gearless DC Motors). It also needs to control AC power supply to larger AC motors. User interface will be the touch screen. Users has to select certain Applications (which will be programmed by me!) in Pi, and that application needs to control the power supply and degree of rotation for certain motors out of total 30 to 40 motors.

Can any one please tell me how to achieve this?

Thanks,
San

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 8:42 am

Wow you have set yourself a task, I have been using the PI for a year now, have a few but I am not new to electronics, been doing that for 50 years, I would say you may need more than one pi but the pi's can be networked, the pi its self has PWM and straight in and out pins but 40 motors that is one huge machine, what's it for a printing press? laminator?, the PI is great for projects of many sizes but my advice to you would be to use the pi as the control interface and PIC's to do the rest, can use the I2C bus to control the PICs, if the machine is big then you will need low impedance i2c bus drivers and repeaters to get the bus signals around the machine, I come from Watford, been here over 60 years and have some experience of the old papermaking and print machines that this town was famous for, they have 40 motors or more of varying sizes, consume huge amounts of power and have control panels that fill a large room and you want all that controlled by a raspberry pi, I stand in respect to you, I think the being new to electronics may hold you back as I have some knowledge of the electronics needed to control such a huge beast, but will be here to offer you advice, would be helpful to know just what size these motors, you do know that we installed and uninstalled the main breakers with a fork lift.

I would not mind betting the PI could do it, what size are these motors?
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 9:11 am

Is it your intention to replace the PLC's with a raspberry pi, the pi is a fraction of the price of a PLC but a PLC is a reliable cart horse, where as the PI is a race horse. you do get what you pay for.

https://en.wikipedia.org/wiki/Programma ... controller
Last edited by johnb_summers on Thu Aug 25, 2016 9:37 am, edited 1 time in total.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

User avatar
joan
Posts: 14689
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 9:29 am

santhoshk1983 wrote:Hi,

I'm an Application developer and I'm new to Raspberry Pi and as well as Electronics. I have some requirement to control different types of Motors (Servo, Stepper, Gearless DC Motors). It also needs to control AC power supply to larger AC motors. User interface will be the touch screen. Users has to select certain Applications (which will be programmed by me!) in Pi, and that application needs to control the power supply and degree of rotation for certain motors out of total 30 to 40 motors.

Can any one please tell me how to achieve this?

Thanks,
San
You need to hire someone who understands the issues involved. It sounds like a large job, there must be money in the budget to hire expertise.

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 10:02 am

the more I think of this the more concerned I get, I came to this forum with my first post being a post about blown sd cards, I have 7 Pi's on 24/7 for the last year and have 13 blown SD cards, for my project no big deal as it seems to be particular cards that blow, but if you intend to replace PLC's with the PI then you have a major issue, a paper making machine has many large steel rollers weighing many tons, theses spin, to have a sd card blowing while they are spinning could result in a major accident due to rollers getting jammed. you cant rely on SD cards.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

santhoshk1983
Posts: 3
Joined: Thu Aug 25, 2016 5:49 am

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 10:14 am

johnb_summers wrote:the more I think of this the more concerned I get, I came to this forum with my first post being a post about blown sd cards, I have 7 Pi's on 24/7 for the last year and have 13 blown SD cards, for my project no big deal as it seems to be particular cards that blow, but if you intend to replace PLC's with the PI then you have a major issue, a paper making machine has many large steel rollers weighing many tons, theses spin, to have a sd card blowing while they are spinning could result in a major accident due to rollers getting jammed. you cant rely on SD cards.

Hi John,

Thanks for the reply. The device what I'm trying to build (RnD) is to heat and mix elements and the height of the whole device will not exceed more than 70 cms. My Idea is to have Pi and touchscreen for user interface. Motors I will be using mostly will be Nema 17 Stepper Motors which has torque of like 5 Kgs/Cm. And of course with 10 small servo motors. I need not to rotate all 30-40 motors at a time. When user provides inputs through application, application needs to decide which motors it needs to provide power and how many degrees it needs to rotate. Also AC motor is out of scope now.But I will be using AC power supply for heating elements. I have read somewhere else, that If pins are not enough from the chip, there are ways that we can extend it by some extension or buffer pins (God knows what!). Any Ideas John?!

Thanks,
San

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 10:38 am

santhoshk1983 wrote:
johnb_summers wrote:the more I think of this the more concerned I get, I came to this forum with my first post being a post about blown sd cards, I have 7 Pi's on 24/7 for the last year and have 13 blown SD cards, for my project no big deal as it seems to be particular cards that blow, but if you intend to replace PLC's with the PI then you have a major issue, a paper making machine has many large steel rollers weighing many tons, theses spin, to have a sd card blowing while they are spinning could result in a major accident due to rollers getting jammed. you cant rely on SD cards.

Hi John,

Thanks for the reply. The device what I'm trying to build (RnD) is to heat and mix elements and the height of the whole device will not exceed more than 70 cms. My Idea is to have Pi and touchscreen for user interface. Motors I will be using mostly will be Nema 17 Stepper Motors which has torque of like 5 Kgs/Cm. And of course with 10 small servo motors. I need not to rotate all 30-40 motors at a time. When user provides inputs through application, application needs to decide which motors it needs to provide power and how many degrees it needs to rotate. Also AC motor is out of scope now.But I will be using AC power supply for heating elements. I have read somewhere else, that If pins are not enough from the chip, there are ways that we can extend it by some extension or buffer pins (God knows what!). Any Ideas John?!

Thanks,
San
hi san
I see, so not replacing the PLC but making a bespoke system for something like an indoor green house, lol, I was a hippy, peace and love, and I did inhale, I am building a website with my project and it has basic circuits for the things you will need, I have on order a 16-Channel Servo Driver Board for Arduino 12-BIT PWM-12C Interface from china so I can add remote I2C PWM to the list once I have tested it with my drivers and extenders, the site is http://mypiworld.com you will want the hobbyist and inventors part and devices, I am currently building the site as I build the boards, the site will show the address of demo sites that have the GPIO and I2C chips running, mostly only circuits are up there as I build a circuit first, then test, do the PCB and then description and I am long way off from finishing the site, well I am just one old git that needs to rest a lot, lol.

But the chips for the things you need are up there and some are running on the demo, today I received soic 24c02 eeprom chips from element14(the suppler we all use to get our bits) that I will replace the 24c32 eeproms on the RTC DS1307 Real Time Clock Module AT24C32 Board for Arduino TE187 that is currently on test and shown on demo 3, when that fully working I will add the circuit diagram for my version of it which will be just a bit different from the original.

I will think a bit more, if you want things that are not covered then message me and I could find the chips and build a circuit, but feel free to email me or message me so you don't have to use this public forum.

john
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7916
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 11:59 am

It sounds like any of the boards using the PCA 9685 i2c pwm controller chip is probably what you need, providing 16 channels of pwm control. (it's the same chip as John will be using on his generically named board).
The control code can either all be done from userspace sending i2c commands, or there is a device tree overlay that exposes it through the kernel pwm infrastructure (needs modification to support more than one chip on the same system).
Connect the outputs to a suitable motor drive chip for the particular motor, and job is pretty much done.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 12:19 pm

6by9 wrote:It sounds like any of the boards using the PCA 9685 i2c pwm controller chip is probably what you need, providing 16 channels of pwm control. (it's the same chip as John will be using on his generically named board).
The control code can either all be done from userspace sending i2c commands, or there is a device tree overlay that exposes it through the kernel pwm infrastructure (needs modification to support more than one chip on the same system).
Connect the outputs to a suitable motor drive chip for the particular motor, and job is pretty much done.
Yes agreed.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

User avatar
joan
Posts: 14689
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 1:09 pm

6by9 wrote:It sounds like any of the boards using the PCA 9685 i2c pwm controller chip is probably what you need, providing 16 channels of pwm control. (it's the same chip as John will be using on his generically named board).
The control code can either all be done from userspace sending i2c commands, or there is a device tree overlay that exposes it through the kernel pwm infrastructure (needs modification to support more than one chip on the same system).
Connect the outputs to a suitable motor drive chip for the particular motor, and job is pretty much done.
Remember that the PCA9685 was not designed as a PWM chip for motor control, but as a PWM chip for LEDs. All 16 outputs must have the same PWM frequency. A frequency suitable for a servo (50Hz) is unlikely to be suitable for DC motor speed control, and I can't see it being at all useful for a stepper (unless you don't need fine position control).

PWM direct from the Pi is more flexible.

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 1:36 pm

joan wrote:
6by9 wrote:It sounds like any of the boards using the PCA 9685 i2c pwm controller chip is probably what you need, providing 16 channels of pwm control. (it's the same chip as John will be using on his generically named board).
The control code can either all be done from userspace sending i2c commands, or there is a device tree overlay that exposes it through the kernel pwm infrastructure (needs modification to support more than one chip on the same system).
Connect the outputs to a suitable motor drive chip for the particular motor, and job is pretty much done.
Remember that the PCA9685 was not designed as a PWM chip for motor control, but as a PWM chip for LEDs. All 16 outputs must have the same PWM frequency. A frequency suitable for a servo (50Hz) is unlikely to be suitable for DC motor speed control, and I can't see it being at all useful for a stepper (unless you don't need fine position control).

PWM direct from the Pi is more flexible.
I think he could use a combination, my gut tells me to use PIC's and the PI as an user interface, PIC's these days can do anything, but I don't know enough yet about what his aims are, but his servos could all be controlled from PCA9685, he has heaters in the list too, they could be controlled from a MCP23008 or a PIC with relays attached, he then needs feedback from what ever is being heated that could be an A to D or a temp chip, so I think the PCA9685 will be a small part of his project, he has only told us about what motors he wants running he has told us nothing about the feedback needed to create the control system, his app must have input for it to warrant any kind of user output, I am sure in time he will ask about that.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 2:14 pm

Found a chip for your stepping motors, AMIS-30624, not cheap, £6.83 in element14, is I2C, only 0.8 amps, do you have dc motors? are they 12v pumps? what current do the heaters draw and is the environment hostile, you say to mix elements, well that sounds very confusing, are these elements bonding when heated, like in laminating machines the glue is activated with a heated roller, or is this container void of oxygen? oxygen can combine with many things when heated, don't even need to be heated in our case just present with another element, our cells do it all the time. what sort of temperatures are we talking about and what kind of elements, and at what speed do these motors spin? not making heavy water are you? lol, joke.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

henryhanselscott
Posts: 107
Joined: Sun Jan 18, 2015 1:31 pm

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 3:16 pm

Another approach is using the pi as a "Front end" and a PLC as the actual controller. I program PLC's everyday and there robustness is undeniable. However, often they lack in the ability to support a sleek GUI for the operator unless you buy a very expensive PLC compatible touch screen. I have used modbus to build a pi based GUI that is being operated by a PLC and it works well. System critical things are totally handled by the PLC and if the GUI crashes the PLC can safely shut down the system. All this may be overkill for your needs...but it is a way that works well for some applications..


Henry

User avatar
johnb_summers
Posts: 285
Joined: Thu Aug 04, 2016 7:48 pm
Location: Bushey UK

Re: Controlling 40 Motors using Pi

Thu Aug 25, 2016 3:39 pm

henryhanselscott wrote:Another approach is using the pi as a "Front end" and a PLC as the actual controller. I program PLC's everyday and there robustness is undeniable. However, often they lack in the ability to support a sleek GUI for the operator unless you buy a very expensive PLC compatible touch screen. I have used modbus to build a pi based GUI that is being operated by a PLC and it works well. System critical things are totally handled by the PLC and if the GUI crashes the PLC can safely shut down the system. All this may be overkill for your needs...but it is a way that works well for some applications..


Henry
yes, I like that, the PLC is a well used and trusted work horse can handle hostile environments and can shut everything down in an orderly fashion should the pi sd card fail.
MyPi Developer
http://mypiworld.com/
http://mypi.tech/

https://www.youtube.com/watch?v=US2nyRgg-SY&nohtml5=False

santhoshk1983
Posts: 3
Joined: Thu Aug 25, 2016 5:49 am

Re: Controlling 40 Motors using Pi

Fri Aug 26, 2016 4:45 am

Hi All,

Thanks for your wonderful inputs. The device that I'm working is nothing but a elements mixer and heater which will be used for testing the reactions between different organic chemical compounds like Capsaicin (Found in Chillies) and curcuminoids (Found in Turmeric). So the heating will not go beyond 150 Degree Celcius.( Hoping the same amount of heat is produced at our induction cooktops). I started working on Arduino couple of months back and was checking with sample of 2 motors and relays for controlling AC to a Light bulb. That's how far I know about electronics. But Arduino lacks the sophisticated OS for User inputs and that's how I ended up with Raspberry Pi. I assumed that using Rasp Pi and Buffer chips, I can connect 30-40 motors. I'm not sure about what is PLC, probably need to look into that. I need your help in pointing me to the right direction and as with your experience, you guys can tell me whether it is feasible to do it or not with a single Pi and couple of other chips which needs to come handy (should not occupy a whole room like a data center. Lol!)

Thanks,
San

Return to “General discussion”