Code Monkey home page Code Monkey logo

Comments (4)

Prototyx avatar Prototyx commented on August 27, 2024 1

Hello, The arduino is 5V (it's Atmega328p, same as uno board). I am using a logic level converter between the Arduino and RPi designed for I2C communications (PCA9306).
I made some investigations today :

  • I2C in Fast mode (400kbit/s) --> A lot of I/O errors
  • I2C in Standard mode (100kbit/s) --> Something like 1 error per minute

When I put the scope on I2C lines, in fast mode the frequency is not stable at all, I think the RPi has to deal with others tasks with higher priority and decreases the frequency, maybe it is for this reason that it causes a lot of errors, because the arduino is not able to manage this frequency variation.

Anyway, after decreasing the I2C speed, I was able to drive the car without problem, and I did my first autonomous session. I was very impressed !

from donkeycar.

Ezward avatar Ezward commented on August 27, 2024

@Prototyx Are those signals the pwm outputs? It looks like those signals are on the same pin. If those are the PWM outputs then you need to send the steering and throttle pwm on two different pins.

I would be surprised if it was an I2c issue; it's a serial protocol that can handle bus contention. What error are you seeing? Are you seeing it in the donkeycar console or the arduino serial console? Can you copy the output here?

PS: the car looks really cool; very compact. Nice.

from donkeycar.

Ezward avatar Ezward commented on August 27, 2024

@Prototyx what type of Arduino are you using? Is it 5v or 3.3v? How are you handling the logic-level conversion between the RPi and the Arduino if the Arduino is 5v? The reason I ask is that it is my understanding that some logic-level conversions can 'round' the edges of a logic level change and so could possibly affect I2c communication.

from donkeycar.

Ezward avatar Ezward commented on August 27, 2024

@Prototyx Thank you for detailing the resolution. I'm closing this issue.

from donkeycar.

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.