Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motor drive reversed, inconsistent #1

Closed
moggoly opened this issue Nov 25, 2015 · 3 comments
Closed

Motor drive reversed, inconsistent #1

moggoly opened this issue Nov 25, 2015 · 3 comments
Labels

Comments

@moggoly
Copy link

moggoly commented Nov 25, 2015

There's an inconsistency between the code on your site and in here.

On your site, the lines that drive the motors is shown as:

PBR.SetMotor1(-driveRight)
PBR.SetMotor2(driveLeft)

But in the diddy*.py files here the directions are reversed:

PBR.SetMotor1(driveRight)
PBR.SetMotor2(-driveLeft)

I've used your code as a basis for my own version (also using PicoBorgRev), but was scratching my head last night wondering why the motors were not spinning in the right direction, and thought my motor connections were all wrong...

Should they not both be used without negation?

@piborg
Copy link
Collaborator

piborg commented Nov 25, 2015

The DiddyBorg examples should all be using the following code:

PBR.SetMotor1(driveRight)
PBR.SetMotor2(-driveLeft)

in all places so that the front is where the camera fits.

I cannot see the page where the left / right swap is, could you point me to it?

The reason the motors are inverted is that all of the motors are connected the same way electrically.
That is to say both the left and right motors are connected so that + -> + and - -> -.
Since the motors are then fitted the opposite way around it means the left and right wheels turn in opposite directions.
By inverting one set we make them spin the same way.

@moggoly
Copy link
Author

moggoly commented Nov 25, 2015

It's on the 4Borg Web UI page: https://www.piborg.org/4borg/webui

@piborg
Copy link
Collaborator

piborg commented Nov 25, 2015

Ah, that is a mistake...

On 4Borg the left and right motor connections are swapped over to keep the cabling neat.
This means with a 4Borg the code should be:

PBR.SetMotor1(-driveLeft)
PBR.SetMotor2(driveRight)

I have updated both GitHub and the website for the 4Borg files.
The rest of the 4Borg standard examples are already correct in the installation.

@piborg piborg closed this as completed Nov 25, 2015
@piborg piborg self-assigned this Nov 25, 2015
@piborg piborg added the bug label Nov 25, 2015
@piborg piborg removed their assignment Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant