gimmephone
Member
Hi All,
As a project at University, I am trying to control the speed of a DC motor with PID control. I have worked a bit with PLCs and I own a Micrologix1100 so I thought that I can easily demonstrate a PID based control using the PLC in place of Op-amps, resistors and capacitors. Now I seem to be stuck as the system I plan to control would be a digital one for which I need PID control. So here goes:
I bought a 24V DC motor 0.1 Amps so that it could directly be driven by the PLC's 24V FET outputs. I have mounted an optical encoder to the shaft that gives me 500CPR (clocks per revolution). I tested the output of the optical encoder and it is a 1V sine wave type so I need a tranistor to bump these up to 24V to feed into the PLC's inputs.
I am going to attach a set of switches to 5 inputs which will act as a 5-bit binary speed input. Now is the problem part.....since I want to control the speed based on the users input using a PID loop, I plan to use a timer with resets say every 0.1 seconds....in the meantime, a counter increments each time a clock edge is produced by the optical encoder and this too resets with the timer. So, now I know how many turns occured in 0.1 seconds and the speed can be adjusted based on this setup.
My question: How can I use a PID loop with this setup specially the optical encoder....aslo, the output from the PLC to the DC motor should be a PWM signal that varies the speed of the DC motor.
Any suggestions would be more than welcome!
Thanks
As a project at University, I am trying to control the speed of a DC motor with PID control. I have worked a bit with PLCs and I own a Micrologix1100 so I thought that I can easily demonstrate a PID based control using the PLC in place of Op-amps, resistors and capacitors. Now I seem to be stuck as the system I plan to control would be a digital one for which I need PID control. So here goes:
I bought a 24V DC motor 0.1 Amps so that it could directly be driven by the PLC's 24V FET outputs. I have mounted an optical encoder to the shaft that gives me 500CPR (clocks per revolution). I tested the output of the optical encoder and it is a 1V sine wave type so I need a tranistor to bump these up to 24V to feed into the PLC's inputs.
I am going to attach a set of switches to 5 inputs which will act as a 5-bit binary speed input. Now is the problem part.....since I want to control the speed based on the users input using a PID loop, I plan to use a timer with resets say every 0.1 seconds....in the meantime, a counter increments each time a clock edge is produced by the optical encoder and this too resets with the timer. So, now I know how many turns occured in 0.1 seconds and the speed can be adjusted based on this setup.
My question: How can I use a PID loop with this setup specially the optical encoder....aslo, the output from the PLC to the DC motor should be a PWM signal that varies the speed of the DC motor.
Any suggestions would be more than welcome!
Thanks