CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PID CONTROL motor with encoder

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PID CONTROL motor with encoder
PostPosted: Thu May 02, 2019 11:53 am     Reply with quote

Hello there ;
I want to drive dc motor with encoder with PID control. What should I do.?
_________________
Es
gaugeguy



Joined: 05 Apr 2011
Posts: 288

View user's profile Send private message

PostPosted: Thu May 02, 2019 12:08 pm     Reply with quote

Start with some reading and studying.
I recommend googling "PID without a PhD" and reading that.
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Thu May 02, 2019 12:10 pm     Reply with quote

No sample code? how about how can I do.
_________________
Es
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Thu May 02, 2019 12:22 pm     Reply with quote

If you google what gaugeguy says, there is example code given in there...
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Thu May 02, 2019 12:25 pm     Reply with quote

ı wrote to google. but, no sample code.
_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 03, 2019 5:05 am     Reply with quote

To start...
Get the specs for the 'DC motor', which 'encoder' (512 CPR, 2048CPR ?), what kind of RPM range and control ? What type of motor 'interface' ? These days I assume most use an H-bridge though 25 years ago I used +-12 volt power supplies controlled by the then 'new' 16F877.
You'll need to define your hardware BEFORE looking at any code ! Code itself is maybe 100-150 lines with PC link.

Jay
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Fri May 03, 2019 5:15 am     Reply with quote

Type: 4230-sc (With Reducer)
power: 60W
Current: 4.5A
Assignment: 3000 (200) r / min
Voltage: 24V DC
Encoder TIpi 2 channel 100 slots

I want to a few ask questions .
Firstly, PID feature in the hardware of the processor should it be? Or is it added to the processor as a software?

how do I do the calculations in the formula.?

The software for PID control is very complex? I need to pay attention to what.
_________________
Es
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Fri May 03, 2019 9:43 am     Reply with quote

The MCU provides the hardware to read QEI and control h-bridges and whatnot.

But you will need to implement the controller with software.

The equations given in introductory controls texts are given as continuous time functions (like real life). However, when you implement them in your MCU you are going to have to convert them into discrete time functions.

This means you will need to have accurate timing, especially when you are updating the I and D parts of the controller because they are integrations and derivatives of the error between your current position and your set point with respect to time.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group