PWM pins question

I am currently working on a project to drive an RC car with an Arduino Uno. I’ve hacked the controller to accept inputs via a low pass filter.
However, when I try and pass in two separate PWM signals through different pins (pins 9 and 11), it seems to bleed out and the car turns and accelerates.

Side note: I’m a bit of a Noob when it comes to electronics as I’m more of a programmer rather than an Electrical engineer. I also apologize if this topic has been re-posted, but I couldn’t find it.

Any thoughts are welcome.

Thanks in advance.

Test code is below.

int lr = 120;

void setup()
{
   Serial.begin(9600);
   pinMode(9,OUTPUT);   // controls the turning
   pinMode(11,OUTPUT); // controls the acceleration.
}

void loop()
{
   analogWrite(11,72);  // The controller uses this as an idle mode of sorts
   analogWrite(9, lr);
   analogWrite(11,72);

   if (millis()% 2000 >= 0 && millis()% 2000 < 1000)  // So I can get some idea of how it's turning
      lr = 255;
   else if ( millis()% 2000 >= 1000 && millis()% 2000 <= 1999)
      lr = 0;
   
   Serial.print("Time mod 2000 = ");
   Serial.print(millis() % 2000 );
   Serial.print(" | lr = ");
   Serial.println(lr);
   delay(500);
}

What does your low pass filter look like?

My resistor is a 3.9K(ohm?) and my capacitor is .1 (micro)F

I got the information for converting PWM to Analog from various websites, but the numbers came from here.

I think I have the same issue, but I put it in a separate thread, as it might be a different issue

The speed control would typically be done with PWM turning the drive transistors on and off. If you turn the PWM into a voltage it will likely just keep the transistors turned on all the time. Try eliminating the low-pass filter on Pin 11.

johnwasser:
The speed control would typically be done with PWM turning the drive transistors on and off. If you turn the PWM into a voltage it will likely just keep the transistors turned on all the time. Try eliminating the low-pass filter on Pin 11.

Ok, I can see how that could help, but I do need the two. One to control the voltage for the acceleration and turning. I need them both to accomplish my needs.

The ultimate goal of this is to allow the car to drive on a track an detect obstacles via sonar sensors. It should make course corrections as needed (and I'd rather not have to chase it for a long time).

Thanks for the feedback on it though!

Oh! Wait, I know what you mean I think... However, I would need a straight mode too... Hrmmm...

EDIT:

So I tried that, but I seem to get a similar effect

void setup()
{
 pinMode(11, OUTPUT); 
}

void loop()
{
  analogWrite(9,72);
  digitalWrite(11,HIGH);
  delay(2000);
    analogWrite(9,72);
  digitalWrite(11,LOW);
  delay(2000);
  
  analogWrite(11,72);
  delay(2000);
}

This was allowing me for a left/right/straight... and the car would go Forward, backward, and remain still at the same time as the change in direction.