Notifications
Clear all

Thoughts on motor encoders  

  RSS

NewburyPi
(@dale)
Estimable Member
Joined: 1 year ago
Posts: 105
2020-04-26 3:05 am  

Bill, 

I see that you are planning to use motors with integrated encoders. I've been using a much smaller motor, but with encoders to help me with waypoint navigation and speed regulation. Right now I'm using the Arduino PID controller library. It's quite easy to use and after a bit of tuning it was giving me reasonable results. 

I've recently made a modification to motor encoder circuit that has doubled the accuracy of my wheel encoders and given me even better performance. It's a simple mod, and think you may find it useful. 

The motor encoders (as you know) run with quadrature encoding. Allowing you to determine the direction of rotation. As I control the direction of rotation of my motors, this seemed to be of little use to me. Therefore I just ran one of the two encoder lines to the Nano's interrupt pin (one encoder line from each of the two motors to each of the Nano's two interrupts). 

Let's try to make this drag on much longer... The mod is to connect each of the two encoder lines from a motor to the inputs of an exclusive OR logic gate (74LS86)

image

This produces a pulse stream that is double the frequency, compared to just using the single line. 

image

Let me know if you have any questions. 

Dale

--
Dale


Quote
frogandtoad
(@frogandtoad)
Honorable Member
Joined: 1 year ago
Posts: 508
2020-04-30 4:21 pm  

@dale

Not sure if you're interested, but a while back I purchased a couple of rotary encoders from eBay - They have 600 pulses / rev and only cost ~$17AUD each for me, and certainly much cheaper for the USD tinkerers!  Not sure of their exact cost these days, but might save you some screwing around with logic gates that won't even come close in the end 🙂

 


ReplyQuote
NewburyPi
(@dale)
Estimable Member
Joined: 1 year ago
Posts: 105
2020-04-30 4:44 pm  

Thanks @frogandtoad, but I'm now sure how I would attach the encoders to my motors. My current encoders are integral to the motor's frames. On the plus, I am getting 1400 pulses per revolution and all is working just fine. 

--
Dale


ReplyQuote
frogandtoad
(@frogandtoad)
Honorable Member
Joined: 1 year ago
Posts: 508
2020-05-02 1:46 pm  

@dale

OK, no problem... looks like you have a higher resolution anyway 🙂


ReplyQuote
NewburyPi
(@dale)
Estimable Member
Joined: 1 year ago
Posts: 105
2020-05-02 3:42 pm  

Yes, I think I've got it covered. However, thank you for the suggestion.

--
Dale


ReplyQuote