06-01-2009 10:19 AM
Hi,
I'm currently working on a project to control a brushed 230V servo motor using cRIO. The motor drives a linear stage and the final project requires to create a position control of the motor where the user is able to enter a speed, position and control the stage to move to that position.
I'm using an H-Bridge circuit to drive the motor and using NI-9401 and a PWM output to move the motor. I also have a quadrature encoder connected to a NI-9403 to read the position and velocity. I'm using the example encoder program for the NI-9505 in my application.
There are no voltage or current sensors on the drive circuit therefore I wouldn't be able to have a current closed loop in this case. The stage gear mechanism is such that the position gets locked if the motor is not moving and I do not need a torque control to keep the motor in place.
In order to acheive this, would I simply be able to use a single PID VI (probably the FPGA express VI for discrete PID)?
I'm not very well versed in control theory and therefore any guidance in the right direction would help me a lot.
Many thanks! ![]()
Solved! Go to Solution.
06-01-2009 01:42 PM
Hi
Have you seen the example named "Quadrature Decoder with Position & Velocity - NI 9505.lvproj"? I am not sure if it will help you with your control scheme but i noticed several examples in the NI Example Finder that are for the 9505 ==> chances are that they have a similar example that better suits your needs.
Good luck,
Mike
06-02-2009 02:01 AM
Dear Mike,
Thank you very much for your email.
Let me try to explain more on my current progress and how I've tested the system so far.
I've already used the Quadrature Decoder example program to get the velocity input in RPM and also have developed the PWM code to send the pulses to the H-bridge circuit. At the moment, I'm able to manually control the PWM duty cycle and make the motor move to a certain position.
In my final application however, there would be changing loads on the stage, so I'm thinking I would need a control loop in order to maintain the velocity at a constant value.
So what I have now is, one input (which is the velocity from the quadrature encoder) and I have to send an output PWM to the motor to get a constant velocity which will adapt according to the various loads present.
From all the examples I've seen so far, there is always a current sense from the drives and there are two control loops; one for position/velocity and another for current. In my case, since there's no current sensor I'm thinking of using a single PID loop to acheive a velocity control.
Is this theoretically possible to do? Or would I definitely need a current sensor for a feedback?
Many thanks ![]()
Sanka
06-17-2009 03:41 AM
Sanka,
in general it's better to use a cascaded control loop structure but in principle you also should be able to use the output of the position control loop as an input for the PWM generator. The main disadvantage of this setup is the missing current limiting. Without current sense the only way to protect your motor from drawing too much current is either to limit the maximum output current of your power supply or to limit the maximum PWM duty cycle. Without current feedback the latter method is quite inaccurate, but better than nothing.
I agree with Mike, that you should look into the examples of the 9505 module and use the position controller vi of these examples. This PID controller is optimized for motion control applications and it is implemented in fixed point arithmetic, providing best performance on and FPGA.
Kind regards,
Jochen Klier
National Instruments
06-26-2009 01:40 AM
06-26-2009
02:08 AM
- last edited on
05-13-2025
05:57 PM
by
Content Cleaner
Hi sufian,
as this question doesn't belong to this thread it would have been much better if you had started a new thread, but anyway.
The USB-6008 doesn't provide an appropriate input for quadrature encoder signals. The digital inputs can only be read in a software timed manner. This is way too slow and it's not a secure way to read quadrature encoder signals. On the other hand the counter would be fast enough but it doesn't support up/down counting, so this is also not an option.
The lowest cost device for USB that supports quadrature encoder inputs is the USB-6210.
Kind regards,
Jochen Klier
National Instruments
06-26-2009 02:15 AM
Thnx Jochen
It means i can read encoder with with digital input channel using software time??
06-26-2009 03:04 AM
No, don't even think about that. Even at quite low velocities with software timing you will definitely miss a lot of signal transitions and your result will be a bad guess rather than a real measurement.
Jochen
07-05-2009 06:46 AM
Thanks Jochen for your reply ![]()
I ended up using the cascaded controller method. I modified one of the 9505 examples as Mike said to acheive this. The results got the job done! Thanks for your advice.
I'm now looking into a method for performing better control using NI Softmotion module. Currently I'm investigating the possibilities of using Softmotion for this setup.
I will have more questions once I start work on it.
Thanks!
Sanka
07-06-2009 01:47 AM
Sanka,
good to hear, that you have been successful. I'll be happy to help you out with questions related to NI SoftMotion.
Regards,
Jochen