Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Motorizing a filter wheel 2" :)


msacco

Recommended Posts

Hey!

I'm thinking of motorizing a 2" filter wheel(which I currently don't really own), but I should get the following in the upcoming weeks:
image.png.3bce334da2cb0fe7f1ae38ce4a7ea881.pngimage.png.efd6e4a9f884812ca55336cd68e02a34.png

Basically a pretty standard filter wheel, and the design seems to be fine for the job(smooth round wheel teeth).

So I've seen the following old post by @kbrown:

And that looks just awesome, BUT..I'm missing some basic understanding of the design in order to actually make it work.

I think I'll either try to use the same mechanics to rotate the wheel, or maybe just get a belt drive, but I think that this is the rather easy part here, what seems more complex to me is the hall sensor usage and the magnets of the design which I'd like to get a more deeper understanding otherwise I'd probably fail, and he also said that at the beginning he had some issues with the hall sensor and the magnets not registering properly.

As for the motor, do you guys think the 28BYJ-48 would be enough? Or a NEMA stepper motor is required? (I own both).

Last thing would be the wiring, while I'm very comfortable with wiring, soldering, etc etc. I'm not as familiar with the electric components used in his build and I'm wondering if someone could share(as far as they can guess ofc) what each component is used for so it will be easier for me to know what component I need and WHY I need them.

Thanks for the help :)

Link to comment
Share on other sites

  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

For me the 28BYJ-48 has been enough as is. I designed the mechanics so that I can rotate the motor around one of the mounting screws that allows me to adjust how tight the rubber O-ring is pressing against the edge of the filter wheel. I haven't had any issues with the motor turning the wheel. There is (was) a sort of a spring clip inside the housing that "locks" the wheel into the slots. I removed it completely so the wheel is held in position entirely by the motor and the motor doesn't have to do any extra work to get the wheel moving again. Again this has worked well. The slot is held in position even when the motor isn't powered.

The hall sensors are a bit like transistor switches that turn on when a magnetic field is present. They are hooked up to the Arduino digital input pins which I read in as an integer value. I have four sensors in my design although only three are used as three bits is enough to encode up to 7 slots. The truth table for the filter slots is straight forward:

  • 000 = Not in a slot
  • 001 = First filter slot
  • 010 = Second filter slot
  • 011 = Third filter slot
  • 100 = Fourth filter slot
  • 101 = Fifth filter slot

There was a couple of physical/mechanical issues with these though. First I couldn't get them to read the magnets from the required distance. This was fixed by placing ferrous material (screws in my case) behind the sensors. They had the effect of redirecting (aiming) the magnetic flows from the magnets towards them (=through the sensors). The second challenge was to deal with the interfering magnetic flow from the adjacent magnet as they were pretty close to each other. This was fixed by having every other magnet facing north side up and the rest of them south side up. The sensors on the PCB had to reflect this polarity as well. With these changes I haven't had any problems reading the magnets reliably. In the arduino code and driver I implemented programmable offsets for each filter so they would always stop at the right position regardless which direction the wheel was rotating.

Hope that helps...

Link to comment
Share on other sites

27 minutes ago, kbrown said:

For me the 28BYJ-48 has been enough as is. I designed the mechanics so that I can rotate the motor around one of the mounting screws that allows me to adjust how tight the rubber O-ring is pressing against the edge of the filter wheel. I haven't had any issues with the motor turning the wheel. There is (was) a sort of a spring clip inside the housing that "locks" the wheel into the slots. I removed it completely so the wheel is held in position entirely by the motor and the motor doesn't have to do any extra work to get the wheel moving again. Again this has worked well. The slot is held in position even when the motor isn't powered.

The hall sensors are a bit like transistor switches that turn on when a magnetic field is present. They are hooked up to the Arduino digital input pins which I read in as an integer value. I have four sensors in my design although only three are used as three bits is enough to encode up to 7 slots. The truth table for the filter slots is straight forward:

  • 000 = Not in a slot
  • 001 = First filter slot
  • 010 = Second filter slot
  • 011 = Third filter slot
  • 100 = Fourth filter slot
  • 101 = Fifth filter slot

There was a couple of physical/mechanical issues with these though. First I couldn't get them to read the magnets from the required distance. This was fixed by placing ferrous material (screws in my case) behind the sensors. They had the effect of redirecting (aiming) the magnetic flows from the magnets towards them (=through the sensors). The second challenge was to deal with the interfering magnetic flow from the adjacent magnet as they were pretty close to each other. This was fixed by having every other magnet facing north side up and the rest of them south side up. The sensors on the PCB had to reflect this polarity as well. With these changes I haven't had any problems reading the magnets reliably. In the arduino code and driver I implemented programmable offsets for each filter so they would always stop at the right position regardless which direction the wheel was rotating.

Hope that helps...

Thanks for the reply! That's more great information, but what I'm wondering about is how to actually design it correctly? Is there any formula I can go by to know what magnets I need, calculate the distances and other similar crucial information?
Or is it simply trial and error until I just get it right?

Thanks!

2 minutes ago, Adam J said:

Another case of a DIY astronomer reinventing the wheel....

BaDumTsss...

Link to comment
Share on other sites

1 minute ago, msacco said:

Thanks for the reply! That's more great information, but what I'm wondering about is how to actually design it correctly? Is there any formula I can go by to know what magnets I need, calculate the distances and other similar crucial information?
Or is it simply trial and error until I just get it right?

Trial and error in my case. Although in my case the first sensors and magnets I bought worked eventually after I found the configuration described above. I'll do some digging tonight to see if I can find my project files and more details for you...

Link to comment
Share on other sites

Just now, kbrown said:

Trial and error in my case. Although in my case the first sensors and magnets I bought worked eventually after I found the configuration described above. I'll do some digging tonight to see if I can find my project files and more details for you...

Really appreciate that, thank you! :)

Link to comment
Share on other sites

Ran into some trouble resurrecting my old project files. I run the development branch of KiCad these days (kicad-nightly) and it doesn't seem to like my 3+ year old project files. I managed to get the schematic displaying correctly but getting the PCB working would require a bit more work. I've attached a pdf copy of the schematic so at least you can see which components I used. I've also attached an .svg file of the PCB which I used to etch the PCB with.

If you want to make your own version you can skip R1 and R2 if you like. This was an attempt to implement a software based low voltage monitor that didn't really work as trying to run with a flat/weak battery introduces a lot of unpredictable issues.

EDIT: Just checked the Arduino code and I did actually use the R1 / R2 voltage divider to detect whether the Arduino is running from external power as it doesn't make sense to try to run the motor if it's only powered from the USB connector. However they are not on the PCB as it was an afterthought. I just soldered the resistors directly on the arduino pins.

You can skip  GPIO_A and GPIO_B if you wish. I just added these connectors for debugging purposes. When I was developing this I had a small serial LCD display connected on the GPIO_B which was a handy thing to display various things going on in the Arduino. GPIO_A I never really used for anything...

Happy to explain more if this is a bit confusing... 

 

 

KiCad_test.pdf KiCad_test-B.Cu_F.Silk_B.Mask.svg

Edited by kbrown
Link to comment
Share on other sites

As for the Allegro A3144  hall effect sensors you could get them from flea bay (eg item no. 274508408913). The magnets I used were 3mm diameter 4mm thick neodymium magnets. I think I got those from flea bay too. I used two component epoxy glue to mount them on the wheel. Just need to glue them one at a time per filter slot. Otherwise the magnets may dislodge from their intended position while the glue is still curing...

 
Edited by kbrown
Link to comment
Share on other sites

10 hours ago, kbrown said:

Ran into some trouble resurrecting my old project files. I run the development branch of KiCad these days (kicad-nightly) and it doesn't seem to like my 3+ year old project files. I managed to get the schematic displaying correctly but getting the PCB working would require a bit more work. I've attached a pdf copy of the schematic so at least you can see which components I used. I've also attached an .svg file of the PCB which I used to etch the PCB with.

If you want to make your own version you can skip R1 and R2 if you like. This was an attempt to implement a software based low voltage monitor that didn't really work as trying to run with a flat/weak battery introduces a lot of unpredictable issues.

You can also skip  GPIO_A and GPIO_B if you wish. I just added these connectors for debugging purposes. When I was developing this I had a small serial LCD display connected on the GPIO_B which was a handy thing to display various things going on in the Arduino. GPIO_A I never really used for anything...

Happy to explain more if this is a bit confusing... 

 

 

KiCad_test.pdf 40.72 kB · 5 downloads KiCad_test-B.Cu_F.Silk_B.Mask.svg 256.51 kB · 4 downloads

 

10 hours ago, kbrown said:

As for the Allegro A3144  hall effect sensors you could get them from flea bay (eg item no. 274508408913). The magnets I used were 3mm diameter 4mm thick neodymium magnets. I think I got those from flea bay too. I used two component epoxy glue to mount them on the wheel. Just need to glue them one at a time per filter slot. Otherwise the magnets may dislodge from their intended position while the glue is still curing...

 

Thanks for the comments! I already ordered the Allegro A3144, are these the correct type of magnets?
https://www.aliexpress.com/item/32954909312.html

Aliexpress usually arrives faster for me than ebay, so trying to get it from there first.

1 hour ago, stash_old said:

Thanks, I've already seen that, but I'm not sure I like this, as far as I managed to read it doesn't use any sensor to get the current position, and according to the code I've seen(again, unless I missed something), it just moves x steps according to the current position and the position it needs to move to.

That means that any manual movement, or any motor backlash will cause the output to be incorrect, simply rotating a filter wheel with a motor sounds pretty easy to me, but making it actually good is a bit more complex.

Again, maybe I missed something so I'm still trying to check that, but this is what I've seen so far.

Link to comment
Share on other sites

7 minutes ago, kbrown said:

The magnets you found look correct but do you really want 200 of them? Cheap though so why not...

Hope you noticed the edits I made to my previous reply?

Well, I don't. But it seems like for a reason there is high shipping fees for them, like 10-20-50 would cost me $5 for shipping alone, so that ends up at around the same price.
On ebay it is a bit cheaper, but still not cheap enough for me to pick it, e.g 25pcs for $3.88 including shipping. I guess I'll just take the higher amount in that case.

And thanks, I did notice now, last before I purchase that, is there anything I should check in terms of scales in case my filter wheel is different from yours and it might not fit? Can you tell from the pictures?

And I have 1 more question about the hall sensor if you could explain more about it, do you use a single hall sensor? Where did you put it in your build? And what is the logic used behind it? I understand what is the purpose and how it works, but I'm wondering about what you did exactly according to the position(e.g stop when reaching that position, move x steps from that position, etc, etc).
If you could just write an extremely simple pseudo code for the logic of it I think it would be very easy for me to understand :)

Thanks!

Link to comment
Share on other sites

2 minutes ago, msacco said:

Well, I don't. But it seems like for a reason there is high shipping fees for them, like 10-20-50 would cost me $5 for shipping alone, so that ends up at around the same price.
On ebay it is a bit cheaper, but still not cheap enough for me to pick it, e.g 25pcs for $3.88 including shipping. I guess I'll just take the higher amount in that case.

And thanks, I did notice now, last before I purchase that, is there anything I should check in terms of scales in case my filter wheel is different from yours and it might not fit? Can you tell from the pictures?

And I have 1 more question about the hall sensor if you could explain more about it, do you use a single hall sensor? Where did you put it in your build? And what is the logic used behind it? I understand what is the purpose and how it works, but I'm wondering about what you did exactly according to the position(e.g stop when reaching that position, move x steps from that position, etc, etc).
If you could just write an extremely simple pseudo code for the logic of it I think it would be very easy for me to understand :)

Thanks!

Your wheel looks exactly the same I have as far as I can see.

No there's four sensors (U2, U3, U4 and U5 in the schematic. Have another look in my old thread you linked in the first post. There's tons of photos showing how I put everything together. Do you have a CNC mill/router? Not sure if I would have attempted this without mine...

Link to comment
Share on other sites

6 minutes ago, kbrown said:

Your wheel looks exactly the same I have as far as I can see.

No there's four sensors (U2, U3, U4 and U5 in the schematic. Have another look in my old thread you linked in the first post. There's tons of photos showing how I put everything together. Do you have a CNC mill/router? Not sure if I would have attempted this without mine...

Right, didn't figure that it's the hall sensor in the schematics, but I don't think the photos show where exactly the sensors are positioned on the filter wheel? Or I just missed it?

I also don't have a CNC machine, but I think my tools should be good enough in order to make this according to what I've seen in your build.

Link to comment
Share on other sites

This photo shows the sensors soldered on the PCB (Click on the arrow icon on the top right to get to the right post). They're the four transistor like devices in the middle with bent legs to get them close to the surface of the wheel housing.

This photo shows the additional bracket I made to hold the screws on top of the sensors.

 

Edited by kbrown
Link to comment
Share on other sites

10 minutes ago, kbrown said:

This photo shows the sensors soldered on the PCB (Click on the arrow icon on the top right to get to the right post). They're the four transistor like devices in the middle with bent legs to get them close to the surface of the wheel housing.

This photo shows the additional bracket I made to hold the screws on top of the sensors.

 

I see, and how do you detect the different positions according the positions of these sensors? By the different magnets bits I guess? And it looks like all the sensors are aligned, does each of them checks for something different?

Sorry, I'm just still missing the basic understanding of that. I'm not in a hurry making that so I really want to plan everything from beginning to end before starting and take my time with it.

Edited by msacco
Link to comment
Share on other sites

Yes the sensors are aligned so that the magnets on the wheel travel right underneath them. One sensor detects one magnet at a time so basically I encode the slots with the presence or absence of the magnets as seen here:

Notice the variation of the magnet placements on each slot. This is what I tried to explain in my first reply with the truth table. Hope this helps?

Link to comment
Share on other sites

19 minutes ago, kbrown said:

Yes the sensors are aligned so that the magnets on the wheel travel right underneath them. One sensor detects one magnet at a time so basically I encode the slots with the presence or absence of the magnets as seen here:

Notice the variation of the magnet placements on each slot. This is what I tried to explain in my first reply with the truth table. Hope this helps?

Yep that's pretty much what I thought, sorry once again...But why do you need 4 sensors in that case? Since you're using only 3 magnets variations, 3 sensors should be enough for that? Is the 4th sensor used for something else? Or I'm still missing something?

Thanks, that's really really useful.

Edited by msacco
Link to comment
Share on other sites

Like I mentioned before the fourth isn't used at all. I just put it in just in case as I wasn't sure how the magnets and sensors would play together so close to each other.

Another idea I had in my mind was to 3D print a 9 x 1.25" filter carousel that would fit in the same housing. That would require four sensors. I haven't done this yet though. Don't even know if it would be physically possible :)

Edited by kbrown
Link to comment
Share on other sites

25 minutes ago, kbrown said:

Like I mentioned before the fourth isn't used at all. I just put it in just in case as I wasn't sure how the magnets and sensors would play together so close to each other.

Another idea I had in my mind was to 3D print a 9 x 1.25" filter carousel that would fit in the same housing. That would require four sensors. I haven't done this yet though. Don't even know if it would be physically possible :)

Oh awesome. Sorry, lots of information to process and understand(for me at least :x and I want to precisely understand everything I do)

That sounds like a cool idea, at first I thought of completely 3D printing a filter wheel, but I feel like it just won't be good enough, especially when you have to somehow take care of the threads, and sounds like it won't be an easy task, or at least something that will last for long time.

I think the last question about the magnets is about the usage, I think that the sensor should detect the magnets even before the sensor is exactly above the center of the magnets? How do you handle that? Can it be measured with the hall sensor?

Link to comment
Share on other sites

3D printing threads isn't a problem. I've done it many times. However I would not 3D print the filter wheel housing as it needs to be quite sturdy due to the weight of the camera and other accessories hanging off of it.

Yes the sensors can detect the magnet before it's centred under the sensor. But this is a constant offset as long as the sensors are fixed in place so I take care of this in software. I turn the wheel until I detect the first magnet. Then I turn a little bit more to see if there's any other magnets coming "into view". From here I apply a user defined offset (backwards or forwards) to centre the filter on the optical path. There are two offsets per filter which can vary depending which direction the wheel was turning. These offsets are exposed in the INDI driver and stored in the Arduino's built in EEPROM so the stay there even when not powered. I haven't had to touch these offsets since I did my initial calibration.

You can see this in action here:

 

Link to comment
Share on other sites

6 minutes ago, kbrown said:

3D printing threads isn't a problem. I've done it many times. However I would not 3D print the filter wheel housing as it needs to be quite sturdy due to the weight of the camera and other accessories hanging off of it.

Yes the sensors can detect the magnet before it's centred under the sensor. But this is a constant offset as long as the sensors are fixed in place so I take care of this in software. I turn the wheel until I detect the first magnet. Then I turn a little bit more to see if there's any other magnets coming "into view". From here I apply a user defined offset (backwards or forwards) to centre the filter on the optical path. There are two offsets per filter which can vary depending which direction the wheel was turning. These offsets are exposed in the INDI driver and stored in the Arduino's built in EEPROM so the stay there even when not powered. I haven't had to touch these offsets since I did my initial calibration.

You can see this in action here:

 

I did manage to make pretty good 3D printed threads using PETG, which is also very sturdy, but I think I'd always try to avoid that when I have other options, and yeah there's obviously the weight part as well, even though PETG is really strong, maybe just strong enough? Depends on the use case obviously.

And that's great...When you say that you haven't had to touch the offsets since the initial calibration, do you mean that the calibration calculates the offsets and stores them 'permanently'?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.