Posts

Showing posts from October, 2018

Another stepper motor

Image
I was looking for a simple mock-up to be used to explain the operation of a stepper motor to my students. This is what I came up with: Just four coils on the edges of a plus-sign shape, where the two horizontal coils are connected in serial in a way that they create opposite polarity fields. Same arrangement for the two vertical coils. So we end up with a vertical and a horizontal coil. Once this is set, we use a pill-shaped magnet that will align with the vertical or horizontal magnetic field created by the coils. What is even better, current is ramped-up on one axis while it is ramped-down on the other, a smoother movement can be achieved (aka micro-stepping). Of course, that pill-shaped magnet will look familiar to you if you ever have been to a chemistry lab as they are used for magnetic stirrers. So for powering this "motor", I have used a stepper motor driver A4988 and as you can see, if field changes are fast enough, the rotor can spin and even stir a liq

Cleaning a Java Area object

Image
To determine the projection of a given 3D part, I am slicing the parts in a sequence of cuts at different heights. Each cut creates one or more perimeters or rings. The approximated desired projection is obtained by performing the union of each cut.   The image above represents the output perimeter in red color, and the number tells me there is just one. Each perimeter start is marked by a circle and its end by a square. The image below, however, does have two different output perimeters, that is, the vertical projection can be decomposed in two different disconnected areas.  I am coding in Java and using the Area class from java.awt. The main reason is that the class does include a method to do the union of areas.  However, after some weird results and some debugging, I realized the output of such a union method is not always clean. Sometimes the output is polluted with some additional paths that are not really useful or valid. In my case, I was getting some paths consisting in