Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a C-language code for PIC18F4550 to control the position (speed and direction) of a DC Motor based on the feedback from a potentiometric sensor

Develop a C-language code for PIC18F4550 to control the position (speed and direction) of a DC Motor based on the feedback from a potentiometric sensor connected to the shaft of the motor. When the motor is at the desired position, the variable resistor is at its exact center. We aim to bring the motor back to the central point whenever there is a disturbance in the motor position. The motor should return quickly, with higher speed, in case of a large disturbance and slowly in case of a small disturbance. This sensor is a variable resistor whose resistance can change from 1 kOhm to 5 kOhm (Middle value is 3 kOhms). It is connected in series with a fixed resistor whose value is equal to 6 Kilo Ohms. The overall potential divider circuit is powered up with a 5V power supply. The fixed resistor is connected to the ground and the variable resistor is connected to 5V. The analogue output of this feedback sensor setup is fed to the ADC channel 0. Design the circuit in proteus of a full H-bridge with a motor and the sensor circuit, and then calculate the range of the analog voltage output of the potential divider setup. Based on your output range, calculate the appropriate positive and negative voltage reference values needed for maximum resolution of ADC and connect fixed voltage sources of these reference values with the Vref+ and Vref- of the microcontroller. Activate the voltage reference using the ADC control registers and see to which pins these references have to be connected. Use the 8 most significant bits of ADC and ignore the least significant 2 bits. Hint: Develop a formula/algorithm to convert the ADC data into position and speed of the motor. The motor speed should be zero (stopped) when the varibale resistor is at 3 kOhm position and the motor speed should keep increasing if the deviation from 3 kOhm increases in any direction. The motor direction should also be adjusted accordingly. The system clock frequency is equal to 6 MHz.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions