2019-09-19 (Th) PillarGame

Up to now, the pillar would move well, but it would not track correctly. I knew it would not considering the makeshift parts it was built from so I allowed some variance, but it was so far off I knew I needed to do something. Part of the problem was the homing routine which just set the position to “0” anytime the magnet was near the sensor. This was a problem because the size of the field was multiple encoder segments wide. This resulted in an exaggerated movement when it went from one side of the home switch to the other.

The solution came in the shower and is not an original or novel solution, it was merely to observe the instant when the magnet first made contact, if moving forward, or when the magnet lost contact if moving in reverse. Sometimes, this is referred to as “rising-edge” and “falling-edge” because if you look at the pattern on an oscilloscope, the voltage level will suddenly rise or fall accordingly.
Shower thought recorder

I already did this with the pushbuttons, but this time it would have to recognize the rising edge and falling edge as well as understanding which direction the pillar was moving. Since I was only using a single encoder reader, I had to rely on motor commands to know if I was going forward or reverse. The forward direction seemed to work all right.
Stopping at HOME position

The updated routine was more complicated than “if the magnet sensor is triggered, then assume we are in the home position.” Instead, it needed to observe the motor direction, which was sloppily implemented in a couple of places, then it had to compare previous magnet switch states to know if the switch was changing from low-to-high or high-to-low.
New homing routine

The tracking went better than before, but it still needs some work. If the system were working flawlessly, it should have no more trouble moving from position “001” to “020” than it would to go from position “001” to position “080.”

Time-lapse showing position tracking

First time here?

Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6

Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com

This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.

All information in this blog, or linked by this blog, is not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property, or similar, is the responsibility of those involved in the replication.

All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by  Brian McEvoy, cannot be used to claim property or assets.

Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim property or assets based on their post.

This blog, including pictures and text, is copyright to Brian McEvoy.

2019-09-15

Comments