Ok this should be a pretty simple project for any Microchip PIC programmer.
I have bought this board to control the speed of my son Power Wheels ride electric atv:[url removed, login to view]
It use a PIC12F615 to control the PWM duty cycle and the frequency. It is working fine, but the problem is that when we got a uphill, the car slow down way to much and when going downhill, it is going way to fast. So the project is to create code for this chip and board to make it closed loop. I already have a 0-5volts signal for the current motor speed, so at full speed i got 5 volts 1/2 speed i got 2.5volts and stopped 0 volts.
Right now the left potentiometer on the picture you see if for adjusting frequency, i want to remove this potentiometer and use this analog port as the motor speed input. and the right potentiometer is the duty cycle adjustement, i whant to change that as the desired speed adjustement. The frequency can be fixed at what should be the best for this type of application. I would ike to have the speed as steady as possible and the acceleration as fast as possible. I have attached the current circuit diagram of the board i got. When the motor speed sensor input is lower then the desired speed input, it should get the duty cycle higher and when the motor speed input is higher then the desired speed input, it should get is lower.
Thanx a lot!