Controlling rpm of a motor

It has been a very long time since I have been active in this group (had to make a new username) and almost as long away from electronics. I have a project that I would like to use the propeller 1 for but need some pointing in the right direction. I have a 480rpm motor from lynxmotion that has an encode attached. Think Ferris wheel with this motor driving the rotation of the assembly. I want to start the rotation off slowly and then arrive at a set rpm (190rpm). This is where I need the direction. This encode is considered Quadrature correct? That is, if I were using both the A and B input. My application will never require reverse. Do I still use both A and B and am I correct that this is the quadrature object from the obex?

Thank you to anyone who can assist.

Comments

  • 24 Comments sorted by Date Added Votes
  • It would have been nice to include a link to the motor your going to use. I found this motor on there site:480 RPM motor

    It says it uses a Hall effect encoder which is not a quadrature. I would assume that as the motor turns the sensor would vary the output voltage or maybe it just outputs a pulse each time the motor makes one revaluation. No details are given.

    To control the speed of the motor you need to drive it with a PWM signal using maybe one of these units: Dual Motor Driver

    I have used one of these to control a small tank I had laying around. Works great at driving both motors and even in reverse.

    Mike
  • You're effectively only wanting a tachometer so you only really need A or B as a pulse generator.
    Failure is not an option...it's bundled with the software.
  • iseries wrote: »
    It says it uses a Hall effect encoder which is not a quadrature.

    The method of sensing the pulses has nothing to do with wether or not it is quadrature. I have a dozens of motors that use hall effect sensors, they are all quadrature.


  • W9GFO wrote: »
    iseries wrote: »
    It says it uses a Hall effect encoder which is not a quadrature.

    The method of sensing the pulses has nothing to do with wether or not it is quadrature. I have a dozens of motors that use hall effect sensors, they are all quadrature.


    Beg to differ. Please expand on this quadrature Hall Effect.

    Hall effects are typically used for commutation of brushless motors...I have never heard of a quadrature Hall Effect and can't imagine what its purpose would be.
    Failure is not an option...it's bundled with the software.
  • W9GFOW9GFO Posts: 3,747
    edited October 14 Vote Up0Vote Down
    Mickster wrote: »
    Beg to differ. Please expand on this quadrature Hall Effect.

    Hall effects are typically used for commutation of brushless motors...I have never heard of a quadrature Hall Effect and can't imagine what its purpose would be.

    Just google "quadrature hall effect".

    0711EDEapplication_FIG1.gif

  • So....
    Best way to accomplish what I am trying to do?
  • If you are going to use quadrature code from the obex then you need to use both outputs. Using quadrature you will have greater control over the motor even if you don't need reverse.

    If you choose to use just one output then coding your own tachometer would be trivial (don't know if there is code for this in the obex or not).
  • W9GFO wrote: »
    If you are going to use quadrature code from the obex then you need to use both outputs. Using quadrature you will have greater control over the motor even if you don't need reverse.

    If you choose to use just one output then coding your own tachometer would be trivial (don't know if there is code for this in the obex or not).

    Two tachometers are listed if you go to the OBEX and search for "tach".
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • ercoerco Posts: 19,289
    edited October 15 Vote Up0Vote Down
    Yep, a single sensor can work for you and is called a "tach sensor" as opposed to a quadrature encoder. It's a simple matter to determine RPM by counting pulses in a fixed interval.
    "When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

    - Pablo Picasso
  • am am getting very jittery readings using the Xtach code.
  • altitudeap wrote: »
    am am getting very jittery readings using the Xtach code.

    How jittery? What are the min and max readings?
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • altitudeapaltitudeap Posts: 9
    edited October 18 Vote Up0Vote Down
    https://youtu.be/Ow04iKJgDmcKwinn,
    Please see the attached
  • altitudeap wrote: »
    https://youtu.be/Ow04iKJgDmcKwinn,
    Please see the attached

    OK, thats pretty bad. Could you be picking up noise from something? Motor, wiring, power supply, etc. Try running the code without powering the motor.

    You don't have the motor and prop on the same power supply do you?
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • separate power supplies.
    nothing happens when the motor is off. Likewise, if i start the program with out the motor on, and then turn it on, the program does nothing.
  • Can you turn the motor by hand and see if there is more consistency?

    "When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

    - Pablo Picasso
  • kwinnkwinn Posts: 8,008
    edited October 19 Vote Up0Vote Down
    altitudeap wrote: »
    separate power supplies.
    nothing happens when the motor is off. Likewise, if i start the program with out the motor on, and then turn it on, the program does nothing.

    Ah yes, should have realized the waitpne/peq would hang it. Turn the motor by hand as erco suggests. Is this a brushed motor (2 wires, DC in)?

    Come to think of it having no power to the motor might also mean no quadrature signal as well. Any way to disable motor only?
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • I now have one of my motors working but not the correct one.
    I have an EMG30 motor connected and i went back and read the spec sheet and it stated that i needed a 4K7 pullup resistor which i was not using.
    With it in place, i can make the xTachtest.spin display the rpm https://youtu.be/a53cDP4_tIo

    With the Linxmotion motor and encoder, i cant make it work either way. But it looks to me that the pullup is build into the encoder. (i cant attach an image so here is the pdf for the encoder https://robotshop.com/media/files/images2/encoder_specification_e-16ppr.jpg)

    Any ideas on what i am doing wrong? I have ordered another motor to see if mine is bad but it wont be here until monday.
  • WhitWhit Posts: 3,996
    edited October 21 Vote Up0Vote Down
    Wonder if you could filter the signal with a capacitor? Looks like it might be caused by motor noise.

    https://www.arrow.com/en/research-and-events/articles/using-capacitors-to-filter-electrical-noise

    I was having some trouble with motor noise interfering with an IR signal on a robot (m-Arlo). Using a small (0.1 uF capacitor (Parallax #200-01040)) capacitor between the signal and ground filtered the noise and all was fine.

    See also https://www.parallax.com/product/751-00012 I especially like the "Overview" note on this page - "Circuit not working? Put a capacitor on it! Capacitors are used almost everywhere in electronics: from energy storage to signal coupling. (Signal coupling allows AC signals to pass while blocking DC signals. Like when Gandalf yells, "You. Shall. Not. Pass!" at Balrog in the mines of Moria. But you don't have to do that when you add one of these to your circuit. Bonus points if you do.)"

    Might be worth a try...
    Whit+

    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • I recieved my new motor replacement today. The old one was faulty. The new one works.
    Question regarding math. The xTach code wants to know pulses per revolution so that it can devide to calculate rpm. My motor has a gearbox with a gear reduction of 1:5.2 and the encoder has a 16 PPR. This gives me something like 83.2 PPR on the output shaft. I am trying to maintain 190 rpm. Given the decimal number, would it be best to just round down to 83 so as not to have to use float and then try and call rpm with some sort of an adjustment factor? Sorry if I am not making sense
  • @altitudeap - glad you found the fault!
    Whit+

    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Instead of using floating point math, multiply everything by some factor to remove the decimal point, do the math and then at the end divide by the factor. So if your reduction is 1:5.2 then change that to 10:52 (x10) then your PPR comes out to 832 for 10 revolutions. So 190RPM /10 =19. 19 x 832 = 15,808 pulses. No floating math required!
  • Or when possible use a power of 2 factor so you can shift the values rather than multiply or divide them.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
Sign In or Register to comment.