Home     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

Author Topic: Need some help for PWM Closed loop project!  (Read 4731 times)

0 Members and 1 Guest are viewing this topic.

Speedy2k

  • Guest
Need some help for PWM Closed loop project!
« on: July 21, 2012, 01:41:56 AM »
Hi, my son have a Power Wheels electric ride on truck. I would like to be able to control it's speed but keeping the same torque on the engine, so i think the best way to do this is exactly like this:
http://www.pcbheaven.com/circuitpages/Closed_Loop_Fan_Controller/
Here is the board i have:http://www.canakit.com/30a-motor-speed-controller-pwm.html
I already have bought a PWM controller able to throw 30 amps to the 2 12 volts dc motor, and by any chance the PIC controling it is a PIC12F615, the exact same one used in the exemple above.
What i have done since my 2 dc motors doesn't have any sort of tach sensor, i have connected a little 12 volts dc motor shaft to shaft with the main one, so when i start rotating the main motor, the little one i have added start to create voltage. i have a potentiometer to reduce this maximum voltage to 5 volts, so it can be used as a speed sensor from the pic, so what i would like to do is Remove the P1 that is used for adjusting the frequency when not in fixed mode and used this input to get the 0-5 volts speed input from the little dc motor. he P2 that right now adjust the duty cycle, will be used to adjust the desired speed, so basically what the pic need to do is try to match the fastest possible input from P1 to the input from P2 by increasing the duty cycle or lowering it.
Can someone modify the piece of code in the tutorial page above and adapt it to my need? i am just starting with pic and i would like my son truck to run ASAP. I am willing to pay for that. I know it should not be really hard.
Here is a video of the current setup. I would like the truck to get to maximum speed as fast as possible.
http://www.youtube.com/watch?v=gJVosYe-_RQ
I will be able to reprogram the chip locally here.

Thanx a lot!

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: Need some help for PWM Closed loop project!
« Reply #1 on: July 21, 2012, 17:23:54 PM »
i can give you one advice to make it easier. You'd rather use a digital encoder instead of a motor, because you will need to add filters to the motor, and then A/D etc etc etc. Whereas with the digital encoder, you will receive speed feedback directly from the shaft for the PIC. It will then work similarly as a fan tacho feedback.

To make the encoder, simply make a circular disk (plastic, paper... whatever) with a number of holes in the perimeter of the disk. The idea is that as the disk rotates (the disk is mounted on the shaft of the road of motor), the holes will pass in front of an IR beam-cut pair sensor. There are such sensors ready-made to use (IR pairs). The output of these pairs will be rectangular pulses the same as the fan tacho.

Speedy2k

  • Guest
Re: Need some help for PWM Closed loop project!
« Reply #2 on: July 21, 2012, 17:28:28 PM »
The 0-5 volts input is not suitable? Because i don't need anything fancy here, but i want my son ATV to keep it's speed as much as possible. The voltage seems pretty steady so far. If it is not suitable at all, can you oint me to an already avaible kit for speed sensor ? Thanx. Do you think the software will be hard to adapt ? I would like the ATV to keep is speed as best as possible and i would like it to accelerate to the desired speed as fast as possible.

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: Need some help for PWM Closed loop project!
« Reply #3 on: July 21, 2012, 18:57:17 PM »
well, the software is absolutely NOT suitable for this application. It has a very long loop delay cycle. You will rather need a PID - controlled circuit to maintain the speed stable. Anything else will cause your kid to sick, because it will increase and decrease the speed violently. It has to be fancy otherwise it will not work...


Speedy2k

  • Guest
Re: Need some help for PWM Closed loop project!
« Reply #4 on: July 21, 2012, 20:17:28 PM »
Ok, is there any tutorial fir this? I am really new to all that, is this doable with the pic i got or does i need a completely different circuit?

kam

  • Administrator
  • Hero Member
  • *****
  • Posts: 1849
Re: Need some help for PWM Closed loop project!
« Reply #5 on: July 21, 2012, 20:42:30 PM »
i'm not sure