Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | Position Control using PWM

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Position Control using PWM - msel...@gmail.com - Jun 25 17:43:18 2008

Basically, has anyone ever tried to use PWM for position control on the PIC?

I am trying to program a PIC18F458 for position control using a quadrature encoder which has 1600 "states" per revolution.

What i am have working so far is i give the PIC a reference position(in encoder counts) that i want a motor driven to. I then have an algorithm that generates a smooth accelerate, cruise, decelerate trajectory which i want to feed to a PID function that will set the correct PWM duty cycle. I know the trajectory generator is working because i have tested its output and the trajectory it lays out looks fine.

My issue is setting PWM duty cycle. I dont know exactly what value to set it at or if i need any sort of conversion between position error and duty %. do i directly set the duty cycle to the error between actual and desired position? I have just tried everything i can think of and nothing is working.

any help will be greatly appreciated

thanks

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )