Raspberry Pi : 2 Model B v1.1 This is the circuit I am trying to implement : http://www.homofaciens.de/bilder/technik/v-plotter_012.htm

This is the code : https://ideone.com/vDPtsa

I have made the following connections : Left Motor : InA :- PortNo - 26 InB :- PortNo - 24 InC :- PortNo - 22 InD :- PortNo - 23

Right Motor : InA :- PortNo - 13 InB :- PortNo - 15 InC :- PortNo - 19 InD :- PortNo - 21

Problem : Only my left motor is functioning properly whereas right stepper motor is only vibrating (stuttering). Both these motors have been tested individually using arduino. They worked fine. I am using L298 Dual H Bridge motor for driving these stepper motors.

  • Have you checked the GPIO connections? your Pi has a larger header than the one displayed – mystery Jun 30 '16 at 11:49
  • can you help me in finding the equivalent pins in the larger header? As of now I have tried to map according to the GPIO number, which happened to be the same pin numbers as mentioned. – Mihir Saxena Jun 30 '16 at 12:13
  • Refer to this raspberrypi-spy.co.uk/wp-content/uploads/2014/07/… Although I just found out they are pretty much identical across generations, except for header location (split on earlier models). Are the Pins set to the correct mode? some of them are used for SPI for instance. – mystery Jun 30 '16 at 12:20
  • I think SPI is not enabled by default but I could be wrong. – goldilocks Jun 30 '16 at 13:00
  • In that case both motors shouldn't work right? In any case can you guide me in explicitly enabling SPI? – Mihir Saxena Jul 1 '16 at 4:25

The error is quite likely a bug in the programme. But to be sure:

  • have you swapped left and right motor to doublecheck?
  • have you measured the voltage of the input line of the motor? Does the signal "stutter" as well?

If so, you have to debug your program. If you're not used to professional debugging tools, you can start by echoing the values of important control variables of the programme (or writing them to a debugging log file instead...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.