|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
We are using a VEX motor module on our FRC robot for an off season competition. We are using Java and are unsure how to control the motor in our code.
A fast answer is greatly needed and appreciated! |
|
#2
|
|||
|
|||
|
Re: VEX motors on a FRC robot
I'm no expert, but to me it seems you would plug it in a PWM port on the Digital Sidecar and control it the same way you would a Victor.
This is assuming it is a 3-wire Vex motor. One thing to note though is how much current can the digital sidecar source on the PWM power pins? The Vex motor is capable of pulling probably a couple Amps. You might want to do a little wiring and give it power directly from the fuse panel, and only take its signal line to the sidecar. |
|
#3
|
|||||
|
|||||
|
Re: VEX motors on a FRC robot
I assume you will be using either a 3-wire VEX motor or a 3-to-2 wire motor controller so that you can use the cRIO PWM outputs? If so, your code can simply call it a Victor and should work without issues (the PWM timing of 1ms reverse, 1.5ms neutral, and 2ms forward is exactly the same between Victors and 3-wire VEX motors/controllers). You would also want to make sure the 6V servo jumper is installed on the motors' PWM pin so that you can source enough current to your motor (up to ~3A is available - total - to PWM outputs connected to the 6V line, so multiple VEX motors at stall run the risk of blowing a fuse).
You can also get a 2-wire motor working, but would have to write custom code to control it from the solenoid breakout or 5V digital IO pin. Keep in mind that VEX motors are spec'd at 7.2V nominally, but the cRIO can only provide 6V via PWM. If you use a 3-wire motor/controller, expect to see a slightly slower and less powerful motion as a result. (Here is the digital sidecar document for reference). Last edited by Jared Russell : 21-06-2011 at 08:13. |
|
#4
|
||||
|
||||
|
Re: VEX motors on a FRC robot
If you are using a speed controller on the motor, it isn't different than coding a regular FIRST motor. Firstly, you need to determine what speed controller it is (Victor or jag). Depending on which it is, the constructor will be something like
Code:
/*speed controller type*/ motor = new /*speed controller type */(4,/*pwm number on sidecar*/); /*during teleport period...*/ motor.setSpeed(*/a double less than 1*/); Last edited by Egg 3141592654 : 30-06-2011 at 13:04. Reason: speed control name replaced with speed control type for clarity |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|