|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
encoder help
I have been trying to program encoders for our robot, but I am having trouble setting up a structure such that encoder A and encoder B, if they are equal the motors move at that speed, if not at the same speed, they have to be adjusted. Enclosed is a copy of the program that has been done by us so far, any help would be greatly appreciated. Thanking you all.
|
|
#2
|
|||
|
|||
|
Re: encoder help
here is what we have figured out, any help would be appreciated becuse when we deploy it, it does not run.
|
|
#3
|
|||
|
|||
|
Re: encoder help
What part of the program is this? Are you using the framework code that enables the robot and sets up the tele and auto modes? If not, that is the problem. The FIRST image for the cRIO will not enable any outputs until a connection exists to the driver station and communication are established by functions such as Start Communications.
If this is teleop or called from it, remove the 100ms delay as that is not small, and will cause the main loop to run slowly enough that all outputs will be disabled for safety reasons. Greg McKaskle |
|
#4
|
|||
|
|||
|
Re: encoder help
It is part of the teleop period, we went online did search for help on how to compare and set results for the encoder, our goal was to get the motors going at the same rate. We will do your suggestion. Thank you.
|
|
#5
|
|||||
|
|||||
|
Re: encoder help
The Exclusive Or function works with Boolean true/false values. You seem to want to compare two numbers. For that, use the Not Equal? function from the Comparison palette.
|
|
#6
|
|||
|
|||
|
Re: encoder help
Thank you, we will try that, we have re-tried the FRC sample encoder code to see if we did physical setup wrong, but that is not the case. Once again thank you.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|