Distance along a line - Page 1
Forum section: electronics / projects

author: mribble
author_rank: Regular Contributor
timestamp: December 01, 2021, 08:59:30 pm
content: I want to determine the volume of yarn on a bobbin. If it's filled evenly I could use a low cost time of flight sensor on the center point and calculate this. However in the attached image the bobbin isn't filled evenly. Do you have any suggestions on a low cost (<$5 in 1K qty) that can do this? The bobbin will be rotating at around 2000 rpms if that matters.One option is to move the time of flight sensor to about 64 positions and sample, but I don't want another moving piece like that. The only other thing I could think of is use a low cost 640x480 camera with an IR filter ($2) and some IR LEDs to light up the bobbin. Then in most environments the edges of the bobbin's yarn could be detected and with correct calibration the volume calculated. I have some experience with low level graphics and could handle the algorithms of this system, but I suspect it would take a lot of time to get it working robustly.Oh, I did think of using the weight and that would kind of work, but the density of yarn can vary, but it would require some end user calibration and is thus not ideal.Do you guys have any other ideas for sensors that could do this?

author: Benta
author_rank: Super Contributor
timestamp: December 01, 2021, 09:41:29 pm
content: I think the camera idea is your best bet.But why can't you fill the bobbin evenly?

author: mribble
author_rank: Regular Contributor
timestamp: December 01, 2021, 10:43:48 pm
content: Thanks for the feedback!Bobbins are typically filled by the user manually moving some sliding hooks and some users just don't fill the bobbin evenly. I do have a way on this future project to automatically fill the bobbins with a level winding system and will see how evenly the bobbins get filled. That said the mechanical system to do this is kind of difficult because the whole center piece holding the hooks is spinning and most solutions to move these spinning hooks either makes it bigger or adds a lot of weight (both are bad). Here I'm trying to plan for options if the mechanical level wind system doesn't work as well as I'd like.For the time of flight distance sensor I'm looking at VL6180. If you have better ideas for this let me know. It only needs to work to a max distance of 15 cm.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: December 02, 2021, 12:20:12 am
content: I think the camera is your best bet, looking at a backlit edge. You should be able to determine the area under the curve and get a pretty good measurement.

author: Kasper
author_rank: Frequent Contributor
timestamp: December 02, 2021, 05:55:41 am
content: Quote from: Conrad Hoffman on December 02, 2021, 12:20:12 amSounds like a good idea to me.Speaking of IR, most cameras have IR filters, they filter out the IR. If you want to see IR, you'd want a camera without IR filter.If you just want a cheap camera, ignore IR, it probably doesn't matter if you have it or not.If you use LEDs, use visible spectrum. IR LEDs can be a safety hazard, they can be strong enough to damage eyes without being very noticeable. They are also a pain to work with because its hard to tell if they are working or not. I made a trail camera once and had to keep using my phone's camera to see if the LEDs were on or not.

author: Berni
author_rank: Super Contributor
timestamp: December 02, 2021, 06:28:01 am
content: Yep camera sounds like the best bet.No need to backlight it with IR LEDs. You can also light it head on and also flash the LEDs in sync with the cameras frame to let you use more brightness while being less dangerous for eyes. So you would let say 10 frames go by and use those frames as the "black level calibration" to ignore anything that is ambient lit in the background. Then for 1 frame put some serious current trough the LEDs to light up the scene. Hopefuly you have manual control over the cameras exposure and gain settings so that its set appropriately for the bright frame while keeping it from wandering around in the dark frame.

author: mribble
author_rank: Regular Contributor
timestamp: December 02, 2021, 10:41:32 am
content: Thanks everyone. The cheap cameras I'm looking at don't have any thing that filters out IR. My plan was to filter out everything except IR and use the LEDs so I guess it's an anti-IR filter.I've done some VR work in the past that used IR sensors for position tracking. I'm pretty confident this will be more robust than trying to use standard light. However, I'm also confident this won't work in all cases like sunlight. Even large teams of engineers couldn't get position tracking to work in all environments. My problem is certainly more constrained and easier, but I already know of some cases that won't work.If I can get the bobbin to fill evenly, I believe time of flight sensors have similar issues, but since I think they use differential amplifiers they can work in more cases. This would be like Berni's calibration frames, but with more dynamic range and more samples. If this sensor is not working I can have a fallback to weight or just warn the user that it isn't working in the current lighting so failing isn't catastrophic. This is just a nice to have feature.Thanks for all the great feedback.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: December 02, 2021, 10:29:11 pm
content: How accurate does it have to be? One obvious answer is to add more time of flight sensors and sample more places along the spool. I suspect that three or four total would be fine for all but the most bizarre uneven winds. Two might even be enough. Placing these sensors skew to the axis would desensitize to the winding variations, though best benefit would require some interesting logic for the signal over time. Might be a bit more expensive than the camera, but maybe not after adding lighting, processing and whatever else is required to make it work.Another totally different approach that might work would be to add torque dither to the drive for the spindle, add a position encoder to the spindle shaft and monitor the resulting FM, which will decrease as the spool fills. While there will be lots of speed variations due to the filling process, the torque dither gives an opportunity to separately observe the desired phenomenon.I am assuming the setup gives no opportunity to use weight as the criteria, measured via a load cell at the appropriate points. But you might be able to indirectly do this by making the spool slightly off center relative to the shaft and measuring the amplitude of the resulting vibration.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 03, 2021, 01:56:02 am
content: I would also consider a small camera, and combine it with an easy to substract "background color".Another option is to simply weigh the spools (and subtract the empty weight).Yet another option is to re-spool it more uniformly on a separate bobbin, by running it over a wheel you can also measure the total length fairly accurate (and combine with weight measurement).

author: mribble
author_rank: Regular Contributor
timestamp: December 03, 2021, 10:22:24 am
content: Doc, those are good points, but they have issues. I need this to be small, affordable, and work in a wide rand of environments. I agree if you could limit the places it's used to only indoors with nice backgrounds then it would be a much easier problem, but just like with most consumer products you just can't make those kinds of requirements (especially when they didn't exist on previous versions).I already have a device that measures distance very accurately if they are willing to respool, but there are significant advantages if we can get a fairly accurate guess at length while spinning the yarn. I did consider putting a measurement device infront of the bobbin, but at all the possible locations there are issues with that so I think estimating bobbin diameter is probably the best option (at least as a first effort).Cat, I'm hopeful the bobbin will fill pretty evenly and that one time of flight sensor will be good enough. This is mostly a backup plan if I can't get the mechanical system working well. I did mention weight being using previously since I do plan to have a loadcell setup to help with weighing the yarn. The issue with this is the density of different yarns vary a lot (more than 2x).Your FM idea is something I would have never thought of. I'm not sure it would work because the yarn that is getting fed onto the bobbin is constantly changing in tension and that might affect things so much that the FM gets too noisy. I also am not sure what torque dither even means. I also have no idea how the math of this would work. My hunch is this system wouldn't work just based on the current version having different vibrations depending on lots of factors, but maybe with some really clever algorithm we would pull out useful info. If my other approaches fail I'll take a little time to understand the maths of this better.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: December 03, 2021, 03:49:12 pm
content: Torque dither is just a time varying amount of torque applied to the spool shaft. How easy it is to apply depends on the drive system. On of the simplest is to put a universal joint in the drive train along with some angular misalignment. The resulting accelerations and decellerations of the spool depend on the moment of inertia which in turn depends on how much twine is on the spool. Or you could sum a drive signal on a DC motor system, or simply chop the drive signal. There are many options in implementation and details to work out.