Multipole ring magnets experience - Page 1
Forum section: electronics / projects

author: Molenaar
author_rank: Regular Contributor
timestamp: December 18, 2015, 06:39:27 pm
content: To replace the points-driven ignition of my Mercedes oldtimer, I would like to use a robust way to detect camshaft position. I thought to use a multipole (32/64) ring magnet in combination with a digital hall sensor, such as TIs DRV5013.I found myself lost looking for suitable magnets which are orderable in small quantities and are precise enough. Does anyone have experience with precisely made multipole ring magnets? Manufacturer recommendation?Thanks in advance!

author: Ian.M
author_rank: Super Contributor
timestamp: December 18, 2015, 06:52:23 pm
content: Why would you want to go to that much trouble? The industry standard sensor is a hall or variable reluctance sensor with the permenant magnet in the sensor, sensing the change in flux due to the proximity of the teeth of a ferromagnetic wheel.Take a steel gear. Mount one sensor close to its teeth and another for the index pulse close to the side of it near the rim. Drill out a dimple for the index pulse. Drill a slightly larger dimple diametrically opposite for balance, a bit nearer the shaft so it doesn't pass under the sensor. Job done.

author: mikerj
author_rank: Super Contributor
timestamp: December 18, 2015, 08:22:59 pm
content: Quote from: Ian.M on December 18, 2015, 06:52:23 pmYou don't even need an index pulse, just remove one (or more) teeth and detect the larger gap. A multipole magnet doesn't sound like a good solution since there won't be a well defined change in polarity like the edge of a tooth.

author: nctnico
author_rank: Super Contributor
timestamp: December 18, 2015, 09:27:45 pm
content: I agree. The camshafts I have seen so far all have a missing tooth to indicate the camshaft position. The pickup element usually is a coil and not a hall sensor. An ABS rotation detector ring could also used after one tooth has been removed. I think they are also called reluctor rings.

author: Pjotr
author_rank: Frequent Contributor
timestamp: December 18, 2015, 09:36:51 pm
content: You mean you want to replace the mechanical points and ignition coil by an electronic ignition system? Probably by a capacitive system?Unless it is a racing car, simply leave the mechanical contacts and replace them with new ones. Then simply use them to steer the electronic ignition. Mechanical points wear out mostly by the current they switch, not so much mechanically. Been there done that for an oldtimer Peugeot 404 and the contacts last more than 10 times longer.

author: pmbrunelle
author_rank: Regular Contributor
timestamp: December 19, 2015, 06:02:51 am
content: Quote from: Molenaar on December 18, 2015, 06:39:27 pmThe nice thing about using a multi-pole strip is that the magnetic flux is AC, with neglegible DC component. So all you have to do is pick a sensitive bipolar latch with low hysteresis; the output of the bipolar latch changes with the sign of the magnetic flux, and as long as the signal is strong enough, you don't need to worry about any of that switching threshold nonsense. The TI DRV5013 is a good latch to use with a multi-pole strip, and it has a diagnostic at power-on where it toggles its output, so it tests its open-drain output MOSFET (if the output is high, you know it's not just because the output MOSFET is failed open). The Allegro A1250 is even more sensitive with less hysteresis, but it doesn't have any self-diagnostic.However, you won't have an index with a multi-pole strip. You can look to purchase multi-pole strips from AMS, iC-Haus... can't think of any other places off-hand right now.Also, the Hall plate needs to be at a specified airgap with the multipole strip. Probably if the Hall plate is more than one pole length away from the surface of the multipole strip, this is too far. If the Hall plate is too close to the multipole strip, the magnetic signal will have lots of THD, and it will not appear sinusoidal. However, this may not be an issue for a bipolar latch (as opposed to analog Hall).Quote from: Ian.M on December 18, 2015, 06:52:23 pmAt camshaft RPM and typical gear radius, I think the imbalance would be neglegible. But yes, this is the gold standard. I would suggest going to the auto wreckers and trying to look for 3-wire variable reluctance sensors, all packaged and made for automotive duty. Just mount in front of the toothed wheel of your choice.Quote from: mikerj on December 18, 2015, 08:22:59 pmActually, the signal from a multipole strip does change in polarity; it's an AC signal. A variable-reluctance sensor with a permanent magnet facing a toothed wheel does not change in polarity; only the intensity changes.Quote from: nctnico on December 18, 2015, 09:27:45 pmAs for missing tooth vs. index pulse, this depends on the ECU that OP will be using, and what this ECU expects in terms of a camshaft signal.A coil is one way to sense the variation in magnetic flux. However, the EMF created by the coil depends on how fast the magnetic flux through the coil is changing. So at low speed, you have no signal. You can try to compensate by using many turns, but there is always a dropout speed (designed to be below cranking RPM I suppose).A Hall-effect sensor works even at a standstill, and whatever IC you buy will include the conditioning, Schmitt trigger stuff, but if you use a coil, you will need to do a few things to your signal before it becomes a clean useable digital signal. I don't know if any ASICs exist to do this.Quote from: Pjotr on December 18, 2015, 09:36:51 pmThis does sound like a good way, if you disable any mechanical/vacuum advance. I would try to maintain some minimum wetting current on the points, otherwise I would not be sure that points would be reliable switching logic-level signals.

author: Pjotr
author_rank: Frequent Contributor
timestamp: December 19, 2015, 09:42:50 am
content: Quote from: pmbrunelle on December 19, 2015, 06:02:51 amI did use 100mA but anything between 100mA and 500mA will be ok. The system I used was a simple capacitive one without sophisticated timing adjustment, so I left the original vacuum adjustment as it was. The points triggered a one shot to drive the discharge thyristor.

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: December 19, 2015, 09:58:09 am
content: Quote from: nctnico on December 18, 2015, 09:27:45 pmThe typicalcrankshaftwheel has 60-2 teeth, so there are two teeth missing in the gap for synchronization. Simplecamshaftwheels are usually halfmoon type (360° crank low/high) while modern ones are typically multisegment ones (for faster synchronization, camshaft limp-home or camshaft adaption). I never saw a camshaft sensor that was not a hall sensor and they became the standard also for crankshaft sensors as inductive sensors only work above a certain rotation speed. Actually cars with start/stop already use bidirectional hall sensors to also detect a reverse rotation when the engine stops close to a top death center of compression.Then again, like >10 years ago, inductive sensors where used for the crankshaft. Which means a special zero crossing detection circuit in the ECU - while the hall sensor will create a falling signal edge at an falling tooth edge, the signal of an inductive sensor looks more like a sine that has its zero crossings at tooth edges with the amplitude depending on rotation speed.

author: mikerj
author_rank: Super Contributor
timestamp: December 19, 2015, 04:28:33 pm
content: Quote from: pmbrunelle on December 19, 2015, 06:02:51 amThey certainly change in polarity, that's pretty much by definition of a multipole magnet. My point was that a toothed wheel and VR sensor gives a very defined and sharp change in polarity as the tooth passes, but I would expect to see a much more gradual change with alternating magnetic poles passing a sensor.Quote from: pmbrunelle on December 19, 2015, 06:02:51 amThe majority of modern cars use variable reluctance sensors for engine position sensing, though some use hall effects sensors as well. You don't get "no signal" at low RPM, you get a reduced signal, and this is why the zero crossing point is used as a trigger point rather than some defined voltage threshold.Quote from: pmbrunelle on December 19, 2015, 06:02:51 amPoints are still a poor solution even with lower currents. The contacts may last longer, but the heel still wears and you still get the same amount of timing scatter from contact bounce and any wear in the distributor bearings etc.

author: Pjotr
author_rank: Frequent Contributor
timestamp: December 19, 2015, 05:15:58 pm
content: Quote from: mikerj on December 19, 2015, 04:28:33 pmYes you can have this and you can have that. But hey, this concerns an oldtimer. What's next? A modern multipoint injection system?

author: Ian.M
author_rank: Super Contributor
timestamp: December 19, 2015, 05:28:57 pm
content: It might be worth seeing if there is a distributor from a newer model that had electonic ignition using sensors on the distributor that would fit before getting too deep into this.

author: mjkuwp
author_rank: Unknown
timestamp: December 20, 2015, 01:20:41 am
content: a small selection of magnetic code wheels is available herehttp://www.phoenixamerica.com/as I recall they have two different diameters, three different materials and at least two different pole counts.I have used them to make test fixtures at work.

author: desy2820
author_rank: Contributor
timestamp: December 20, 2015, 03:05:20 am
content: If all you want to do is replace the points, I would suggest a Pertronix / Pertronix II system. Some of the fit inside the distributor cap, with no external box required.http://www.pertronix.com/prod/If you're wanting to sense the camshaft position for a different reason, then this won't help.

author: Gyro
author_rank: Super Contributor
timestamp: December 20, 2015, 11:22:49 am
content: Quote from: Pjotr on December 19, 2015, 05:15:58 pmThe last electronic ignition system I fitted (years ago) they actually recommended using an old set of contacts (clean) as the heel wear is fastest on brand new ones and slows as they bed-in, plus fresh grease of course. It had wetting current and debounce on the input. That doesn't address wear in the bearings and vacuum advance plate of course.

author: splin
author_rank: Frequent Contributor
timestamp: December 21, 2015, 02:12:21 am
content: Or you could make your own magnetic 'gear wheel' using this:http://mindsetsonline.co.uk/Catalogue/ProductDetail/smart-magnetic-strip?productID=c5f80ba5-2210-4af1-b8bf-788f7a5797a8&catalogueLevelItemID=00000000-0000-0000-0000-000000000000It's a flexible strip with magnetic strips running across the width of the strip at 1.6mm intervals. Like any 'plastic' magnet it's not particularly strong but should be perfectly good for triggering a hall sensor. Gluing it to the inside of a metal drum, to stop it flying off at high speeds, along with a low cost hall or inductive pickup would make a cheap position and speed sensor with decent resolution.It probably wouldn't tolerate temperatures much above 70C which could be a problem in an engine compartment. That's a complete guess though - I'd have to experiment to be sure.

author: rich
author_rank: Frequent Contributor
timestamp: December 21, 2015, 03:29:43 am
content: I've not seen opto sensors mentioned yet..., I had an aftermarket electronic ignition in the late 1980's which used a 4 segment disc mounted on the distributer shaft, and a slotted sensor on the base plate. This arrangement allowed the vacuum advance to still functione, and timing was simply set by rotating the distributor. It worked for years without issue.

author: SeanB
author_rank: Super Contributor
timestamp: December 21, 2015, 04:25:10 am
content: Yes, Optronic, would work till the dust from the rotor clogged the slotted opto sensor, which took about 2 years, if you did not clean every service as you should. Plus was you could run a much higher output coil from it, and run very lean without any issues other than spark plug erosion being very severe. Lodge plugs would last around 15000km, Champion or NGK would do 1000km before misfiring, as the outer electrode was missing, and the centre electrode had receded into the body by around 5mm. But with that and some gasflowing you could just about get turbo levels of power out of a normally aspirated Alfa boxer engine.

author: Molenaar
author_rank: Regular Contributor
timestamp: December 23, 2015, 11:36:01 am
content: Quote from: pmbrunelle on December 19, 2015, 06:02:51 amAren't there multi-pole strips with one element being five times as long (i.e. 60 - 2 tooth wheel style)?Quote from: pmbrunelle on December 19, 2015, 06:02:51 amI'd think this would be an advantage, since the switch location would be better defined.Quote from: pmbrunelle on December 19, 2015, 06:02:51 amThanks, I will take the imbalance into account if I get beyond the first draft. The digital Hall sensor would be easy to interface to the N2HET timer subprocessor on the TI TMS570LS1114 I want to use, so I prefer not to use external IC's or a variable reluctance sensor.Quote from: pmbrunelle on December 19, 2015, 06:02:51 amI want to implement the ECU myself on a TI TMS570LS1114, using the N2HET timer subprocessor. As I currently see it, it will take into account the engine rpm, engine temperature, engine vacuum and gas pedal position. Maybe I'll directly measure speed on a wheel axis as well. I know modern ECUs take much more variables into account, but the current, original situation is very basic, so I think this should do for the first generation.Quote from: mikerj on December 19, 2015, 04:28:33 pmIndeed, and aside from learning and the desire to tweak the system, distribution wear and the associated inaccurate and scattered ignition timing are my main reasons to actually try to make something myself.Thanks for all the feedback!

author: pmbrunelle
author_rank: Regular Contributor
timestamp: December 24, 2015, 01:25:14 am
content: I don't think that "missing pole" type things are commonly done to designate an index. It seems difficult to do... usually there's something separate for the index.I suppose THD isn't too much of a problem for digital switches, but in theory there can be ringing (and polarity change) for very close airgaps; probably not likely to occur, especially as whatever sensor you use will need some enclosure, which will increase the effective airgap.What will the material of the enclosure be? Aluminium? Machined nylon? 3D printed nylon?To clarify: all of these gear-tooth sensors with a permanent magnet are variable reluctance sensors. The change in reluctance due to a gear tooth causes the magnetic flux density in the gap (between gear and magnet) to change. You can measure the change in flux density with either a coil or a Hall, but the sensor works based on the same principle. Only the measurement method is different.For an all-included Hall solution, I would look at Allegro. They have gear-tooth type sensors which include all the AGC auto-calibration bells and whistles, and even includes the permanent magnet that goes with it! So connect to your timer and off you go.But... I see you have a TI chip with the QEP module. If you can get a high resolution position sensor with ABZ output, then this is even easier. Just wire up your incremental + index sensor to the QEP, and the QEP will keep track of the current position. The current shaft angle will be waiting for you in a register, ready whenever your code needs to read the angle. Also, you can set up interrupts when the current position (as counted by the QEP) matches some other value you set in another register.With this type of setup, you can forgo the countdown timer/extrapolation rubbish to estimate position in between teeth.For a camshaft, I assume you have access to the end of its shaft. If you can install a diametrically magnetized cylindrical magnet on the end of the camshaft, you can use an end-of-shaft rotary position sensor to read it (presumably with machining of the timing cover), such as AMS AS5040 (or similar). It goes to very high RPM, and it has ABZ output; perfect for the QEP module.See this appnote for magnet selection for end-of-shaft applications:http://www.melexis.com/asset/magnet-application-note-mlx90316-downloadlink-5221.aspxYou may need a line driver on the rotary position sensor PCB for the ABZ signal to reach the ECU cleanly.There may be +/-1 degrees of non-linearity or so, but this is on par with the spark scatter you see on a traditional distributor setup. Anyway, when you tune the spark advance, you tune for the spark that gives good power, whatever this advance is. So you don't need absolute accuracy; all you need is for your sensor to be repeatable (even if it is non-linear).I'm sure you know that measuring crankshaft position is preferred, but where do you stop, right? Just one camshaft position sensor will not be the best, but it should be "good enough".I would add intake air temperature (ideal gas law changes in air density) and oxygen sensor (it's good to have instrumentation, you don't want to be tuning blind) as useful inputs. I do not see the need for wheel speed for a beginner-level ECU; the engine stops at the flywheel; the ECU doesn't need to know what is happening outside of its world.

author: Molenaar
author_rank: Regular Contributor
timestamp: December 24, 2015, 11:04:12 am
content: Quote from: pmbrunelle on December 24, 2015, 01:25:14 amIt would be a nice bonus to build the circuit inside the original enclosement, but this is not necessary.Quote from: pmbrunelle on December 24, 2015, 01:25:14 amI was thinking of using the axis in the old distributor, which is a handy camshaft breakout, to connect the tooth wheel/magnet for the sensor. Would it not be easier though, to just bypass the QEP module and use SPI to read out, for example, the AMS AS5147P?Quote from: pmbrunelle on December 24, 2015, 01:25:14 amWould I run into trouble if I would use SPI to read out the sensor, since SPI is single ended? I would strive to put the sensor and MCU in the same compartment in the old distributor housing.Quote from: pmbrunelle on December 24, 2015, 01:25:14 amCurrently, the car does not even have a G3 LPG system, just a G1 system, which the previous owner put in. As such, I can't accurately adjust gas input electronically. That might be the next project, but I will make sure to include interfaces for these sensors to be future proof, whatever that might mean on an old timer

author: pmbrunelle
author_rank: Regular Contributor
timestamp: December 24, 2015, 03:08:43 pm
content: Using the old distributor housing is a good idea for the sensor.However, I would not put the ECU in there. Underhood temperatures are severe. You will need all -40 to +125 Celsius rated parts, and probably silly things like 0402 resistors to fit everything in the space of the distributor housing. You may have difficulties to find enough room for all the connectors you want. I would only expose the minimum number of parts to underhood heat. Instead I would put the ECU in the cabin.Use the SPI only for configuration at start-up, or even better: if you can do a one-time programming of the chip with all the settings you need, then you don't need to use SPI in the automobile at all.This is how I would do a beginner ECU (lets say single-cylinder to simplify things).Fuel Injection SequenceIn the background code, continuously do the following:-Calculate and then load the start-of-injection angle into the QEP compare match register-Calculate the injection pulse durationWhen engine reaches the start-of-injection angle, the QEP compare match interrupt executes.In the QEP compare match interrupt, do the following:-Based on the injection pulse duration (most recent value from background code), load the timer compare match register with T = Tpresent + Tinjection-Turn on the injector.When the injection time is finished, the timer compare match interrupt executes.In the timer compare match interrupt, do the following:-Turn off the injector.The ignition sequence is similar to this, perhaps a little more complicated.Obviously things will get a little more complex with multiple cylinders if you need to share compare match registers.I would not connect an ECU's main angle reference only by SPI. You will have latency, you cannot have the compare match interrupt anymore, and you need to keep asking the sensor all the time where the engine is at...Having the QEP is a huge advantage.

author: rrinker
author_rank: Super Contributor
timestamp: December 24, 2015, 06:32:20 pm
content: Quote from: Pjotr on December 18, 2015, 09:36:51 pmGood point. I remember my Dad retrofitting a CD ignition to our old '66 Chevy, had the car at least 10 years after he did that in the early 70's and never again had to replace points. That car worked hard, too, as we used it to pull a camping trailer and a small boat.A good engineer knows good enough as well as 'this is perfect' 😀 Best of all, there will be no fiddling around with the attachment of the disk and sensor trying to get the timing right.--Randy

author: Ian.M
author_rank: Super Contributor
timestamp: December 24, 2015, 10:57:53 pm
content: + you get the benefit that its easy to implement a 'limp home' mode that disables the electronics and simply connects the points (+ a suitable condensor that's out of circuit in electronic mode) to the coil.

author: Molenaar
author_rank: Regular Contributor
timestamp: December 24, 2015, 11:41:28 pm
content: I'd rather take a backup ECU with me than relay on unreliable points ignition

author: Ian.M
author_rank: Super Contributor
timestamp: December 24, 2015, 11:52:39 pm
content: Kettering ignition systems are repairable at the roadside with no more than a test lamp. Even if you had a spare ECU, you would be most unlikely to be able to diagnose a wiring or sensor problem without a lot of test equipment. Its not that Kettering ignitions are unreliable, its just that they need regular maintenance (clean and regap points, + a light smear of molybdenum disulphide grease on the cam) to remain reliable, and few car owners are willing to get their hands dirty now.

author: pmbrunelle
author_rank: Regular Contributor
timestamp: December 25, 2015, 05:18:01 am
content: Quote from: rrinker on December 24, 2015, 06:32:20 pmWhether you are using points or using some other trigger, you will be using a strobe lamp to check the timing, and fiddling no matter what if the timing is not correct. With the rotary position sensor in the distributor housing(magnet on distributor shaft, rotary position sensor fixed to distributor base), you could adjust the timing in exactly the same way. Loosen the distributor hold-down clamp, and turn the distributor until the timing as indicated by the strobe matches whatever the ECU is commanding (some amount of advance you programmed).Quote from: Ian.M on December 24, 2015, 11:52:39 pmAnd maybe a file to clean up the points... but off you continue on your voyage.With modern stuff, you get failures less often, but when stuff fails, you're far more screwed. I am not convinced that this is better.As for a homebrew ECU, I believe it will fail as often as points, but you will be almost as screwed as when a modern fuel injected car doesn't run. At least until you iron out the bugs... which will take some time.The MegaSquirt system I have on my car is of questionable reliability. I have about 60000 km on it though, and I have never been stranded. However, I often carry a laptop with me, and if I connect the laptop to the computer, then I can find a way home. For example, if you have a bad sensor input, you could tell the software to ignore that sensor, or to use a default value.Worst case (this has never happened on the side of the road), I could edit source code, recompile, and reflash the microcontroller with new software if necessary.So I think that the ability to change the software and/or calibration is more useful than to change the ECU; because if you want to limp home with some sensor/peripheral issue, changing the whole ECU won't do anything.

author: Molenaar
author_rank: Regular Contributor
timestamp: December 25, 2015, 10:47:20 am
content: Quote from: Ian.M on December 24, 2015, 11:52:39 pmI really don't mind getting my hands dirty, especially not if it solves the problemQuote from: pmbrunelle on December 25, 2015, 05:18:01 amI also often have a laptop with me and I will do sensor failure tests before I drive on the road. Default settings will certainly be implemented. But maybe I'll buy a dedicated laptop just to always be able to flash, to always have a charged one present.