Either polar 0 to 1000 or bipolar -1000 to 1000 works. You will find using Kp where the nominal load is for 0 reference error to height manually and it may never be 500 or 0 anyways so use either method.
Tuning:
Due to gravity, the acceleration vs motor speed torque/load in the vertical axis will be asymmetrical and nonlinear. You want to maximize damping but make the response as fast yet smooth as possible to a step start and stop response. The elasticity also changes with tension which may cause different resonant frequencies and will vary depending on the mass of the spool.
By slowly making PWM changes you avoid stimulating high frequency resonances. But if drag changes alot with spool size then optimal Kp may be dynamic.
Here's what GPT 3.5 recommends.
Choosing the optimum PID (Proportional-Integral-Derivative) controller parameters is a critical step in achieving effective and stable control in a system. The process of tuning PID parameters often involves a combination of theoretical analysis, simulation, and practical experimentation. Here's a general guideline for tuning PID parameters:
1. Start with Default Values:
- Begin with the default PID values. In many systems, a good starting point is often having all three gains (Kp, Ki, Kd) set to zero.
2. Proportional Gain (Kp):
- Purpose: Adjusts the response based on the current error.
- Tuning:
- Increase Kp until the system starts to oscillate.
- If the system becomes unstable, reduce Kp.
3. Integral Gain (Ki):
- Purpose: Eliminates steady-state error.
- Tuning:
- Increase Ki to reduce steady-state error.
- Be cautious, as too much Ki can lead to instability or overshooting.
4. Derivative Gain (Kd):
- Purpose: Reduces overshooting and improves stability.
- Tuning:
- Increase Kd to improve stability and reduce overshooting.
- Be cautious about too much Kd, which can lead to increased noise sensitivity.
5. Iterative Tuning:
- Start with Kp, then Ki, and finally Kd.
- Repeat the process: Adjust Kp, then Ki, and finally Kd. Continue iterating until the system performance meets the desired criteria.
6. Performance Criteria:
- Overshooting: Minimize overshooting without sacrificing settling time.
- Settling Time: Achieve a fast response without excessive oscillations.
- Steady-State Error: Minimize any remaining steady-state error.
7. Simulation and Analysis:
- Use simulation tools or models to analyze the system response under different PID parameters.
- Simulate disturbances and changes in setpoint to evaluate the controller's robustness.
8. Practical Experimentation:
- Implement the PID controller in the real system.
- Experiment with different parameter values while observing the system response.
9. Ziegler-Nichols Method (Optional):
- The Ziegler-Nichols method involves systematically increasing the gains until the system becomes oscillatory, and then adjusting the gains based on the observed oscillation characteristics.
10. Adaptive Control (Optional):
- For systems with varying dynamics, consider adaptive control techniques to adjust PID parameters dynamically.
Tips:
- Start Conservatively: Begin with conservative gains to avoid instability or excessive oscillations.
- Small Adjustments: Make small adjustments to PID gains to avoid abrupt changes in system behavior.
- Understand the System: Gain insights into the dynamics of the system to make informed decisions during tuning.
- Consider System Limits: Take into account any physical limitations or constraints in the system.
Remember that PID tuning is often an iterative process, and it may require a combination of theoretical understanding and practical experimentation to achieve the desired control performance. Additionally, each system is unique, so there is no one-size-fits-all approach to PID tuning.
1. Always start with your spec for height error which translates into tension error.
2. Then after calibration test it for extreme start stop speeds with full and end of spool loads. record limits of Kp,Ki , Kd for marginally unstable response then relax to allow margins for spool and motor fatigue from line variations or temperature/ humidity.
Then plot the results and get the reward of perfecting your control system under any disturbance you might expect, like a brownout or a power surge or tap change in the field.
From my experience , I would start with a low Kp and Kd only target position with 10% then enable Ki by changing these gain factors in real-time until PES (Position Error Signal in software in SW ) acquires lock without overshoot in the fastest time then , change to gains to optimize errors to "environmental disturbances" This is how we designed high speed servos for HDD's. We had an acceleration profile to max velocity up-flat-down then go into position error near the locked position mode by changing K factors depending on the position error. Then there was temperature compensation for motor torque variations in either direction. (Magnetic flaws )