Justin Zhang wrote:I have tried a EV design using an Arduino and VEX Quadrature Encoder. The problem was the Arduino could not count the rotations of the encoder fast enough, so when reaching high speeds it skipped rotations and decreased the distance it ran. Different types of programs (on Arduino IDE of course) affected the accuracy, so it seems to depend on how fast the program is. I've considered interrupts, libraries, etc.
I understand that many people use Arduinos for their EV. How do you guys run them to the correct accuracy?
Secondly, my arduino mega reads encoders in degrees of 90 when I need accuracy up to 360.
Please share some sample code?
cubes wrote:If I choose to do a fixed angle for the steering, would the EV travel in a circular path and does the radius stay constant regardless of velocity and acceleration?
Justin Zhang wrote:I have tried a EV design using an Arduino and VEX Quadrature Encoder. The problem was the Arduino could not count the rotations of the encoder fast enough, so when reaching high speeds it skipped rotations and decreased the distance it ran. Different types of programs (on Arduino IDE of course) affected the accuracy, so it seems to depend on how fast the program is. I've considered interrupts, libraries, etc.
I understand that many people use Arduinos for their EV. How do you guys run them to the correct accuracy?
Secondly, my arduino mega reads encoders in degrees of 90 when I need accuracy up to 360.
Please share some sample code?
thesenotes wrote:Justin Zhang wrote:I have tried a EV design using an Arduino and VEX Quadrature Encoder. The problem was the Arduino could not count the rotations of the encoder fast enough, so when reaching high speeds it skipped rotations and decreased the distance it ran. Different types of programs (on Arduino IDE of course) affected the accuracy, so it seems to depend on how fast the program is. I've considered interrupts, libraries, etc.
I understand that many people use Arduinos for their EV. How do you guys run them to the correct accuracy?
Secondly, my arduino mega reads encoders in degrees of 90 when I need accuracy up to 360.
Please share some sample code?
Here is some code. Each white wire on the VEX encoder should be connected to pins 2 and 3 on the Arduino (these are the interrupt pins) and the black and red wires should be connected to ground and a power supply of 5V, respectively:
// Red - 5V
// Black - GND
const int encoder_a = 2; // use one white wire here
const int encoder_b = 3; // use the other white wire here
long encoder = 0;
void setup() {
Serial.begin(9600);
pinMode(encoder_a, INPUT_PULLUP);
pinMode(encoder_b, INPUT_PULLUP);
attachInterrupt(0, encoderPinChangeA, CHANGE);
attachInterrupt(1, encoderPinChangeB, CHANGE);
}
void loop() {
Serial.println(encoder);
}
void encoderPinChangeA() {
encoder += digitalRead(encoder_a) == digitalRead(encoder_b) ? -1 : 1;
}
void encoderPinChangeB() {
encoder += digitalRead(encoder_a) != digitalRead(encoder_b) ? -1 : 1;
}
NilaiVemula wrote:Does anyone have any effective methods of attaching a caliper to the side of your vehicle?
Bazinga+ wrote:NilaiVemula wrote:Does anyone have any effective methods of attaching a caliper to the side of your vehicle?
I clipped mine by having 2 pieces of metal sticking up from the side of the vehicle and then clamping it by using 2 screws and bolts for each to tighten another piece of metal over the caliper. This way the caliper was squeezed between the screwed on piece of metal and the one attached to the side of the vehicle in two places (for stability). Additionally i put some thin soft rubber material between the caliper and the metal that clipped it which helped secure it well.
windu34 wrote:Any suggestions for regulating my power supply to my brushless ESC? I tried using a buck converter rated for 8A (12A max) with the voltage set at 7V, but I think the sudden load fluctuation caused the converter to break because now I can no longer adjust the output voltage to any other quantity than the input voltage
dcrxcode wrote:windu34 wrote:Any suggestions for regulating my power supply to my brushless ESC? I tried using a buck converter rated for 8A (12A max) with the voltage set at 7V, but I think the sudden load fluctuation caused the converter to break because now I can no longer adjust the output voltage to any other quantity than the input voltage
We had similar problems with regulating our power supply with the Buck converter blowing out - seems like the DROK ones aren't all that reliable. We used a 5v voltage regulator like the one shown here https://www.adafruit.com/product/2164 and wired it together through a breadboard. I'm sure you can solder too, and a quick google search pulls up similar products for 7v: http://www.mouser.com/ProductDetail/ROHM-Semiconductor/BA17807T/?qs=4kLU8WoGk0v9K7nzkiqL8w%3D%3D&gclid=Cj0KEQjwi7vIBRDpo9W8y7Ct6ZcBEiQA1CwV2H9MLfGRsuOwx8IA7GAir0b4Wezg2Wu01Niyz2f_bx0aAvOz8P8HAQ. I suppose you'll have to find one that fits your current draw; our 5v one heated up a lot but it still worked.
markuswso17 wrote:What do you guys think top 3 National scores will be? Also what diy up think is the width of the thinnest vehicle at nationals?
Return to “Electric Vehicle C”
Users browsing this forum: No registered users and 1 guest