Kindly, i have a wheelchair robot controlled by bio signals...the arduino receive the signals from sensor through its analog pins and out digital signal to control the movement of the robot (right,left,forward or back)...my problem is when the subject sit out of the wheelchair the signal controlled perfectly by arduino but when the subject sit on the wheelchair the signal become uncontrolled... i use the following code to guide the wheelchair movement...
const int u1=10;
const int u2=10;
int a[u1];
int b[u2];
int right = 3;
int left = 6;
int forward = 9;
int back = 11;
int value1= 0;
int min1=1023;
int max1=0;
int value2= 0;
int min2=1023;
int max2=0;
int x = 1;
int c1 = 10;
void setup () {
Serial.begin(9600);
pinMode(right, OUTPUT);
pinMode(left, OUTPUT);
pinMode(forward, OUTPUT);
pinMode(back, OUTPUT);
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
while (millis() < 5000) {
value1 = analogRead(A8);
value2 = analogRead(A12);
if (value1 > max1) {
max1 = value1;
}
if (value2 > max2) {
max2 = value2;
}
if (value1 < min1) {
min1 = value1;
}
if (value2 < min2) {
min2 = value2;
}
}
for (int i=0;i<10;i++)
a[i]= 0;
for (int j=0;j<10;j++)
b[j]= 0;
digitalWrite(13, LOW);
}
void loop () {
while(x>0) {
int x1=0;
int x2=0;
int t1=0;
int t2=0;
value1 = 0;
value2 = 0;
while (c1 > 0) {
a[x1] = analogRead(A8);
b[x2] = analogRead(A12);
t1=t1+a[x1];
t2=t2+b[x2];
x1 = x1+1;
x2 = x2+1;
c1 = c1-1;
}
c1=10;
value1=t1/10;
value2=t2/10;
if (value1 >= max1-50 && value1 <= max1+50) {
digitalWrite(forward,HIGH);
digitalWrite(back,LOW);
digitalWrite(left,LOW);
digitalWrite(right,LOW);
delay(50);
}
else if (value1 <= min1+50 && value1 >= min1-50) {
digitalWrite(forward,LOW);
digitalWrite(back,HIGH);
digitalWrite(left,LOW);
digitalWrite(right,LOW);
delay(50);
}
if (value2 >= max2-50 && value2 <= max2+50 ) {
digitalWrite(forward,LOW);
digitalWrite(back,LOW);
digitalWrite(left,HIGH);
digitalWrite(right,LOW);
delay(50);
}
else if (value2 <= min2+50 && value2 >=min2-50) {
digitalWrite(forward,LOW);
digitalWrite(back,LOW);
digitalWrite(left,LOW);
digitalWrite(right,HIGH);
delay(50);
}
}
delay(200);
}
OK, so you have some instrumentation electronics that picks up eye movement. This must be working with very small signals. What is that interface device? These guys? http://www.bcinet.com/products/
You have some large power-control electronics driving the wheelchair motors.
You have an Arduino connected to these things.
We would have to see details of your system to help.
At a very beginning:
Where is "ground" ?
Where do grounds come together, exactly?
Are low-level signal wire shielded/grounded?
Are there EMI suppression measures taken on the motors and motor controllers?
Some general info on the ArduinoInfo.Info WIKI HERE:
OK, so you have some instrumentation electronics that picks up eye movement. This must be working with very small signals. What is that interface device? These guys? http://www.bcinet.com/products/
yes
You have some large power-control electronics driving the wheelchair motors.
i just hacked the wheelchair joystick ...
You have an Arduino connected to these things.
yes ...i have arduino mega 2560 ..it is working ok but its capacitors are damaged when i supplied voltage through Vin pin with ground...but it is not effected on his work as i think...
At a very beginning:
Where is "ground" ?
Where do grounds come together, exactly?
Are low-level signal wire shielded/grounded?
Are there EMI suppression measures taken on the motors and motor controllers?
i use UPS battery as a source and the ground of all the circuit is connected to it is negative pin...also the low-level signal wire shielded but not grounded and the signal is clear so that the wire grounding is not important....... for the EMI i have no idea !
Some general info on the ArduinoInfo.Info WIKI HERE:
thank you very much for this helpful site....i used relays in my previous circuit...and i noticed there noise...so that i made new circuit with no relays...the switching done by opto-coplar pc817 .... so that i have no such problem
i rechecked the circuit and i found that when i supply the arduino from USB or Vin pins by battery ...some noise occurred...and i think that the noise caused by
1- arduino damaged caps
2-feedback of arduino output pins which is connected to the joystick circuit
3-arduino itself
You may want to replace the caps, as they are often used for noise suppression.
Is your shielded wire grounded on a chassis ground on one, but not both, ends of the cable?
Motors usually make a lot of EMI. Are you doing anything to shield the low level electronics from this noise. When you tested the control interface, were the motors involved at all?
When doing this sort of thing, I believe it is a common practice to create 2 different 'grounds' or 'commons', a digital/control signal ground, and a high power ground, and only let these grounds connect in one place, probably for you at the battery. Also I would consider optically isolating your drive using cheap fiber optics to isolate the control from the drive. Plastics are enough, you sending a signal more than a few feet and I do not expect you to need extremely fast frequencies, but I am just making assumptions about your project that could be entirely wrong.
You may want to replace the caps, as they are often used for noise suppression.
where can i found the information about this topic please?
Is your shielded wire grounded on a chassis ground on one, but not both, ends of the cable?
the shield wire not grounded...and the signal clear..it is not a problem as i think
Motors usually make a lot of EMI. Are you doing anything to shield the low level electronics from this noise. When you tested the control interface, were the motors involved at all?
i placed the control circuit far of motors...
2 different 'grounds' or 'commons', a digital/control signal ground, and a high power ground,
i have a digital/control signal ground connected with the joystick ground of the wheelchair controller which is connected to the wheelchair ground...and i have no high power ground.