We found of the decimal point and ignored it when transmitted. Thus we multiplied every value by 100. We mapped this input value between a range of 0-1023, as the arduino has a 10bit ADC. This enabled us to use a simple subtraction to compare the setpoint and the actual output when we work on the closed loop system.
We then used a potentiometer to provide the required analog input and generated a PWM signal of varying duty cycle. We then accepted control inputs from the keyboard. By adding an RC filter we generated an analog D.C. voltage between 0-5V from the PWM output. This D.C. value was proportional to the Keyboard input with a small error. Hence we made a simple open loop system.
After this we started working on a simple closed loop system. Here we took the D.C. output and supplied it to the analog input pin. We found the error between the D.C. output of the filter and the setpoint to recalculate the duty cycle.
No comments:
Post a Comment