Hello, I was wondering if anyone could help us design a specific code for an electric vehicle that needs to go a specific distance at certain time intervals for the science olympiad competition. For instance, if the distance required was 5m how can I design a code that the vehicle would travel and stop at the certain distance after a certain amount of time. We have the basis of the vehicle already built. It has 4 individual motors which need to be connected to the arduino uno. (I will include the links down below for vehicle and motor). Please somebody help us. And if any more specific details are needed I will provided them immediately.
Thank You
Sincerely
Desperate High School Student
That's what I need to figure out myself. Haha. Would it be better to test the distance my vehicle travels in a certain amount of time? And then afterwards the amount of time it takes for my vehicle to travel my desired distance that's when I'll cut off the power to the motor. Again I'm completely new to this so forgive me if I sound completely ignorant.
Look at the datasheet for the motor. Based on the amount of current, the rpm will be different. You can use the rpm and the circumference of the wheel, along with some testing to determine the amount of time it will take to make the vehicle move 5m.
Use a voltmeter, preferably digital, to measure the power going into each motor.
Remember to put the motors in parallel, but if the vehicle needs the wheels to be able to go backwards and forwards, use an H-Bridge, with pin 13 as + and GND and -. Since there are multiple motor, instead of one motor, put all of the motors there in a parallel circuit.
It seem that you don't have much experience in this kind of thing. So the best choice might be what nehalda explained, but I guess that what matter most in your competition is precision, so i think that there might be around 4 kinds of robots in your competition:
Robots that simply vary voltage.
Robots that move by encoder (much more precise)
Robots that move by encoder and apply PID regarding their position in time (even more precise)
Robots that move by giroscope/accelerometer and apply PID regarding their position in time (unnecessarily extremely precise)
rafg:
4. Robots that move by giroscope/accelerometer and apply PID regarding their position in time (unnecessarily extremely precise)
Lol, I'm doing that. I'll be sure to unnecessarily extremely precisely hang up my medal There's nothing wrong with challenging yourself to use things you haven't learned before/seem complex i.e. PID, gyro. I did it mostly on my own with my brother's help and it's going pretty well so far.