Hello,
I need help and guidance to finalize my project.
This is my list of hardware currently used:
1 RB-Phi-48 (PhidgetsEncoder HighSpeed USB Encoder) (item#1)
1 RB-Lyn-217 (Lynxmotion Quadrature Motor Encoder w/Cable) (item#2)
1 RB-Lyn-08 (Lynxmotion GHM-04 Gear Head Motor). (item#3)
1 RB-Phi-47 (PhidgetMotorControl LV) (item#4)
1 External power supply (9V DC, 200mA, 1.8VA).
1 PC for the controller software (done with Delphi for the testing purpose)
What I want to achieve: position the shaft of my motor with a very high precision (error range < 0.01%).
Without any load, the motor seems to start rotating at velocity=6 (or -6 counterclockwisely).
So the range -6,6] of velocity makes no difference to my motor. At velocity 100, the motor spins as fast as posible.
My system is already built, all hardware work, but I don’t know how to position my motor accurately.
Let’s set the current encoderPosition to 0. I want to control my motor to stop exactly at 100000.
I’ve written a simple code with Delphi to try to control the motor, and this is the logic:
Set acceleration to 100
Set velocity to 100 (so motor starts rotating)
When encoderPosition > 60000 (say it p0) set acceleration to 50 (say it a0)
When encoderPosition > 40000 (say it p1) set acceleration to 10 (say it a1)
When encoderPosition > 400 set (say it p2) acceleration to 0 (motor stops).
This method is very unreliable and difficult because:
I tried several passes but I keep getting non constant overshots (examples: 100 160, 100 035, 100 016 even 100 210 or luckily 100 000).
Must modify p0,p1,p2,a0 or a1 to TRY to stop the motor at 100 000 (motor without any charge and I think with a charge the result will be completely different).
Difficult to meet the error range condition (less than 0.01%)
For my project, as stated above, I want to have a very accurate positionning system (with error less than 10 steps for 100 000 steps).
And during the process, the motor must rotate only in one direction, no oscilation possible near the target position, speed down smoothly and stop at target position.
Questions:
Is this kind of project is possible with the hardware I use (error range < 0.01%).
Do I need to change my hardware ?
What is the method to have an accurate positioning system (without oscillation near target position) ?. I think that I must choose the PID method (am I wrong ?).I’ve read, googled many PID methods but honestly I really don’t understand how to adapt/implement it to my system. Worstly, I don’t even know how to start experimenting the PID method. Can someone kindly give me a step by step instruction how to implement the PID method if this method is suitable for my project. How to get all three constant Kp, Kd, and Ki of PID method easily (must meet the required condition (error range, ‘dead motor zone’ between -7 and 7 velocity, no oscilation…). Sorry for this long post but I really need help.
Thank you.
Hi guys,
currently I am doing a senior project on automatic control system for controlling the angle of a hydrofoil flap. We were originally recommended to use PID controller, but we later decided to go with the basics first with an Arduino duemilanove microcontroller with Hitec servo motor for control of flap angle. With feedback from servo motor, does this set up make it a proportional control system? If this is not, any recommendation on what we could do with what we have to make it proportional control system? We have a couple of weeks left before we present project, so we are not thinking about switching our parts and end up complicating our problem further by relearning everything. Any feedback on the above will be greatly appreciated.
Another related topic…
Currently, we have a Phidgets Multi-Turn Rotation Sensor
Product code : RB-Phi-24 from robotshop( robotshop.ca/phidgets-multiturn-rotation-sensor.html) coupled to the output shaft of the servomotor to feed analog signal back to our Arduino Duemilanove microcontroller. However, we can only get 100 steps per full revolution of the sensor (just a pot inside I’m assuming), which is not accurate enough for our application. Any idea if we can change the step value or any suggestion on what we could use for rotational output feedback?
Hi Jonathan,
thanks for the reply. That is exactly what we have figured out and we got a pot that is 1 turn. Currently we are using servo to drive the flap, and ultrasonic sensor to measure the height of the boat above the water, and this signal is fed back to the system to adjust the angle of flap, once we have a transfer function that relates height of boat with angle of flap at low speed. However, the existing problem with the PING sensor we have is that we know it’s not inherently waterproof, so we are also just wondering if there’s anything we can use to cover it without affecting the functionality of the PING device.
The Phidgets Multi-Turn Rotation Sensor outputs an analog voltage and using the Phidgets interface kit you can obtain 1000 steps (over 10 turns). The resolution of your reading depends on the ADC (Analog to Digital Converter) resolution. If you have an 8 bit ADC you can theoretically expect a maximum resolution of 256 steps from 0 to 5VDC, the full range of output.
You would therefore either require a more precise encoder sensor and/or higher ADC resolution if using a sensor that outputs an analog voltage.
If your flap has limited range of movement (180 degrees for example), using a potentiometer that is not multi-turn may provide better results as the 0-5VDC would be spread over less than 1 full turn, allowing you to get your full resolution where you need it. More information about your project would be required.
*]Some precisions on the accuracy you are trying to achieve:
If you can encode the position of your system form 0 to 100 000 then the minimum displacement you can read is 1/100 000 = 0.00001 or 0.001% of your measuring scale. Of course, achieving this precision will only be possible if that displacement is physically possible for your motor and if your control system allows for that kind of precision (this depends mainly on the scale you are using).
/*:m]
*]Control systems:
The control system field is a rather complex one but it is very rewarding and interesting. I suggest that before jumping into PID (Proportional Integral Derivative) control system you start with a Proportional controller.
A proportional controller works as follows:
[list=1] ]Suppose there is an error signal that we call e(t). This signal is simply the difference between your current position and the position you would like to attain. so if you are at position 50 and you want to get to position 500, e(t) = 450 at that precise time./:m] ]Suppose also there is a coefficient k that you can vary depending on the performance you are trying to obtain (this can be a bit obscure now but keep reading)./:m] ]Then you can define the input to your motors as being P(t) = k e(t). This means that the farther you are from your target the faster you make a motor spin for instance. And then, the power to the motor is gradually decreased in order to come to a full stop./:m] ]Also, the largest the value of k, the shorter the response time (see the picture below)./:m]
Keep in mind that this is just the surface of the control theory and there is much more to learn. I suggest you start by implementing a proportional controller. Should you be interested in getting the performance and precision benefits of a PID controller, I’ll be happy to write more about such systems.
I also invite the other users to enter their questions, comments and fears./*:m][/list:o]