The purpose of our project was to create a variable speed throttle for a power wheels car purchased from amazon. This is an education based project for MEGR-3092 at UNC Charlotte in the department of Mechanical Engineering and Engineering Science. This device works by using a Particle Argon, a new throttle pedal sensor, and two electronic speed controllers. The controllers are programmed to allow the motors to spin at different speeds based on throttle position.
The general flow for this project starts at the Particle Argon. The Argon is fed a signal from the Hall Effect Variable Throttle Petal that will have a value anywhere between 1100 and 4000. This signal is then converted using the "map" command to somewhere between 0-255 based on how far the throttle is pressed. The constrain command is also utilized here to reduce the effect of the noise introduced by the petal sensor. At this point the newly mapped throttle position is transmitted, via Wi-Fi, to our Adafruit.io dashboard and plotted over time.
Now that the throttle is valued somewhere between 0-255, a new variable called "servoPosition" is generated that will determine the speed at which the servo motors spin. The "servoPosition" variable takes the throttle position and again maps it somewhere between 1000-1500. This new value represents the PWM signal, in microseconds, that will then be sent to the servos through the ESCs.
A signal of 1500 microseconds written to the ESCs represents the car being in neutral and therefor there is no throttle applied. As the throttle is pressed, the signal is reduced closer to 1000 microseconds causing the servo motors to speed up. It is worth noting that normally variable speed in the forward direction would be represented by values of 1500-2000 microseconds and reverse speed represented by 1000-1500 microseconds. The reason this is switched in this specific case is that our wires were initially connected backwards and it was simpler to change the code for the signal than to redo all of the wiring. Still the same result is achieved from either action.
In addition to the variable throttle for this car. A current sensor and voltage reading were utilized to gather real time data from the performance of our system. The current sensor was placed in-line between the batteries and ESCs (before being split in parallel) to get a reading of how much current the whole system is pulling from the battery. For the voltage reading, the positive and negative terminals of the battery were split by a voltage divider circuit with a 10:1 ratio. This ratio was required to drop the voltage of the battery to a level that could be handled by the Particle Argon pins. Once both of these values were gathered, they were then sent, via Wi-Fi, to our adafruit.io dashboard, similarly to the throttle position.
The final component to our throttle system is a section of code implementing a slew rate traction control. This is a simple version of traction control that limits the throttle increase to a certain amount per loop iteration. In our code we have the "trottleRate" variable that sets this maximum throttle increase. Every loop, the code takes the previous throttle position and adds this throttle rate value to it. The new value is then compared to the throttle input signal and the smaller of the two values is written to the drive motors.
The idea behind this type of traction control is that is slows the acceleration of the tires instead of allowing them to go from 0-100% throttle (mapped between 0-255 in the code) in one jump. This reduces, or ideally does away with the slip between the ground and the tire. Through testing of our circuit, throttle, and cohesive vehicle system, we found that a throttle rate of 5 was ideal for our vehicle.
Comments