go_away

Author Topic: programs  (Read 2401 times)

0 Members and 1 Guest are viewing this topic.

Offline 1sam3Topic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
programs
« on: March 30, 2008, 01:42:26 AM »
hi, i am honestly not that good in progamming, so plz if any1 can help..
am trying to controll a brushed dc motor and a stepper motor via my pic 18f452- microcontroller. the job of the first motor is to rotate a base of a satellite dish ~360degress, the second motor's is to tilt dish up-down.
i need to find a way to write a c program, and use it on mplab to control the motors..
code..

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: programs
« Reply #1 on: March 30, 2008, 11:21:22 AM »
Are you asking how to program in C? Search for programming tutorials.

Or how to program PWM on a PIC? Google for sample code, there is tons out there . . .

Offline 1sam3Topic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: programs
« Reply #2 on: April 02, 2008, 11:06:59 PM »
well i kind of know how to program on C but i wont consider myself any good, thats why i need to find someway to write a simple program down to control the satellite dish motors and by that control its movement/position. almost all the component are connected to My PIC18f420 microcontroller..

Offline michaelsane

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: programs
« Reply #3 on: April 03, 2008, 12:05:00 AM »
Take a look at this tutorial.  It should get you on the right path!
http://ulcape.org/wiki/Tutorial-PIC_Programming_Basics

Aside from the programming side of things you are still going to need an h-bridge to control the motor, and some sort of sensing device (pot or shaft encoder?) on the DC motor in order to determine its position.  If the reason you are using a stepper motor is for positioning I suggest you just use 2 DC motors with optical shaft encoders on them.  Steppers are much more difficult to drive from, and require a rather large voltage source compared to the rest of your electronics.  Also be sure you consult the data sheet about what oscillator to use, and anything else you may be curious about your particular PIC. 

Offline 1sam3Topic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: programs
« Reply #4 on: April 03, 2008, 12:18:38 AM »
thanks, but i already am gonna build a h-bridge and get an encoder for the dc motor i got. my first choice was to get 2 dc motors, but then my lecturer suggested i use a stepper motor for the tilt operation of the dish because its much more accurate..

 


Get Your Ad Here