GithubHelp home page GithubHelp logo

Comments (11)

zfhall avatar zfhall commented on July 20, 2024

Does the car move forward when you press left and right arrow keys? Or do the front wheels just turn?

Have you defined self.pwm_forward and self.pwm_backward?

from self-driving-car.

alxtee avatar alxtee commented on July 20, 2024

@zfhall Just the front wheels turn, self.pwm_forward and self.pwm_backward are already defined.

The only changes made were the declaration of the servo, the SetAngle function and setting the angles inside of the def's, as posted above.

Thanks

from self-driving-car.

RyanZotti avatar RyanZotti commented on July 20, 2024

I have also had the humming-but-no-movement issue before, but it’s been awhile since I last had that problem so I don’t recall the fix off the top of my head. I’ll reply back here if I remember though.

from self-driving-car.

RyanZotti avatar RyanZotti commented on July 20, 2024

Actually, I had a temporary issue earlier today where I couldn’t turn but only move forward/backward, but that was due to crossed/touching wires (I did a poor job soldering and have exposed wire metal). As soon as I moved the wires apart from each other the car was able to turn again. Not sure if that’s your extact issue though. If it’s never worked for you I would also double check that you plugged the wires into the correct GPIO pins on the Pi.

from self-driving-car.

zfhall avatar zfhall commented on July 20, 2024

What motor control chip are you using? The L293D and L298N cannot handle high current DC motors. If you are using one of these chips, it's likely that the voltage drop across them is so large when a load is applied, that there is next to no voltage being sent the motor. Try the Cytron MD10C DC Motor Driver instead.

from self-driving-car.

alxtee avatar alxtee commented on July 20, 2024

@RyanZotti I doubled checked the wiring and I don't see any issues. I can try a deep check.

@zfhall I am using the L293D motor contoller, but I don't know if thats the issue since the servo is connected to the RPI and there's only one motor being run from the controller.

I think it might be an issue with the edited code because after some more testing it seems that with my servo code up top- I get really bad latency/performance issues with driving forward and back: I would press the up arrow and a few seconds later the motors would come on shortly and then full power for a few seconds.

However, with servo steering there is a bit a latency at first but later little. I also tried running the servo code with servo unplugged and got same issues moving back and forth.

from self-driving-car.

zfhall avatar zfhall commented on July 20, 2024

@Charlieglider I may be missing something here, but if the motor connected to the L293D is used for forward/backward control, and you are having problems driving forward/backward, then the L293D could still be at fault. Does the forward/backward motor ever run continuously without cutting out? What car are you using? Does the DC motor (not servo) have a serial number? It sounds like you have the same setup as I do, and I had this exact problem until I switched to the MD10C. If you have a multimeter, try measuring the voltage sent to the motor when you tell it to drive forward/backward. If the voltage is lower than your battery voltage, you likely have a problem with the chip.

from self-driving-car.

alxtee avatar alxtee commented on July 20, 2024

@zfhall Apologies for any confusion, when I run the normal drive_api.py (no changes/servo added in) I get decent driving performance forward and back (no left and right capability because I am using a servo). However, when I run drive_api.py with my changes made above and the servo added in, I get the steering capabilities but get choppy driving or have the forward/back motor running continuously without cutting out.

I can try measuring the voltage at the motor, I also think I'm losing power/performance somewhere, but it might be a separate issue to the one with the servo.

from self-driving-car.

zfhall avatar zfhall commented on July 20, 2024

@Charlieglider Ah OK, that makes sense now. I'll try and have another look at your issue when I next get the chance. But I'm going to quite busy over the next few days so hopefully, someone else can chime in with a solution. Good luck!

from self-driving-car.

alxtee avatar alxtee commented on July 20, 2024

@zfhall Ok, thank you.

from self-driving-car.

alxtee avatar alxtee commented on July 20, 2024

I know it has been a while since the last post on this issue.

Nonetheless, any ideas for getting this car to work with the servo?

from self-driving-car.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.