Shop OBEX P1 Docs P2 Docs Learn Events
Prop to motor driver interface question — Parallax Forums

Prop to motor driver interface question

big_markbig_mark Posts: 49
edited 2007-04-30 13:26 in Propeller 1
Hi

I'm using my Prop to driver a pair of Allegro A3980 stepper motor drivers. Allegro spec sheet : www.allegromicro.com/en/Products/Part_Numbers/3980/3980.pdf.

I've modified the example LED blinker code from the manual to drive the step pins. The problem I'm getting is that sometimes one or other motor will 'stutter' a little, as if they're getting interference from somewhere. I've checked the fault flag pins on both chips while they're operating but all of the pins stay in their 'no fault' state i.e. both pins on both chips stay high. The problem seems to go away though when I connect my meter between ground and one or other of the 'step' pins. Something similar happened with the opto-switches I'm using. See this topic : http://forums.parallax.com/showthread.php?p=624334

Do I just need to connect a resistor between the step/direction pins and ground, or do I need to do something else. If its just a case of adding some resistors, how do I work out the value of the resistors that I need?

Thanks

Comments

  • big_markbig_mark Posts: 49
    edited 2007-04-28 09:02
    Anyone have any ideas?
  • JTCJTC Posts: 60
    edited 2007-04-28 10:47
    ·· Are you ramping the step rate up ?

    ·· I would have a look at some code called PAP

    ·· It even has quadratic equasion for doing ramping.

    · Jim
  • big_markbig_mark Posts: 49
    edited 2007-04-28 14:28
    I don't think the problem is with the code. I am just testing the motors and driver ciruit by switching the step pin on and off, and every 6400 steps (equivalent to 180 degrees of motor rotation) I reverse the direction pin. The motor should step on each rising edge on the step pin, so in my case it actually steps 3200 times since all im doing is inverting the step bit each time round the loop. The motors have no load on them.

    I am fairly sure the problem lies with electrical interference getting on either the step or the direction pins, as the problem goes away when I place my multimeter (in voltage mode) between the step or direction pins and ground. So I think I need to add resistors between the step/direction pins and ground. My question really is whether this is the right approach or should I try something else? If it is the right approach then how do I work out which resistors to use?
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2007-04-28 17:12
    It could be that the input thresholld on the Allegro chip is sensitive to noise or ringing, so it detects more than one transition when there should be only one. The noise can get in via external coupling or by ground bounce, and either case might be worsened by roundabout wiring. The immediate cure could be a resistor in the range of 10k to 10mohms. A little capacitance in the range of 15pf to 0.001uf might help too. It has to be empirical, cut and try. Your observation about the meter means that something like 10Mohm in parallel with 100pf worked, but I don't know what kind of meter you have and what kind of test probes it has. A more long term cure might be to look carefully at the wiring. Eliminate ground loops. Connect the circuits together with short point to point wires, both the ground and the signal, and if they are far apart, use shielded twisted pair. Is this circuit built on a breadboard? Those have high interpin capacitance, and activity on one pin can easily be coupled as noise into a neighboring pin. Change the wiring to separate things. It is easy to have ground loops when a circuit is built on a breadboard, because the temptation is to jump a wire over to the nearest Vss connection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • T ChapT Chap Posts: 4,223
    edited 2007-04-28 19:47
    I use the Allegro 3986 on several systems. Your problems sounds more like a ground problem or floating input. I would check that the driver board and Prop board have a good common GND between them first. The other issue could be a floating enable or reset. You don't need any resistors. Verify the 3980 inputs are all connected somewhere high or low.
  • big_markbig_mark Posts: 49
    edited 2007-04-30 13:26
    Thanks for the tips. I've built my motor controller on stripboard. The Allegro chips, since they are TSSOPs, have been mounted onto TSSOP-DIL adaptors and these adaptors are then mounted into DIL sockets. I know its not the best way of doing things, but it has worked for my PSU and Prop boards.

    I seem to have solved the interference problem. I soldered some 10k resistors between the STEP pins and ground and that seems to have cured the problem yeah.gif
Sign In or Register to comment.