Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

ADC torque microcontroller

jxtafreak2025

Newbie
Joined
Feb 18, 2021
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
22
Hi

Need suggestion for this problem.

## Functional description

For the drivetrain of a prototype vehicle you are asked to implement the part that determines the requested torque based on the user input. The user does this by pressing the throttle pedal.

There are multiple options regarding the throttle pedal, but for now the engineers seem to have selected one that produces two analog output signals, which are connected to a microcontroller.

The relation between the analog signals (redundant for safety reasons) and the pedal angle (min = 0 degrees, max = 30 degrees) are as follows:

- `adc1 = 0.5 + 0.1 * angle`
- `adc2 = 1.0 + 0.08 * angle`

Where adc1 and adc2 are voltages and the angle is in degrees. These analog inputs require some basic low pass filtering (moving average).

This pedal angle corresponds to an amount of torque that the motors must provide. This torque is not only dependent on the pedal angle, it’s also dependent on the current speed of the vehicle.

In case something goes wrong, in our prototype an LED should light up on the dashboard to indicate something is wrong (in a real production vehicle an error message will be shown on the instrument cluster).

Below is pseudo code

Code:
int analg_Pin = A3; // potentiometer wiper (middle terminal) connected to analog pin 3
                    // outside leads to ground and +5V
int value = 0;  // variable to store the value read

void setup() {
  Serial.begin(9600);           //  setup serial
}


void loop() {
  value = analgRead(analg_Pin);  // read the input pin
  Serial.println(val);          // debug value
}
 
Last edited by a moderator:

jxtafreak2025

Newbie
Joined
Feb 18, 2021
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
22
Yes, how to measure the torque value here? Its based on speed on vehicle and also pedal angle with min and max values. In this case two analog output signals, which are connected to a microcontroller. Both adc1 and adc2 are voltages and the angle is in degrees, as shown above. any suggestions?
--- Updated ---

LED should light up on the dashboard to indicate something is wrong. This pedal angle corresponds to an amount of torque that the motors must provide. This torque is not only dependent on the pedal angle,but also on speed of the vehicle.
 
Last edited:

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,949
Helped
4,215
Reputation
8,433
Reaction score
4,161
Trophy points
113
Activity points
124,578
Hi,

There is a motor and there are tyres, inbetween is the gear box.
Since the gearbox "modifies" RPM you need to be more exact what speed amd what torque you mean.

You say speed, thus I think of speed of vehicle. This will be prortional to tyre RPM.

Indeed which values to use depends on what you want to do with the informations.
* slip detection or drift control
* power measurement or control
* ???

And are you talking about electro motors or fuel motors?

Klaus
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
5,038
Helped
1,104
Reputation
2,218
Reaction score
1,089
Trophy points
1,393
Location
California, USA
Activity points
27,598
I’m very confused. You say “the pedal angle corresponds to the amount of torque that the motors must provide.” You have an ADC that measures pedal angle. Then you ask “how to measure the torque value here? Its based on speed of vehicle and also pedal angle”.

Torque, from a physical point of view, is NOT related to speed. Im guessing that what you really mean is that your system requires CONTROLLING the applied torque based on pedal angle AND vehicle speed. Thus, you need to measure pedal angle, which you do with 2 ADCs. But you also need to measure torque and vehicle speed In order to close the loop.
 

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top