Author Topic: Help! EMG Sensor to work with Axon - Circuit Debugging  (Read 6242 times)

0 Members and 1 Guest are viewing this topic.

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Help! EMG Sensor to work with Axon - Circuit Debugging
« on: July 02, 2009, 08:00:45 AM »
Hi everyone,

I am trying to design a EMG circuit as a sensor to work with my Axon MCU for a robotics project. I have came up with a design based on design's I've found on the internet and my limited knowledge of op-amps and analog circuitry. (see attachment, sorry if its blurry - i dont have a scanner and my iphone camera sucks)

I can get the diff. amplifier portion of the circuit working (MAX666CPA, LMC6041IN, INA106) by itself but when i try to connect the rectifier circuit (low pass filter, high pass filter, and TL084) not only does it not work but, even after I disconnect the rectifier circuit, the diff. amplifier portion stops working and only will output a constant ~ -1.17V.  I checked to make sure the power supply circuit is still functioning and is in fact generating 5V with a 2.5V virtual ground. Usually if I just turn it off and let it sit overnight, it will start working again in the morning but that sometimes doesn't even work.

What the heck is going on? I'm at wits end trying to debug it. I've tried creating a separate 5V power supply circuit with 2.5V virtual ground to power the second portion of the circuit and also have tried using a dual supply (+/-9V) to power the second portion.

When the diff. amp portion of the circuit is working, it produces a signal around the magnitude of 20mV. The point of the rectifier circuit is to filter, rectify, envelope and amplify the signal to around 4V (or at least to a scale thats within the 5V detection range of the Axon).

Does anyone know why this intermittent functionality is happening?

Any suggestions on how to simplify/improve the circuit?

here's the data sheets on the chips in the design:
http://focus.ti.com/lit/ds/symlink/ina106.pdf
http://datasheets.maxim-ic.com/en/ds/MAX663-MAX666.pdf
http://www.national.com/ds/LM/LMC6041.pdf
http://focus.ti.com/lit/ds/symlink/tl081a.pdf

Thank you for your time!
« Last Edit: July 02, 2009, 08:02:57 AM by Ocelot »

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #1 on: July 03, 2009, 09:33:41 AM »
Would the TLE2074CN be a better choice of jfet input op amp for the rectifier circuit?

http://focus.ti.com/lit/ds/symlink/tle2071a.pdf

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #2 on: July 03, 2009, 05:35:13 PM »
If I were to debug it, here is what I'd do.

I'd calculate what the voltage should be on every pin in the circuit. Start on the far left, and work your way right. Then check the circuit with a multimeter to validate.

You should also separate the different parts of your circuit and see if each work alone, and if voltages match your calculations.

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #3 on: July 06, 2009, 12:55:27 PM »
I'm swapping out the TL084 for a TLE2074. I didn't realize the TL084 had a 7V min supply voltage... Doh! Hopefully, that fixes my troubles.

Now I have another question, could the Axon's 5V supply power the circuit instead of using a 9V battery + the 5V voltage regulator?

Thanks in advance!

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #5 on: July 07, 2009, 11:28:51 AM »
Now I have another question, could the Axon's 5V supply power the circuit instead of using a 9V battery + the 5V voltage regulator?
Yeap, up to 1.5A, assuming the chips you use work at 5V.

If you do, put various caps before and after the voltage regulator until an oscope says the signal is clean. You're amplifying tiny signals, so noise gets majorly amp'ed too . . .

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #6 on: July 07, 2009, 12:02:35 PM »
Yeap, up to 1.5A, assuming the chips you use work at 5V.
If you do, put various caps before and after the voltage regulator until an oscope says the signal is clean.


I'm not sure what you mean here. I was thinking I could connect the 5V from the axon to the circuit in the same manner as my current 5V voltage regulator's output pin does. Is this not the case?

You're amplifying tiny signals, so noise gets majorly amp'ed too . . .

Yea, I've accounted for the noise by selecting a differiential amplifier that has a high common-mode rejection ratio (86 dB). Since the wires of the two electrodes are the same length, they should receive the same amount of noise which will be removed due to the high CMRR. Then I utilize the low and high pass filters prior to the rectifier components.

Thanks for the reply

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #7 on: July 07, 2009, 12:52:24 PM »
Yeap, up to 1.5A, assuming the chips you use work at 5V.
If you do, put various caps before and after the voltage regulator until an oscope says the signal is clean.


I'm not sure what you mean here. I was thinking I could connect the 5V from the axon to the circuit in the same manner as my current 5V voltage regulator's output pin does. Is this not the case?
This is true, however the Axon isn't designed for high signal amplification. You need to make sure your power supply is ultra clean (in your schematic, your power supply has zero buffering - bad!). You can do this simply by adding caps before and after the regulator until its as clean as you require. I only made it clean enough to get decent 16 bit resolution from a battery.

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #8 on: July 07, 2009, 12:57:55 PM »
Yeap, up to 1.5A, assuming the chips you use work at 5V.
If you do, put various caps before and after the voltage regulator until an oscope says the signal is clean.


I'm not sure what you mean here. I was thinking I could connect the 5V from the axon to the circuit in the same manner as my current 5V voltage regulator's output pin does. Is this not the case?
This is true, however the Axon isn't designed for high signal amplification. You need to make sure your power supply is ultra clean (in your schematic, your power supply has zero buffering - bad!). You can do this simply by adding caps before and after the regulator until its as clean as you require. I only made it clean enough to get decent 16 bit resolution from a battery.

Ok that makes sense now, thanks! What range of capacitor values should I work with to accomplish this?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #9 on: July 07, 2009, 01:28:33 PM »
Ok that makes sense now, thanks! What range of capacitor values should I work with to accomplish this?
Depends entirely on the frequency of the noise(s). Knowing nothing about your system, I'd do a .1uF, 1uF, and 10uF rated at 10V+ on both halves of the regulator, then look at the signal real close with an oscope. Tantelum type cap is best, but ceramic ok.

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #10 on: July 07, 2009, 02:18:07 PM »
Ok that makes sense now, thanks! What range of capacitor values should I work with to accomplish this?
Depends entirely on the frequency of the noise(s). Knowing nothing about your system, I'd do a .1uF, 1uF, and 10uF rated at 10V+ on both halves of the regulator, then look at the signal real close with an oscope. Tantelum type cap is best, but ceramic ok.

lol now I'm confused again. when you say to put them before and after the voltage regulator... If I'm using the Axon 5V supply, why would I need to include the 5V regulator at all in my circuitry? Then I'd only need a capacitor between the Axon 5V supply and the rest of the circuitry (virtual ground+diff amp+rectifier), right?

 Or are you suggesting I use the unregulated voltage supply along with my 5V regulator?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #11 on: July 09, 2009, 06:06:30 PM »
If I'm using the Axon 5V supply, why would I need to include the 5V regulator at all in my circuitry? Then I'd only need a capacitor between the Axon 5V supply and the rest of the circuitry (virtual ground+diff amp+rectifier), right?
The Axon 5V supply comes from the 5V regulator on the Axon. :P
(thats the 5V regulator I was referring to)

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #12 on: July 09, 2009, 10:20:06 PM »
Hi,

For EMG work, I wouldn't rely (solely) on an integrated regulator, as they're way too noisy, however you cap them.
At least follow the regulator by a gyrator circuit (which can easily drop noise and hum [yes, hum can get radiated into a battery supply too] on the supply by a further 80..90 dB for a modest outlay). A CLC-filter wouldn't go amiss either.
The cleaned up power rails should be kept well away from any digital circuitry.

When connecting an EMG amplifier to a controller, it's very important to lay out the analog and digital grounds correctly and have only one common point.

The amplifier need to be in a shielded metal box (µmetal is über here, copper would do, but choosing between alu and iron would depend on which kind of noise source, E or H is the major) and by shielded, I mean with a labyrinth for the power leads and feed through caps for signals.

Twisted input leads is very important to get the common mode noise down, experiment with the tightness of the twist, that depends on the major frequency band of the noise.

Luckily EMG has the strongest signals of the diverse kinds of ExGs, so perhaps loosening some of these demands would be (semi-) OK - but thats to be found empirically :)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #13 on: July 10, 2009, 07:30:29 AM »
Thanks for all the replys so far. This has been extremely helpful for me!

I think I'm going to stick with using my 9V battery for now. After I get the circuit working and integrated with my control system beautifully, I might go back and utilize the Axon's 5V supply for power. But for right now its frustrated me so much i just want to get it working and get my project working (robotic exoskeleton boots to increase your jumping ability.. triggered by an EMG threshold) before i go back and fine tune things.

For EMG work, I wouldn't rely (solely) on an integrated regulator, as they're way too noisy, however you cap them.
At least follow the regulator by a gyrator circuit (which can easily drop noise and hum [yes, hum can get radiated into a battery supply too] on the supply by a further 80..90 dB for a modest outlay). A CLC-filter wouldn't go amiss either.
The cleaned up power rails should be kept well away from any digital circuitry.

Could i use a low pass filter with a very low cutoff frequency way under 60Hz on the output of the 5V regulator to accomplish this? I'm more familiar with filters than gyrator or clc-filter circuits (i've actually never heard of them  :o )

When connecting an EMG amplifier to a controller, it's very important to lay out the analog and digital grounds correctly and have only one common point.

how do you suggest I connect this circuit to the Axon? I was going to connect the virtual ground to the Axon ground and vout to the Axon's analog input. Is this a bad idea?

The amplifier need to be in a shielded metal box (µmetal is über here, copper would do, but choosing between alu and iron would depend on which kind of noise source, E or H is the major) and by shielded, I mean with a labyrinth for the power leads and feed through caps for signals.

I'm not sure I understand what you mean here. Whats a labyrinth for the power leads?

Twisted input leads is very important to get the common mode noise down, experiment with the tightness of the twist, that depends on the major frequency band of the noise.

Great idea! When the first part of the circuit is working (voltage reg + diff amp), the signal hasn't been too noisy so far... but i do realize with EMG signals noise can be a real problem because its right in the middle of the true signal frequency range so its a pain to eliminate without cutting out some of the signal you actually want. I'm def going to try to get my power source as clean as possible to help with this.

Thanks again!

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #14 on: July 16, 2009, 08:52:35 AM »
Hi,

Just a quick post, now that I have a connection (it has been sooo down for a couple of days).

I finally succeded in uploading this file for you http://That.Homepage.dk/PDF/Low_Noise_PSU.pdf. It's a fairly simple regulator for a 9V battery - use the shortest possible leads from the regulator to your circuit - the battery can have somewhat longer leads if needs be.

I'll see if I can post an answer to your questions later today (if my connection allows me  :-\) but I have to go shopping now or starve tonight ;)

Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: Help! EMG Sensor to work with Axon - Circuit Debugging
« Reply #15 on: July 16, 2009, 11:55:49 AM »
Thanks Soeren. What software did you use to create those layouts? That's pretty darn handy... here I am drawing my prototype board layouts with powerpoint >< lol

I've actually decided to ditch the 5V regulator and use +/- 4.5V (or rather 9V battery with Vcc/2 virtual ground) instead. I realized with the +/- 2.5V in my original design it was impossible to amplify the signal up to 0-5V range based on the signal I was getting. (opamps can't output voltages greater than their power supply so the max would have been 2.5V)

Surprisingly, my signal isn't showing much power supply noise but it did have a ton of 60Hz noise so I decided to add a notch filter. When I was searching for a good notch filter circuit design, I ran across a site that used a AD620 chip to detect the EMG signal. It turns out its a IC made for EMG/EKG signal detection. Since it would simply and improve my circuit, I decided to incorporate it in my design as well as simplify some of the other components.

Here's my new design flow path (eagle schematic attached below)..

9V battery --> voltage divider to create my Vcc/2 (+4.5V) virtual ground ---> AD620(detection & 100 adjustable gain) --> Inverting amplifier (100 gain) --> AC coupling to remove DC bias --> 60Hz notch filter --> lowpass filter (503Hz cutoff since the majority of emg signals are in the 15Hz-530Hz range) --> highpass filter (15Hz cutoff) --> rectifier (replaced precision rectifier with passive rectifier aka diode) --> lowpass filter (3Hz cutoff)

I just got in the AD620 yesterday and built the circuit before work this morning but haven't gotten a chance to test it yet. Let me know if you see any ways to improve the signal quality.

 


Get Your Ad Here