Controlling rpm of a motor
altitudeap
Posts: 9
in Robotics
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.
Thank you to anyone who can assist.
Comments
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
https://www.robotshop.com/en/lynxmotion-12v-480-rpm-2123oz-in-152-brushed-dc-gear-motor-w--encoder.html
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.
Just google "quadrature hall effect".
Best way to accomplish what I am trying to do?
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".
How jittery? What are the min and max readings?
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?
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?
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.
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...
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