|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: [FTC]: One Encoder Works; The Other Ones Does Not
I've done some more online research... This is exactly our problem and first surfaced about a year ago:
http://www.robotc.net/forums/viewtop...=2774&start=15 It was supposedly fixed in ROBOTC 3.54. We are running ROBOTC 3.62 Also, the order of powering up the motor controller and the NXT seems to be important. We are using this order: 1. Power up 12v to motor controller 2. Power up NXT 3. Download and run program |
|
#2
|
||||
|
||||
|
Re: [FTC]: One Encoder Works; The Other Ones Does Not
Hello,
Here is the code that we use for moving motors to a position. We have had problems non-stop with the built in RobotC nMotorEncoderTarget function so we wrote our own. Here it is written to do what your code was supposed to do: Code:
#pragma config(Hubs, S1, HTMotor, none, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorTetrix, PIDControl, encoder)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorTetrix, PIDControl, reversed, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard
typedef enum
{
We have different power curves for the target to motor power function because we found that depending on load and backlash in certain applications a single power curve could cause oscillations. We have used this method for controlling everything from arms to our drive base with great success. Play around with this code and see what settings work the best. Best of luck, Team 4211 |
|
#3
|
|||
|
|||
|
Re: [FTC]: One Encoder Works; The Other Ones Does Not
Wow. Terrific! Many thanks!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|