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.
Multi-Processor Stepper motor control
- Attachments
-
- circuit.png (50.38 KiB) Viewed 2632 times
Re: Multi-Processor Stepper motor control
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.
Re: Multi-Processor Stepper motor control
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
Martin
Re: Multi-Processor Stepper motor control
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.
Re: Multi-Processor Stepper motor control
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.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
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.
Re: Multi-Processor Stepper motor control
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!joan wrote: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.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
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.
Martin
Re: Multi-Processor Stepper motor control
PWM can be used to control the mark/space ratio of the pulses that are used by servos.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!
Stepper motors require a sequence of on/off signals on (usually) two or four wires.
Re: Multi-Processor Stepper motor control
Thanks again - I am glad responded to this thread! Now I have a clearer understanding of the function of some of the pins.rpdom wrote:PWM can be used to control the mark/space ratio of the pulses that are used by servos.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!
Stepper motors require a sequence of on/off signals on (usually) two or four wires.
Martin