Page 4 of 4

Re: Robot Tour C

Posted: January 18th, 2024, 9:38 am
by 3pantz
brian9640 wrote: September 13th, 2023, 5:35 am
In case anyone needs it, here is a build that I am recommending with parts that can 100% be purchased on amazon:

Chassis, Wheel, and Motors - YIKESHU 2WD Chassis Kit - https://www.amazon.com/gp/product/B073VHQT6P/
Microcontroller - MEGA R3 Board ATmega 2560 - https://www.amazon.com/gp/product/B01H4ZDYCE/
Motor Controller - L298N Motor Driver Controller Board Module - https://www.amazon.com/gp/product/B07BK1QL5T/
Speed Measurement - Infrared Slotted Optical Optocoupler Module - https://www.amazon.com/dp/B08977QFK5
Connection Wires - 120pcs Multicolored Dupont Wire - https://www.amazon.com/gp/product/B01EV70C78/

This comes to about $65 at the time of this posting. You could save a little money by using an Uno microcontroller clone, but you would be trading off programming flexibility. Also, some of the items comes in multiple pieces packs. If you are buying more than one robot, keep that in mind when purchasing (i.e., for a two wheeled robot, you need only 1 of the indicated motor controller module, only two wheel rotation sensors, etc). This kit will require the participant to do Arduino programming, and clearly there are no assembly instructions so they will also have to learn the basics of the control circuitry. All of this is easy to find via Google.
This is a good starting kit. I purchased many of these parts back in 2020 when Robot Tour first started as a trial event. The wiring diagram on TopFinishKits.com (https://topfinishkits.com/pdf/RobotVehi ... 230830.pdf) is very close to the circuitry required.

The sample program on TopFinishKits.com would work. But would need some changes as the wheel encoder on the above kit only has 20 pulses per wheel rotation. The sample program uses the encoder pulses for speed control. My students replaced the motors above with a motor with a built in encoder. See Amazon link (https://a.co/d/g1suQpr). Because the encoder is before the gear box, my students are getting between 300 to 1000 pulses per wheel rotation. This depends on the gearbox selected.
Hi Brian,

The motors you linked are 12V, but the chassis kit linked only has 6 (4*1.5) V, so I am confused whether it will be able to work with half the voltage. Does having higher RPM motors lose accuracy? Also, why do you need more pulses per rotation?

Sorry for so many questions, thank you!

Re: Robot Tour C

Posted: January 22nd, 2024, 1:20 pm
by brian9640
3pantz wrote: January 18th, 2024, 9:38 am
Hi Brian,

The motors you linked are 12V, but the chassis kit linked only has 6 (4*1.5) V, so I am confused whether it will be able to work with half the voltage. Does having higher RPM motors lose accuracy? Also, why do you need more pulses per rotation?

Sorry for so many questions, thank you!
Good question. I'm surprised more individuals have not asked the question about the 12V motors.

You are correct that the voltage is only 9V (6 x 1.5V) or 7.2V (6 x 1.2V rechargeable). The motor will rotate at these lower voltages but slower. A rough example is a 300 RPM motor at 9V would only rotate at (9/12 *300 =) 225 RPM. Being DC motors, the rotating speed (RPM) will vary based on load or torque required. For example, the same DC motor will rotate at different speeds for a light weight robot vs a heavy weight robot. The heavy robot takes more energy to move. Which causes the DC motor to slow down versus the light weight robot.

A higher RPM motor is not loosing accuracy. The higher RPM has less torque available. This is where a heavy robot could have more speed variations due to more torque required.

This where the higher encoder counts helps. These counts allow the robot program to calculate the current RPM of the motor. If the motor is below the required speed, then the voltage to the motor is increased. Below is the Serial Plotter output from one of my students robots. I changed some values to hide their actual results.

Image

The blue line is the desired speed the DC motor should be rotating at. The red line is the speed calculated by counting the number of encoder pulses for a given time. Clue: that time should be below 50msec. A PID loop is used to convert the desired speed & actual speed into a voltage supplied to the motor. The voltage to the motor is the green line (PWM). You can see the PWM output (voltage) is adjusting as the motor increases speed from 0 RPM to the desired running speed.

You can see the actual speed (red) and voltage (green) are not smooth. This is because there are not enough encoder counts to accurately calculate the motor speed. This causes an oscillation in the motor speed. Typically these oscillations are too small for the robot to feel. But less oscillations will mean better robot performance. Hence why higher counter counts are better.

I hope that helps.