sheel
Posts: 2
Joined: Mon Aug 22, 2016 12:13 pm

Multi-Processor Stepper motor control

Tue Aug 23, 2016 7:14 am

Hello Everyone,
I am working with three raspberry pi boards working for a particular task. I have programmed them such that they will all work simultaneously in different environments and the one that succeeds to complete its task, signals a stepper motor to move to a position based on the results of the program. I initially did this with a single Pi board and was successfully able to control the motor. However, with three boards working together, the motor takes no signal from any of the processors even when I have used a multiplexer (CD74HC4067). I have attached the circuit diagram below. To clarify, motor is being signalled by only one processor in a cycle.
I am from the mechanical engineering background and a novice to electronics and have learnt about the components and their working with google. Kindly consider this and pardon me if I am being stupid anywhere.
Attachments
circuit.png
circuit.png (50.38 KiB) Viewed 1250 times

sheel
Posts: 2
Joined: Mon Aug 22, 2016 12:13 pm

Re: Multi-Processor Stepper motor control

Tue Aug 23, 2016 10:03 am

I am sorry I did not explain the circuit diagram. I have connected pin 4 of each Pi to the control pins of the multiplexer and have set them to LOW as default. The processor that is able to find the template, turns its pin 4 HIGH to gain access to the output pin of the multiplexer. The output pin is then controlled by pin 7. I have used the same circuit with output pin connected to an LED. The LED works as desired. However, the motor does not respond to these signals. The motor is not damaged as it works fine with a single processor.

duckula
Posts: 3
Joined: Wed Aug 24, 2016 4:46 am

Re: Multi-Processor Stepper motor control

Wed Aug 24, 2016 4:51 am

Novice here too so ignore if this is a silly suggestion or something you have already accounted for. To control the stepper motor - I would try a PWN pin - I think this is GPIO18.

Martin

T3am5hark
Posts: 62
Joined: Wed Jul 17, 2013 5:37 pm

Re: Multi-Processor Stepper motor control

Wed Aug 24, 2016 5:26 pm

Are all 3 pi's on a common network? If so, then you might consider taking the MUX out of the equation and instead allowing a dedicated process on one of the Pi units drive the motor using remote signalling from the other 3 processes (using either web service, RPC/socket-based, or a message queue subsystem - all of these could work). This might be simpler than trying to electrically couple 3 control signals through a multiplexer, just a thought.

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

Re: Multi-Processor Stepper motor control

Wed Aug 24, 2016 7:37 pm

duckula wrote:Novice here too so ignore if this is a silly suggestion or something you have already accounted for. To control the stepper motor - I would try a PWN pin - I think this is GPIO18.

Martin
On recent Pis (those with the 40 pin expansion header and the compute module) GPIO 12/13/18/19 may be used for hardware PWM.

However you don't need to use PWM to drive a stepper motor and unless you have a peculiar requirement it's probably best not to use PWM for a stepper motor.

duckula
Posts: 3
Joined: Wed Aug 24, 2016 4:46 am

Re: Multi-Processor Stepper motor control

Wed Aug 31, 2016 4:52 am

joan wrote:
duckula wrote:Novice here too so ignore if this is a silly suggestion or something you have already accounted for. To control the stepper motor - I would try a PWN pin - I think this is GPIO18.

Martin
On recent Pis (those with the 40 pin expansion header and the compute module) GPIO 12/13/18/19 may be used for hardware PWM.

However you don't need to use PWM to drive a stepper motor and unless you have a peculiar requirement it's probably best not to use PWM for a stepper motor.
Thanks - that is interesting. I thought the whole point of the PWN pin was to be able to provide the voltage variations that stepper motors required. Oh well - live and learn!
Martin

User avatar
rpdom
Posts: 13911
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Multi-Processor Stepper motor control

Wed Aug 31, 2016 5:16 am

duckula wrote:I thought the whole point of the PWN pin was to be able to provide the voltage variations that stepper motors required. Oh well - live and learn!
PWM can be used to control the mark/space ratio of the pulses that are used by servos.

Stepper motors require a sequence of on/off signals on (usually) two or four wires.

duckula
Posts: 3
Joined: Wed Aug 24, 2016 4:46 am

Re: Multi-Processor Stepper motor control

Fri Sep 02, 2016 3:56 am

rpdom wrote:
duckula wrote:I thought the whole point of the PWN pin was to be able to provide the voltage variations that stepper motors required. Oh well - live and learn!
PWM can be used to control the mark/space ratio of the pulses that are used by servos.

Stepper motors require a sequence of on/off signals on (usually) two or four wires.
Thanks again - I am glad responded to this thread! Now I have a clearer understanding of the function of some of the pins.
Martin

Return to “Automation, sensing and robotics”