Load cell and servo motor, control loop

Hello, I have been a long time lurker but have decided to sign up as I have a problem I am struggling to solve.

I am looking to develop a control loop between the readings from a load cell which in turn controls the position of a 180deg servo motor. In the project the servo is connected to a series of pulleys which directly influence the load that the loadcell senses and the aim is to define a target load which the servo will adjust accordingly and maintain the constant load.

Currently I have a calibrated load cell script using the HX711 library which outputs the measured load into the serial display and a servo motor connected to the Arduino Uno through a PCA9685 board using the Adafruit PWM library. Where I have been able to set the max and min PWM values and get the motor to rotate to a desired angle.

What i am hoping to get from this post is some guidance on combining the two scripts to create a control loop.

Any help would be much appreciated

Interesting project. I have a similar one in mind.
Hove is the load held? Does it move?

Railroader:
Interesting project. I have a similar one in mind.
Hove is the load held? Does it move?

The load cell is fixed in position. It is fixed similarly to how the simple online tutorials for creating a weighing scale using a load cell, with one one side supported on top and the other side on the bottom, creating the bending moment and therefore load. If that makes sense.

Do You have any first attempt, prototype or drawing You can post? My question was about the load, not the load cell. What kinds of dynamics are involved? Is the load moving or being moved?

Railroader:
Do You have any first attempt, prototype or drawing You can post? My question was about the load, not the load cell. What kinds of dynamics are involved? Is the load moving or being moved?

I'll figure how to post photos and i will upload one.

For now as a description the load is static with the source of the load being the tension of a string which runs across a pulley that is connected to the end of the load cell. As the tension increases the measured load will too as there are fixed guide pulleys either side of the sensing pulley.

The tension and therefore measured load will vary due to processing of the string downstream of the load cell which creates vibrations and changes in tension.

Fine. I think I'm with You.
The string and its near mechanics surely have some amount of elasticity. After any motor action You'll need to give the system some time to come to rest before measuring and taking new action.
Interesting...

Railroader:
Fine. I think I'm with You.
The string and its near mechanics surely have some amount of elasticity. After any motor action You'll need to give the system some time to come to rest before measuring and taking new action.
Interesting...

The elasticity of the string is considered as negligible currently

The aim is the allow the servo to control lower frequency changes in tension with a spring powered mechanical device being being to absorb high frequency changes in tension downstream of the loadcell.
Would it not be possible to continuously measure tension? I am aware the servo can only receive an input every 20ms with time needed for it to rotate to position.

Think like this: In the moment the motor/servo is ordered a small increase of the tension the load will face a short acceleration. During that acceleration the force measured by the load cell will be higher. Know Newtons law: Force = mass time acceleration. A short acceleration dependant force could be registered and would likely cause oscillations in the system.
That might be checked up. After and order to the motor, make measurements, print them but don't take any action upon them, not until the time for rest has passed.

Railroader:
Think like this: In the moment the motor/servo is ordered a small increase of the tension the load will face a short acceleration. During that acceleration the force measured by the load cell will be higher. Know Newtons law: Force = mass time acceleration. A short acceleration dependant force could be registered and would likely cause oscillations in the system.
That might be checked up. After and order to the motor, make measurements, print them but don't take any action upon them, not until the time for rest has passed.

Yes i understand you. Ideally the tension control will be as smooth as possible.
Do you have any guidance for the coding to make this a reality?

Good. Can You post a link to the servo data sheet?
I have no idea what that PWM library offers. No problem, let's wait with that.
How much of the hardware is running as You expect it to do?
Do You have any code You can post, using code tags, the symbol up to the very left in this window?

It's getting late here, approaching 1 AM and time for bed.....

A wiring diagram showing the powering would be nice to se. Pen and paper, and posting....

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.