Hi,
I’ve been browsing through the forums for quite some time now, but still haven’t been able to figure out the solution to my problem.
I have been trying to program my robot using EasyC and Optical Shaft Encoders to move straight certain distances and turn exactly the same angle each time.
I have some if any experience with shaft encoders and have been able to get one working at a time.
Can anyone please help me?
Thank you.
Honestly, you are using the wrong tool for the job. I would recommend you use a Gyro to track heading and encoders to track distance. The gyro can drift a bit but will probably be more accurate then the encoders.
You can subtract the left encoder from the right and compute how far off you are, but it doesn’t account for wheel slip.
Umm, this is the first time I’ve even heard of the Vex Gyro and currently do not have any and have not planned to get any.
Not caring about wheel slip, can you still help me with the encoders?
I’d rather have encoders with wheel slip, than timing the motors.
Hi Samz,
The easiest way to turn would be using the Smart motor commands of EasyC?
In your function blocks look for SMART TASKS, then ROBOT DRIVING “Smart Motors Drive” and “Smart Motors Turn Center”.
Here you can - Select whether you wish to use degrees, or rotations.
Set the output power to between -127 and 127. Values from 0 to 127 will cause the robot to turn to the right (clockwise), while values between -127 and 0 will cause the robot to turn to the left (counter-clockwise).
Don’t forget to configure your motors / IME’s in Controller Configuration (F5) also you will need to use a “define motors” block to setup the drive method and IME Master motor.
Trevor
Intelitek -Technical Support
Aren’t the Smart Motor Commands for IME’s? I don’t have any.
I only have the Shaft Encoders
How to drive strait with encoders.
First you need to have the Optical Quad Encoders.
Get the left encoder value, and then get the right encoder value.
Offset = LEnc - REnc
Use the diffrence as an offset for the left and right motors.
Lmotor = Offset - Speed
Rmotor = Offset + Speed
You should also make some checks to make sure the numbers don’t get to large for the motors. So, something like if (Lmotor > 127) Lmotor = 127;. I’d also set limits on the offset to maybe 25-35.
Good Luck
Umm I still don’t understand what you mean XP
Can you send me an example?
I use EasyC V4