Close

September 28th 2023: I can't make the linear actuator move precisely

A project log for Automatic Moving Cricket Wicket

A robotic cricket wicket that automatically moves left/right to intercept pitched balls.

swaleh-owaisSwaleh Owais 09/28/2023 at 15:350 Comments

It was dumb to use a DC motor for this project. I should have just ponied up the resources for a high speed stepper. My plan was to attach a rotary encoder to the DC motor to accurately measure the number of rotations. This is not easy....

First, I tried using a fancy (and expensive) optical encoder to measure the rotary distance. But this sensor was overkill for my project. It kept on giving me bad values, I assume because I was spinning the encoder too fast. Or because I didn't know how to properly use it!

I switched to a Hall Effect setup because I thought integrating it would be easier. This was generously lent to me by my colleague Louis (thanks bro)!

The Hall Effect sensor came with a rotary disk with 5 magnets for measuring angular velocity. But again, I had an issue with pulses being skipped. I switched to making my own rotary disk with one magnet as I thought that would give more the arduino more time to transition states on the interrupt pin. BUT STILL PULSES ARE BEING SKIPPED!

Some strategies I'll try tomorrow for stopping this are getting rid of all Serial prints and delays in code. 

  1. Get rid of all serial prints
  2. Only do analog/digital write once instead of looping it
  3. Get rid of all delays
  4. Switch from monitoring change on interrupt to rising

In the mean time, enjoy these videos of the actuator zipping around!


Discussions