Reading a magneto elastic torque sensor with high resolution - Page 1
Forum section: electronics / general

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 10, 2022, 05:00:26 am
content: Hello everyone,I am working with a torque sensor based on the magneto elastic principles.It is made of two coils of the same value (75ohm) with a common center tap put to ground.The two coils are wounded around a ferromagnetic ring wich, however, is free to rotate independently of the coils.If you provide a square wave signal on one of the two coils you get an induced similar signal on the secondary coil.Any twist of the ferromagnetic ring causes a variation in the range of millivolts on the amplitude of the induced signal.Actually I saw on the oscilloscope that it is possible to reach a variation of some hundreds of mV from zero torque to max torque, sourcing a square wave signal of 10 volt peak to peak on the primary coil ( +5v -5v pp).My question is: if i rectify the output signal with a diode, a capacitor + a bleeding resistor I get a variable DC voltage that is dependent on the torque applied on the sensor.The problem is that this DC voltage is biased of about 5volt and also varies by a few hundreds of mV from zero to maximum torque; for example 5 volt at 0nm and 5,4 volt at 80nm.How is possible two reference it to zero and amplify it in the way to get a variation from 0v for zero torque and 3v or 5v for maximum torque?I need to work in this way so I can read the signal with a greater resolution for the ADC of a microcontroller.Do you have different suggestions based on your past experiences?Than you very much for your time!!

author: Kleinstein
author_rank: Super Contributor
timestamp: April 10, 2022, 06:36:14 am
content: Most µCs have a reasonable speed ADC and it makes sense to read the AC signal with the ADC and not some rectified form. A rectifier is a bit tricky and just simple diodes tend to get temperature dependend. So the µC would get the AC signal and than calculate the amplitude / phase of the signal numerically.Sampling the AC signal with quite a few points per period give oversampling of the signal and extra resolution comparead to the bare resolution of the ADC.Looking at the AC signal also allows to suppress a background from the speed of rotation / drving motor.The description of the magentic setup is a little confusing. AFAIK magnetoelastic torque sensing usually uses 2 coils on different axis, so that with zero torque there is ideally no signal at the output and only the stress in the material causes the coupling and one kind of needs to use a phases sensitive rectfication (can be numerical) to see torque in both direction as a positive and negative "amplitude". There are different configurations to use the magneto-elestic effect as a torque sensor. A drawing of the configuration and a scope picture / drawing of the waveform may help.A part that is a bit tricky with magnetoelestic sensors is that they react to temperature and external magnetic fields. Also looking at the waveform at the excitation coil can help.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 10, 2022, 02:47:36 pm
content: Thank you both for the useful and interesting replies. As soon as possible I will answer your questions and post the photos you asked for.Maybe I cannot explain well the situation because English is not my first language so I apologize.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 11, 2022, 08:55:15 am
content: The torque sensor is for an e-bike.Because I cannot disassemble it, I have attached some photos found on internet, sorry for the low resolution.The sensor is mounted on the pedals shaft.As you see is made of two coils of the same value attached in a common point referenced to ground.The ferromagnetic ring has some splines, I think to "disturb" the induced signal on the output when the torque applied to it twist the ring.In the afternoon I am going to do some screenshots of the waveforms generated by the original electronic board installed on this e-bike and show you what I get if I supply a waveform from my AWG.The original signal is a squarewave with a duty of about 50% at 16khz and the amplitude is about 8volt peak to peak.My project is to make a custom motor controller with a custom display, I am doing it almost because it is an interesting application to let me learn many things about these fields that I am studying.The display is done and fully working as I wanted, so happy for that....Now I am going to develope the motor controller.The MCU i have selected for the motor is the stm32f401cc.The ADC is capable of maximum 12bit and 2.5MSPS.What I meant for the bias of the output signal is this: if I rectify the output signal I get a DC voltage biased of some quantity and, if I choice to read the signal in such way, it would be better to have it referenced to ground and amplified about 7 or 8 times... So to have an ample variation of the output voltage from 0nm/0volt to the maximum torque achieveble from the system, maybe 3 or 5 volt (I think it could be around 250nm).

author: Kleinstein
author_rank: Super Contributor
timestamp: April 11, 2022, 09:21:37 am
content: So this is a ready made sensor and no good way to modify things there. The configuration is a bit unusual, but seems to work.In the shown configuration I have a slight problem to see how the sensor can detect the sign of the torque and thus sense forward / reverse.Using a simple rectification is likely not the best way to look at the sensor signal, as a rectifier in the simple form is quite temperature dependent and the information may very well be more in the waveform than in just the amplitude. The µC and ADC should be fast enough to look at the AC signal - so no external rectification, but taking more samples and than use math to derive the amplitude (maybe seprate for the harmonics) to get the torque. So this would be less analog hardware and more software.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 11, 2022, 11:29:06 am
content: Thank you Kleinstein.Could you suggest me something to read or a documentation about such mathematics involved in this kind of signal analysis?Or if there is a finished project you know freely available to study on the web.Because I don't know how to approach the suggested methode.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 11, 2022, 11:31:15 am
content: It doesn't need to sense forward or reverse because it's a bike and so it has a freewheel mechanism that doesn't let you reverse pedaling.

author: miro123
author_rank: Frequent Contributor
timestamp: April 11, 2022, 02:45:54 pm
content: Hi,Interesting project. I'll learn a lot from it. IMHO the tqorque sesnor is nice feature if already build motor control, cadance / speed control.I have few questions- what type of motor are you gonna use - fronthub rearhub or mid motor?- what type of motoro control - BLDC or Sinewave?- sensor or sesnorless motor control?--------Torque sensor related- torque amplitude detection is easiest part - the whole sensor at best gives +-15..25%- do yo know that torque varies with crank angle- to make thinks more complex left foot gives different power than the right.- torque shape varies from person to person.- the best in class torque sensor is SRM - +-1,5% "if properly calibrated". It uses strain gauges. Even the top athletes with unlimited budget makes mistakes to achieve advertised +-1,5% range -https://www.reddit.com/r/peloton/comments/s7mze6/wout_van_aert_world_cup_time_trial_gnaws_on_me/- motor assistance in function of cadence, torque and bike speed- torque sensor provides instant response - accuracy comes from the other sensorsSee picture bellow with torque vs angle - left vs right pedal strokeI short - the subject "high resolution..." is incorrect - this cheap sensor has ~3..3 1/2 bits accuracy . eBike torque sensor has low requirements - there is no wonder that this sesnors can be seen at 80% of torque assisted ebikes on the market.

author: miro123
author_rank: Frequent Contributor
timestamp: April 11, 2022, 03:06:15 pm
content: Just for fun - try to ride on uneven road an look at torque data.This aspect is not important in your case. As already 3...3 1/2 bits is enough for you application

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 11, 2022, 08:29:47 pm
content: So I took some screenshots from the oscilloscope.In photos from 1 to 3 I sourched a square wave signal of 16kHz frequency, 50% duty.The resulting induced signal is the blue one, It have half the amplitude of the sourched one and some ripple on its "peak".The ripple is what grow mostly in amplitude when I apply torque to the sensor, with some force is possible to see about 100mv or more than the neutral state.In photos from 4 to 5 I am probing the original control board.As you see it is a different situation: the sourched signal is of a strange shape, I am not sure if it has a distortion of some sort or it have such shape for a good reason.The induced signal, the yellow one this time, has a very small amplitude when no torque is applied and is distorted... Instead, when you apply torque the signal grow greatly in amplitude and it became a sine wave, I saw more than +300mv with some force.------------------------------------------In one of the last post was said that this kind of sensor doesn't give the same reading if the same force is applied on the left or right pedal.This is true with some brands but this sensor has the ferromagnetic ring independent from the pedal axel because it is coupled the chain sprocket... So it behave in the same way for left or right pedal.Also I don't see a different reading from the sensor when the axle rotate, maybe because this sensor measure the strain on the metal of the ring and not a magnetic field? I don't know.... And I am not sure because I cannot find specific information on the web.The motor is a Panasonic mid drive motor of an old flyer e-bike.I have a strong passion for motor control and did some nice and fun project in the past with a powerful 600mhz NXP MCU, yes I needed such a fast CPU for true real time response of the system.Now I was keen to make a custom motor controller for e-bikes so I am using this bike as a platform to study the technology and it's application.Actually I take very seriously this involvement and it is not really a game for me, so I am investing some money in instrumentation.I hope to find here some help to understand and implement in the more efficient way this kind of sensors.-----------------------------------------Thank you again

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 11, 2022, 08:38:37 pm
content: Mid motorBldcSensoredI think it could be possible if needed that I could add a PAS sensorIn regard of the resolution, from what I see in the oscilloscope readings I think it is possible to get a good level of precision.I know maybe I don't need it but for past experiences I know the higher the resolution the better for the mathematics that could be involved.Also here I am testing the technology so it is an interesting topic to dive deep.Quote from: miro123 on April 11, 2022, 02:45:54 pm

author: Kleinstein
author_rank: Super Contributor
timestamp: April 11, 2022, 09:25:03 pm
content: I still don't fully understand how the sensor works, but I have a rought idea: there are 2 patterned rings. If there is torque the patterned part deform and one of the rings changes towards higher permeability, while the other part changes towards lower permeability.To me it is still not clear how the 2 coils artiually work and I would have used 3 coils. There may still be something hidden (e.g. a 3rd underneath). My idea would be excite in the middle and see the difference to both sides. They probably have a good reason to get away with those 2 coils.With 16 kHz the magnetic field would be mainly near the surface - the center part should not be sensed very much. This makes sense as the sensor looks like the pattern is only in a relatively thin foil on the outside. I actually have a pretty good idea for the right material for that foil.The ringing part like the LC resonance from the coild with parasitic capacitance and the amplfiiers input capacitance. Chances are the original board has some more capacitance (could be actual extra capacitors in the nF range) and thus may works closer to resonance. Working in resonance could reduce the driving power too. Not surprisingly the resonance quite strongly dampend (e.g. from eddy currents). So one may not have to worry too much about shifting the resonance.I have looked a little at other magnetic sensors. The one with hall effect sensor are likely not just reacting to torque, but also to changes in the gap between axis and hall sensor, especially if the use just 2 hall element and not 2 on opposite sides. So with only minor play they can easily also react to the forces from the paddles and different to both side. The type of sensor with the hall effect and magentized sensor would be more the one I originally had in mind. It still has the problem that the output is a static field and not an AC field.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 12, 2022, 11:28:29 am
content: Yes, somewhere I saw that the sensor works with a patterned ring, and some other sensor of this kind implement a thin foil on the outside of the ring.Maybe I could try to disassemble It to understand better how it works.I don't have experience with this kind of sensors, so I am not sure how to drive it at the best.The input signal of the original control board has that strange shape, maybe because it is in some way better.What do you think?This evening I am going to do what you suggested: exite in the middle both coils (on the common point) with a 16khz squarewave signal and watch what happens on both coils when torque is applied.Do you think I should put some small capacitance some where on the input or output of the sensor? Maybe It is a silly question but I am not an expert on this field.As asked before do you know if is possible to study this matter somewhere? Application notes, etc....?PS: with the signal from it's original control board the output is very sensitive, what I mean is if you do a small variation of the torque is clearly visible a variation on the amplitude of the output signal on the oscilloscope.ThanksQuote from: Kleinstein on April 11, 2022, 09:25:03 pm

author: Kleinstein
author_rank: Super Contributor
timestamp: April 12, 2022, 12:08:34 pm
content: There is no need to take appart the sensor. From the pictures it is pretty clear how the actual sensor is build (at least the rotating part): it should be mainly the strip of patterned magnetic foil glued around the tube like part. The foil could be 1 piece or 2 pieces.The somewhat unclear point is how the coils are made. Visible are 2 coils, but there may be additional windings below and the coils may not be just simple coils. To me at would make sense to have excitation with both coils somehow in series and than compare voltage at the center to half the voltage as a kind of bridge. The torque should change the inductance of both sides. So I have a light problem with the simple picture of exciting only one coild and reading the other. The idea would be more like sending the same current through both coils and look at the difference in the voltage.A capacitor at the coil would add some gain, but it should not create a totally new signal.For the SW side the idea would be to use a µC timer / PWM output to create the drive signal and than read the ADC 2 times per period and use the difference of the 2 readings as a way to measure the amplitude. The timer would trigger the ADC to have the ADC in sync with the excitation.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 12, 2022, 02:26:11 pm
content: I really like your suggestions.I will do some test based on your explanations and post the results here.Thank you for your time.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 12, 2022, 08:35:25 pm
content: I have done some test.The behave from a coil to the other is quite different.If you supply the signal on a coil and ground the common point you get a signal of a lower amplitude on the other coil that vary in the length of the period when you apply torque... I mean that there is an expansion of the period.If you supply the signal on the other coil with the same setup you get instead a variation in amplitude of the induced signal when torque is applied.... InterestingIf you apply the signal on the common point you get the same output on both coils but when you apply torque there is a very slightly shift in phase of the output signal in one of the two coils.All of these with a 16khz squarewave.My concern is that the original control board, that I tested again few hours ago, output a signal with a particular shape... After some testing I am more convinced that such signal is deliberately shaped in such way because it gives a more responsive signal as an output.I tried many values of capacitor in series with the input signal to see if it was possible to make a similar shape as done by the original control board.Only with 10 nF the signal start to shape a bit like the original one but no success at the end.As I said before I am not an expert of signal conditioning.If someone have an idea of some sort of circuit i should implement...?Thank you.PS: attached is the screenshot of the signal emitted from the original control board. In yellow the induced signal when torque is applied.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 12, 2022, 09:02:10 pm
content: I would not expect the shape of the driving signal to be that relevant. The main function (at least as far as I understand it) should still work in the linear small signal picture, e.g. with a comparable waveform out as in. There may not be a simple separation in a drive and sense coil. For each coil one has current and voltage and can thus dirve a voltage and measure the current or the other way around.Is it possible to have a look at the drive circuit ?From the description is looks like the 2 coils are somewhat different, and not symmetric, like not just 2 separate coild. The ohmic resistance of the coils would be a first hint.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 13, 2022, 04:17:33 am
content: The coils have the same exact resistance: 75ohm.Could be that the problem is me 😂Maybe I am not testing in the proper way.But one thing is sure: when the sensor is connected to it's original control board the output is almost referenced to zero and very sensitivity to variation in the torque applied, it is about in the range of 100mV to 400mV.So now I am stuck, i don't know what I could do to drive it in a more efficient way.I will post some photos of the board as asked.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 13, 2022, 09:11:12 am
content: Attached some photos of the original motor controller.It was heavily potted in hard silicone so it's difficult to clean.The red arrow points to the torque sensor connector, there is a front and back view of It and also some detail of the nearest ICs to the connector.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: April 14, 2022, 04:23:03 am
content: I have found a photo of the hollowed shaft of the sensor, It is attached to this post.It resemble the typology of the Torductor made by ABB but, differently from It, they glued on the shaft a patterned foil.I don't find anywhere on the web specific information on how to drive it.In few old pdf about magnetostrictive sensors it is written that the magnetic field, emitted by the exiting coil, should saturate the ferromagnetic ring to obtain a reliable induced waveform from the secondary coil.Usually they seem to input sinusoidal signals in the range between 100hz to 5000 hz with a current of about 100mASomeone works with a square wave signals.This sensor has a strange 16khz signal as input as shown before.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 14, 2022, 08:34:22 am
content: The patterned part is clear. With the pattern the torque in one direction the permeability of one side will go up and the other side pattern will go down. It depends on the material which side will go up / down.With this sensor configuration I don't think it would be good to saturate the foil, as than there is no more effect of permeability. In some other conficurations it may be good to saturate some part of the magnetic loop: this gives a defined amplitude. However here I would expect the foil to be the first part to saturate and with the relatively small size it would need quite some current / power. For a bike I don't think a temperature dependence (e.g. 1% per C) of the scale factor would be that critical.The frequency should not make much difference. A thinner foil and small size may favor a higher frequency to get more signal.

author: Fiorenzo
author_rank: Regular Contributor
timestamp: May 26, 2022, 10:22:09 am
content: Yes I have found that, with a 100khz input signal, the sensor output a well shaped sinewave that reacts very clearly to small torque variation, with lower frequency the signal that it output is very distorted...Now I am trying to rectify it but without success due to heavy distortion on the signal from the diodes.I have opened another thread about it.

author: veeti
author_rank: Contributor
timestamp: April 16, 2024, 06:35:24 pm
content: Hi FiorenzoCould you post schematic about your current setup, I'm trying all so to get some output of the samekind sensor.But even that I apply reasonable amount of torque, I can only see few % changes at the output