PDA

View Full Version : Reading current frequency and amplitude from motor phase to convert to audio signal



Hugues
01 January 2017, 1304
Hi guys,

I would like to read the AC current from one of my motor phase ( i use an AC-23 with Curtis 1238-7601).

The idea would be to acquire the sinusoidal ( i presume ?) signal from one of the motor phase and then, maybe by using an Arduino, convert this signal to an audible signal that i would play in my helmet. This would give me a good feed-back on how the motor is working. I would link the volume of the signal to the amps and the pitch to the frequency of the AC current.

To capture the current flowing in one of the motor phase, i was thinking of using this Magnetic Field Sensor :
http://www.distrelec.ch/en/magnetic-field-sensor-sot-223-diodes-incorporated-zmy20mta/p/30041540?q=*&filter_Buyable=1&filter_Category5=Magnetic+Field+Sensors&filter_Category3=Analogue+Circuits&filter_Category4=Sensor+Circuits&page=5&origPageSize=25&simi=96.8

Specs here:
http://www.distrelec.ch/Web/Downloads/_t/ds/ZMY20M_eng_tds.pdf?mime=application%2Fpdf

Is it a good place to start ? Does it make any sense ?

Skahle
01 January 2017, 1903
Looks like a good experiment is in order! 1000A at 0.1m is ~20 Gauss. I often shop on digikey, don't know if you can access that site where you are.
http://www.digikey.com/products/en?keywords=ZMY20MTA
Output could be 216mV max with a 12V source so it will be a small signal and it would be best to put an A/D or preamp close to limit noise. Then tape the sensor to the cable and look at it on a scope.

If you see a reasonable signal then add the Arduino setup to interrupt on a level to get frequency and sample waveform at a much higher frequency to get a good amplitude. Arduino can drive headphones directly.

Hugues
02 January 2017, 0723
ok thanks, i have ordered from Digikey in the past,

i'll give it a go and post my results here in a week or two.

thanks

Chri5
03 January 2017, 0739
Hi Hugues,

im doing something similar with an arduino (not audio though which is a great idea!, with equilizer style visuals for motor & battery currents) ive purchased LEM ring transducers sensor for the current its a nice self contained sensor
http://uk.farnell.com/lem/htfs-800-p-sp2/current-transducer/dp/9135766 (mine is the 600a version cost me 19)consideriably more expensive than that IC. they do them in a good range of current ranges if the IC doesnt work out it might be an option

Skahle
04 January 2017, 0112
The LEM CT is a good choice. Curtis should be around 300Hz (well within the LEM range 0-20kHz) and the datasheet mentions pulse width modulated. Looks like you get an analog waveform output so you need a reasonably high sample rate to get a good result. Something like 720Hz would be nice at a minimum. Would still be good to put a scope on it and see the waveform.

Hugues
15 January 2017, 0918
Allright, I could work a bit on this project this week-end,

I received my magnetic field sensor:
http://www.distrelec.ch/en/magnetic-field-sensor-sot-223-diodes-incorporated-zmy20mta/p/30041540?q=*&filter_Buyable=1&filter_Category5=Magnetic+Field+Sensors&filter_Category3=Analogue+Circuits&filter_Category4=Sensor+Circuits&page=5&origPageSize=25&simi=96.8

I used about 11.5 volts on the voltage in pins, then i connected the output signal pins to the microphone jack on my Android phone. Got to be careful here, the signal should stay well below 1 volt as far as i can read on the internet. Should be fine, normally the chip should output about 300 mV.

I used this oscilloscope app on the video:
https://play.google.com/store/apps/details?id=com.xyz.scope&hl=en

But this one seems to be better:
https://play.google.com/store/apps/details?id=com.lab_nation.smartscope&hl=en

You can see my setup here and an idea of the signal i get:

https://www.youtube.com/watch?v=4cGGgGYb86I

It's not all that clean, it seems i have a fast sinusoidal signal with a rather stable frequency but on top a slower signal that is not quite sinusoidal, not sure what i'm reading exactly. Could it be that the chip is picking up the signal from the other 2 phases ? or noise from the motor ? I tried to put a but of aluminum foil around the chip, but i did not see any difference. Is there a specific orientation to the chip ?

Actually my phase cables are shielded and the shield is connected to the frame of my bike on one end. Not sure if that's important. Should i place my chip on a non-insulater part of the cable ? like close to the lug ?

Specs and wiring diagram. I think the chip Hx axis is align on the cable axis:
7249

Skahle
16 January 2017, 0106
I couldn't see any markings on the screen to indicate what timebase you were set on. The controller should output 0-300Hz drive frequency. If your timebase is set to 10ms per division you should see 3 sinewaves per division at max throttle and 1 at 1/3 throttle. Could be the higher frequency sinewave is noise. Seems to be a 10-20x difference in frequency between the two signals so a simple R/C filter might help get the noise out. If you chose to shield your cables the 3 phases should be bundled and shielded as a group and attached at one end to pack -V (ground). If -V is attached to your frame then that is a good point for the shield.

SplinterOz
16 January 2017, 1412
I would think you are seeing the PWM frequency (made to look sinusiodal by the inductance of the motor) and the much lower frequency of the phase current used to drive it.
But without a scale it is hard to tell.

Hugues
16 January 2017, 2208
Thanks for your input guys,

I'll try to be a bit more "scientific" next weekend. I'll do my best to keep the throttle input constant and figure out the time scale to get the frequency of the signal. I'll also move the chip in various places along the cables and lugs, and even on the frame and battery side just to compare.

Hugues
22 January 2017, 1031
ok, so i managed to find some time today and make a few more measurements, snap good print screens with scale.

I moved the sensor at different places on the bike, here is what I can say:

- the sensor has a "preferred" axis, the longest side of the chip must be parallel to the axis of the cable you are measuring the magnetic field from
- you have to be pretty close (a few mm only) to read the signal fro the cable. if you move the sensor away more than that, you don't read anything. That means I'm reading the signal from one motor phase cable at a time, never 2 at a time, so no confusion. These measurements were made at low throttle, low load though, i guess you might start to have cross talk between the phases at high load, to be checked
- i did not read noise when moving away from the cable, at least not at the level or frequency of my signal, if there is any, it's very low.
- as i mentioned before, my phase cables are shielded and the shield is connected to the frame. But i did not measure a noticeable difference when i placed the chip on a section of the cable with the shield, or at one end where there is no shield. I can read a similar but attenuated signal when placing the chip on the wires connecting the shield to the frame.
- i placed the chip on the frame, or on the battery cables, i did not measure anything as expected.

So i attach below a few freeze frames during the measurement at low throttle and no load (just the wheel spinning off the ground). The horizontal time axis has a different scale in each picture. You can see on top of each graph a longer portion of the signal, and the main graph shows the part that is zoomed in.

I'm not sure what this kind of signal should look like, but the amplitude is of course proportional to the magnetic field, which is proportional to the current. But then for the frequency i'm not sure what i'm seeing. On the 500 micro second scale, we can see i think a very fast sinusoidal signal with a period of around 50 micro second, so 20 khz if i'm not mistaken.

Then on the 5 ms scale, there is a variable signal of 2 to 4 ms period, so 250 to 500 hz.

Feedback appreciated.

Then the next question would be: can i feed this signal into an Arduino (or is a Raspberry Pi better for this ) and translate it into an audible signal ?



725372527251

Hugues
26 January 2017, 0539
Just realized the frequencies i measured in attached pictures above (250 Hz to 20 kHz) are in the audible range:
https://www.google.ch/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=what+is+the+audible+frequency+range+for+humans

Next week-end i'll try to simply record the signal with my phone and play it back, just to hear what a motor sounds like. Don't know if the amplitude will be enough, but can surely find an app to boost this.

Maybe i don't need any advanced system like Arduino/Rasp PI to turn this signal into some kind of interesting audible feed-back, maybe a good old analog circuit with filters can do the job.

Hugues
27 January 2017, 1023
Just realized the frequencies i measured in attached pictures above (250 Hz to 20 kHz) are in the audible range:
https://www.google.ch/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=what+is+the+audible+frequency+range+for+humans

Next week-end i'll try to simply record the signal with my phone and play it back, just to hear what a motor sounds like. Don't know if the amplitude will be enough, but can surely find an app to boost this.

Maybe i don't need any advanced system like Arduino/Rasp PI to turn this signal into some kind of interesting audible feed-back, maybe a good old analog circuit with filters can do the job.

It is indeed in the audible range in frequency and amplitude :cool:

So i've recorded it with a simple recorder app on my phone and played it back, sounds cool, clearly too much background noise, but that shouldn't be a big problem to remove that noise.

You can download the .mp3 file here:
https://drive.google.com/open?id=0Bw3aJzdmpPwgbGVYV0tuMk9MTTQ

Try to play it on a speaker with good bass, sounds better.

I was just throttling at low speed, wheel off the ground.

Please let me know your impressions.

Next step: try to clean and "sculpt" the sound in an audio app, keeping in mind that all this will have to be done in real time ultimately :cool:

SplinterOz
27 January 2017, 1609
I like that sound and honestly don't mind the noise too much. I can see a little kit on sale shortly