Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Motors, Mechanics, and Power / Re: Wiper motor and current under load on: April 18, 2012, 02:43:15 am
well, I have a 18V 15A motor controller for the wiper motor with a 15A fuse in between. The wiper motor is on the front of the go cart to turn the wheels. When a person is on the cart, and the person tries to operate the steering, the 15A fuse blows. I have measured the stall current on the low speed and it pulls approx 13A. But when we try to drive it and steer with it moving it blows the fuse. Would there be a reason it pulls more than 15A when the stall current I re-measured earlier is 13A?

I am going to try a 18V 25A motor controller but I had thought that would not be needed, guess I was wrong.
2  Using Arduino / Programming Questions / Re: Evaluating PID algorithm on: April 17, 2012, 02:06:10 pm
Ignoring the post above, I have code for my first arduino that reads in the values before sending over serial. I just thought that I have:
Code:
int potPinS = A0;
int potPinB = A2;
int potPinG = A4;
//A0 - steering wheel, A1 - Brake pedal, A2 - gas pedal
// variable to store the value
int val;

//variable to store previous value
int lastVal = 0;

void setup() {
  Serial.begin(9600);
 
}

void loop()
{
    //Read in value from Steering Wheel potentiometer, only receive if greater than 15 from previous value. Implemented for sensitivty issue.
  val = analogRead(potPinS); // read the value from the pot
  if(abs(val - lastVal) > 15)
  {
    //Serial.print("<"); //started the value
    Serial.print('S'); //To distinguish from which potentiometer
    Serial.println(val); //value for steering wheel pot
    //Serial.println(">"); //ended the value
    lastVal=val;
    delay(5);
  }

And if I turn my wheel and don't move it, the wiper motor records the last time the steering was moved, calculates error, and sends the wiper motor speed and it doesn't stop and loops around. Would this be a reason? If I set this pot to read in always so it can calculate the error always instead of the limit I have placed on it?
3  Using Arduino / Programming Questions / Evaluating algorithm on: April 17, 2012, 05:07:02 am
Trying to write a 'P' algorithm using a steering wheel and wiper motor. Here I have the basic 'P' algorithm. I have the motor moving both directions but now am trying to make it stop when it reaches a certain max/min on each side so it can stay within range of my constrain functions and be able to read, have a little leeway between both, but it still seems to get a little past that max/min and then it seems to not respond since it is out of range....I do not need it to keep rotating in circles which is the reason I tried to implement it. And when it gets to the max/min ends and stops the motor, I need it to continue reading the serial incase I turn the steering again to get going.
4  Using Arduino / Programming Questions / Using value in another function on: April 17, 2012, 12:11:46 am
Not sure if I need to use pointers or if there is another method but here is the code I am needing help with:

Code:
int processSteer (const unsigned int value)
{
   int steeringInput = constrain(value, 490, 970);
  return steeringInput;
}
int handle()
{
//inside a switch statement, reason for break
//currentValue is a value being read in
   static int target = 0;
   target = processSteer(currentValue);
   break;
}
  }  // end of switch

void processX(const byte c)
{
  ......
  handle();
}

void loop()
{
  if(Serial.available())
  {
    processX(Serial.read());
  }
  else{
    if (x==target)
  ........
       }
}

My main question is, being able to use the static int target in the loop function. Is there a way to call this to be able to use since I did not initialize it inside the void loop?
5  Using Arduino / Programming Questions / Re: Wiper motor is continuous using code on: April 15, 2012, 02:50:29 am
Well, thank you for pointing that out because I am not sure why I came to the forum in the first place....it could not be because I needed help could it? Oh, that's right....I get sarcastic remarks from most people here but a few(I remember them) instead of helpful information that a forum is suppose to provide. Thanks for the "help" but I could do without yours from now on, although I do not see that you have even provided any yet. But thanks anyway.
6  Using Arduino / Programming Questions / Re: Wiper motor is continuous using code on: April 15, 2012, 02:30:54 am
Did I hear a "swoooosh"? So what is the arduino "stop" function actually connected to?

Sorry, I do not understand your sarcastic remark.

"Stop function" connected too? Do you understand what I am trying to do?

Code:
 else
  {
    Serial.print("Nothing Changes");
    Serial.println(motorSpeed);
    turnStop();  
    /*steer.write(0x85); //send first byte of motor speed
    steer.write((byte)0x00); //send first byte of motor speed*/
    return;
  }

This statement is meant that once the error is insignificant because the target position is approximately close to the current position the motor does nothing. So, if I have the wheel going straight and I want to turn all the way right, the wiper motor will turn right until it start getting close to turn position and then once the error is between -5 and 5 it stops.

I see a possibility why it would not work earlier because the motor was shorting out since I did not have it completed separated since our chassis is grounded when the motor needed to reverse polarity. We are fixing the problem tomorrow and going to re-test the code and it should be close I would imagine.
7  Using Arduino / Motors, Mechanics, and Power / Grounding issue with a wiper motor on: April 14, 2012, 10:46:21 pm
We have realized that when going reverse polarity the wiper motor is somehow now grounding through the rod that is connected to the shaft of wiper motor. My partner knows more about power situation than I do and that is the issue we are having now. Here is a picture of the possible problem. We used rubber grommets and other stuff as you can see on the wiper motor with the holes and else across the C bar. Now I think the issue is the shaft and the rod somehow. When we took the nut off the wiper motor shaft and let it spin freely with the code, when I would turn left to reverse polarity he saw some sparks he said and then the fuse blew. That is our problem it seems now, anyone dealt with this type of motor before and recommend anything for a possible solution? What we think now is where the bolt is for the rods, to put a rubber grommet inside the rod hole(that the bolt current goes through at the top) that connects the wiper motor and then put the bolt back through. The wiper motor is being controlled by a High power motor driver 18v15.

http://i.imgur.com/kqqPR.jpg
8  Using Arduino / Programming Questions / Re: Wiper motor is continuous using code on: April 14, 2012, 09:03:23 pm
Quote
Just the wiper motor, once it starts, it just continues looping instead of only going 30-40 degrees to the left or right from the upright vertical position.

Ever notice that when you turn off a car windshield wiper via its switch that it continues to move until it gets to its parked position? The only time when it stops mid stroke is when you turn off the ignition, killing all power to it.

Right, and that is why I have a stop function. Say, I have the wheel at a straight up and then steering goes right. The wiper is supposed to go to the right and slow down until it gets to approx the position it is supposed to get it then stop with the stop function since the turn will be between -5 and 5 as in my code.

One thing I have noticed is to apply, is if on start up the wheel is all the way right and the steering is straight. What if I turn the wheel to the right? Not sure if I have implemented anything in the code to do that.

I am fixing a shorting issue with the reverse polarity so maybe that will fix that problem.
9  Using Arduino / Programming Questions / Wiper motor is continuous using code on: April 14, 2012, 07:01:09 pm
Using an 18v15 with DIR and PWM pin I use. I have tried to implement it but it seems that once I turn the wheel the wiper motor just loops around until it stops or blows the 10A fuse we have. So, something is obviously wrong with my code.

I also had the problem of once I flipped the power switch the wiper motor would start turning without doing anything so I implemented the analogWrite(0) in the setup to turn it off. The part of code in question start with /****STEERING*****

The output of the code display great with the error, turnpos, currentpos. Just the wiper motor, once it starts, it just continues looping instead of only going 30-40 degrees to the left or right from the upright vertical position. The wiper motor shaft is upright, and I want it to turn either left about 30 degrees or right 30 degrees. And if it is all the way left 30 degrees and then go back right. It now acts like it has no max or min and just continuously turns.
10  Using Arduino / Motors, Mechanics, and Power / Re: Interference with wiring on: April 12, 2012, 09:48:56 pm
We finished wrapping the wiring with metallic tape as seen in above picture and it seems it has cut out the interference quite well. Not more problems as of now. Thanks for the suggestions.
11  Using Arduino / Motors, Mechanics, and Power / Re: Interference with wiring on: April 12, 2012, 06:11:02 pm
That is a tricky problem. As I understand it, when you connect up a 12 Volt supply to a motor controller, that affects only one pot reading on an Arduino where the pot is connected to a separate 5 Volt supply. Is that right?

Yes, in the second picture I labeled the 5V rail. It is supplied from a 36V to 5V step down. The 12V and 36V run to a switch then back to the rail to supply. Both coming from the battery.

What connection is there between the 12 Volt and 5 Volt supplies?

Might have explained above.

Are all grounds connected?

Yes, the GND rail on the side of the picture.

Where is the code that reads the pots? Did you set the analogRead input pins to be INPUT?

I am sending over xbee. The first one(in back of picture) takes all pot inputs and sends to second one. I do not have them labeled as inputs in the code but they seem to work. I will change that and see.


I am going to try to run the 12V/GND wire to supply the motor controller underneath the board instead of over all the wires as you can see it is in the second picture(the one with taping). Maybe current flows over the 12V and is over the steering pot wire...not sure. Because when it is not connected everything is good.
12  Using Arduino / Motors, Mechanics, and Power / Re: Interference with wiring on: April 12, 2012, 06:06:50 pm
You have long runs of what appears to be unshielded un-twisted cables going to the pots?

Yes, just wiring running from the front to the back.

Each cable to each pot would be best as shielded (shield to gnd) cables with the groung connected only at Arduino end - dont connect it to the chassis at the pot end. You should try something like microphone cable with two shielded conductors, one for 5V and one for the wiper)

Can you explain this again?

You pots should not be high impedance, try 2k to 10k or so, 100k would be too high

I am using 10K pots I believe.

13  Using Arduino / Motors, Mechanics, and Power / Interference with wiring on: April 12, 2012, 04:05:25 am
I have a previous thread but it got a little big so here is a new problem with pictures. First picture shows our actuator. It goes into the motor controller and is supplied by the GND and 12V wire that is unplugged(circled), it is wrapped in a type of tape(forgot name) to try to defer the interference by did not help.
14  Using Arduino / General Electronics / Re: Unwanted feedback from potentiometers on: April 11, 2012, 07:32:31 am
Another thing to mention since this is wireless, I have tested all the inputs into the first arduino and there is NO crosstalk between any of the pots. These inputs are sent over xbee to the second arduino to send values to motor controllers. What my outputs I posted are the output that is being sent from the arduino2 after it has received from arduino1. So, I do not know why crosstalk seems to happen on the output for arduino2 but there is NO crosstalk when I display the output from the arduino1.
15  Using Arduino / General Electronics / Re: Unwanted feedback from potentiometers on: April 11, 2012, 07:17:27 am
I just thought about trying to implement to ignore the big jumps for a pot like I did for GOT_B:

Code:
case GOT_B:
    static int check = 0;

    if(abs(currentValue-check) > 150)
      break;
    else
      check = processBrake(currentValue); 
    break;

I could do this for GOT_W and GOT_S where if the previous value compared to the current value is greater than a number then ignore so ignore the jumps from Steer = 0 to Steer = 500 jumps but then I see that steer with the crosstalk does not make those big jumps.
Code:
Steer = 609
Wheel = 615
Steer = 632

I also noticed that Wheel is output three straight times in my output. That is weird as ALWAYS whenever Steer is printed that Wheel is the next one always. It shows Wheel displaying three in a row....guess that is crosstalk huh?
Pages: [1] 2 3 ... 6