cancel
Showing results for 
Search instead for 
Did you mean: 

DC Motor Control (H-Bridge) using PID and a Potentiometer, and a Tachometer.

DimitriPetrenko23
Associate

I have a project that requires Implementing a PID into controlling an DC motor (H-bridge), but im currently stuck on the code and other implementing stuff that i need help of. The desired Speed can be adjusted using the potentiometer, and the tachometer data sheet reads each volt equals 1000rpm. So im stuck here on whether to count the Tachometer as a timer or as ADC ? and im trying to figure out a good code, which i have written some of it that helps me achieve this, and exactly where to put the code of the PID ? If any of you can help i would be so pleased. 

 

 

 

12345.png555555.png

4 REPLIES 4
Pje
Associate III

@DimitriPetrenko23 wrote:

 The desired Speed can be adjusted using the potentiometer, and the tachometer data sheet reads each volt equals 1000rpm. So im stuck here on whether to count the Tachometer as a timer or as ADC ? 

 

I would think the tacho signal comes from the motor and in that case the motor Datasheet should tell you what kind of output it is giving ,

There are many kinds of motors and there speed signals are in various forms ,if you talk about a H bridge I suppose you mean an H bridge as in a Brushmotor H bridge and not a 6 pack bridge circuit as in a Brushless motor design (3phase bridge)

Post your datasheet for the motor and the guys can look and help 

 

 

 

 

 


 

I dont have the data sheet but its a DC motor that looks exactly like the picture, and the tachometer is shown also, i need the code that runs this program or a little help in running it.

DimitriPetrenko23_0-1733578846622.png

 

Hi,

From the photo it seems the motor has a toothed gear on the shaft ,in that case there is a sensor on the board that translate(and greate ) pulses as the tooth gear passes the sensor (TTL signal) there are two ways which I know off

(1) is count the pulses per REV and from that derive the RPM

(2) meausre the frequence of the pulse train and  convert to time and from time you can derive the RPM

in my opin looking at the photo there is no adc involved however the phot does not clearly show all the components on it

 

Good luck

A potentiometer is counted as ADC, The tachometer im stuck on it as i said, but still i will take what you say. but here i still cant find a good C code that may run this program, so im just curious on how to find or write a good C program that should be enough to run this project.