|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Adding more motors for tank drive
This is the first time our team is using python and we've been trying to figure out how to change our original code that had a cim on each side to having two cims on each side. It's probably not that complex but we don't understand the software super well. We need the new cims to be inverted.
|
|
#2
|
|||
|
|||
|
Re: Adding more motors for tank drive
Not familiar with Python, but it should be as simple as either adding 2 new speed controller objects to your RobotDrive object, or if you aren't using a robotdrive object, just add 2 more motor controllers and address them like you do the other 2.
Edit: You might need to add a constructor inside of the robotdrive class that accepts 4 speed controllers, and assigns them to each side of the robot correctly. Post your code? Last edited by nighterfighter : 23-02-2016 at 13:10. |
|
#3
|
||||
|
||||
|
Re: Adding more motors for tank drive
In any language, it's just a matter of telling the RobotDrive object to use multiple motors. Check out the docs at http://robotpy.readthedocs.org/en/la...obotDrive.html
The great thing about using python is the pyfrc simulator... the simulator has full support for 4-motor drivetrains too. Check out this physics example: https://github.com/robotpy/pyfrc/tre...physics-4wheel |
|
#4
|
|||||
|
|||||
|
Re: Adding more motors for tank drive
Alternatively you could keep the code the same and run y splitters for the pwm ports.
|
|
#5
|
|||
|
|||
|
Re: Adding more motors for tank drive
Assuming they aren't using CAN. But they also need the CIMS to be inverted, although they can just reverse the polarity from the speed controller output.
|
|
#6
|
|||||
|
|||||
|
Re: Adding more motors for tank drive
If the motor is on the same side as the motor it is getting y connected to then it shouldn't need to be inverted unless the internal coil was reversed.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|