Pi + Servo + running of battery

Hi
I am trying to run a servo off a Raspberry Pi Zero W. The servo has to pull at least 10Kg but it also has to run off a battery as it needs to be moved around. Any idea on what HAT or HATS I will need to use, I will still need to be able to charge the battery. Any ideas? The Task is due very soon so need to work this out quick!!!

Thanks
Caleb

3 Likes

Hi Caleb,

That is a unique challenge you have there. Is there a reason it has to be a servo motor and not any DC motor?
Dragging 10kg will require a gearbox and reduction unless your servo is massive. You will probably also be best to connect your servo or motor via driver circuit as only the smallest, weakest DC motors can be run directly off the Pi Zero W.

There is no reason you shouldn’t be able to run this from a battery, the choice of battery will depend on what size motor/drivers you end up selecting and will probably be the last decision to make.

Can you provide more information? How far does the 10kg weight need to be moved? Does it need to be moved back, or only dragged in one direction?

3 Likes

Hi Caleb,

Welcome to the forum!!

I would take a look at this HAT here to control the servos:

As for power, I would split up the power supplies, a USB battery bank to power the Pi and either NiMH’s or LiPo’s for the servo’s.

Now it’s down to servo selection! Something high power is definitely on the cards here or a smaller one paired with a gearbox to achieve the forces required.

Liam.

2 Likes

@Trent
It has to be a servo as it has to be quick and strong I do have a servo strong enough but it’s not getting enough voltage to pull the cable with the voltage we were using through servo testers and RC receivers (most run at 5V). I am looking at using a 3S 2500mAh LiPo battery this provides about 11V but just not sure how to get this to the servo without frying the Pi. It is pulling the cable to drive the derailleur of a bike. and it only moves 20 mm from bottom gear to top gear and then the spring in the derailleur will pull it back the other way.
@Liam
I have looked at that but have previously been told I need a UPS HAT not sure what I need now? As stated before I am looking at a LiPo Battery to run the whole lot as it needs to be compact. The servo I have should be good enough just not sure if you would recommend something else.

Thanks for your Help
Caleb

1 Like

Hi Celeb
I think the RPi and the servo supplies should be separate. The RPi supply can be 3V3 or 5V whichever you need and the servo power supply can be whatever is required to drive the servo. Just make sure you connect the grounds (-ve) together. The servo connections should be Ground, Control pulse from RPi and Servo power which is separate from RPi power.
Cheers Bob

3 Likes

Can you provide any details of the servo, especially the activation current.
Seems like it could be quite high.

There are no RPi HATS that would be suitable for high current purposes and operate of more than 3V3 or 5V. You most likely will need a separate driver circuit that triggers from the RPi GPIO and connects a higher voltage and current to the servo. Similar to what Robert has mentioned. This could be through a Mosfet. (see below)

Cheers
Jim

PS Recommend the Gravity: MOSFET Power Controller as it has optical isolation. The article mentions Arduino but the signal input is simply on/off so RPi GPIO would work ok.

2 Likes

@Robert93820 Thanks for the insight :grinning:
@James46717 The servo is a “TrackStar TS-411MG Digital 1/10 Scale Short Course Steering Servo 25T 11.2kg / 0.09sec / 57g” from Hobby king Link Here
Not sure what Information you’re after exactly. Thanks for the information I will look into them have a lot of facts to consider and have a lot of work to do. really clearing up what I need to do.

Another random question got any links to how to code RPi Zeros to send raw Information to a RPi 4?

Thanks, Caleb

1 Like

You don’t need a Mosfet. As I stated above the servo power can and usually is quite separate from the control signal. This control signal is a series of pulses between 1msec and 2msec wide and repetition rate about 20msec. Usually about 5V I think. The servo power is whatever the servo requires. In this case 4.8V to 6V. The 11.2kg is the torque. 11.2kg/cm that is 11.2kg at 1cm from the shaft centre, as you move out this actual force will decrease in proportion, at 2cm the force will be 5.6kg and so on. The 0.09sec is the time taken to rotate 60º. All at 6V supply. An Arduino or RPi should be capable of driving the servo with control pulses directly although you may need a level shifter for 3.3V pulses.

If you want to physically move 10kg I don’t think this servo will be big enough. How far do you want to move it? How fast? You you want to return it to original position? Lots of unknowns here.
Cheers Bob

3 Likes

@Robert93820
Wow, great job I can understand the information much better now thanks so much?
I need to pull a cable that 20 mm and the faster it moves the better as it will be more precise. it is only pulling the force in one direction as the spring (why there is so much force) will pull it back the other way. In the 20 mm that it travels it will stop at 8 different spots. The servo is replacing the shifter on a Pushbike. Hope that clears things up.

Caleb

That is a lot clearer. 20mm is not far and would only require a short lever on the shaft but I do still think this servo will be a bit light for this job. Also remember the operation will not be linear as the servo will operate in a circular motion. In the middle of its travel the gear operating cable will be moving fastest and the amount of travel per rotational angle will be smallest at the ends.
Another option which may suit better may be a stepper which is easily reversible and able to be positioned winding this operating cable onto the shaft or a small drum. The spring would pull the cable off the drum when the stepper reversed. You would also more easily calculate how many steps are required to position the cable at each of the 8 positions as the operation would be far more linear.
Or attach the cable to a small robust linear actuator which can come complete with motor.
Cheers Bob
Maybe something like this.

2 Likes

Thanks for providing the link Caleb, much easier to provide advice when the device in question is known. I agree with what Robert has stated; sorry if I may have caused any confusion.

Ahh yes; servos operate via pulses; thanks Robert; I was confusing servos with solenoids. Must be my old age getting to me, LOL.

8 positions over 20mm equates to 2.5mm per position, this is fairly small. If you intend to pull the cable with the device; Roberts suggestion of a Stepper of Linear actuator would be the better than the Servo you have linked. Keep in mind Stepper motors require current to maintain their position, this would be a constant drain on the battery, even while not moving. But I can see a design where this would work, using the right size drum on the Stepper to wind the cable, combined with the number of steps; would allow 2.5mm fairly accurately. Steppers can be configured to micro step. It would just be a matter of working out the figures to get it right.

I have used this device to successfully drive a number of different Stepper motors.

This is one of the Steppers I have used, it is quite large but fairly powerful.

You also asked about getting a RPi Zero to talk to a RPi 4.
I would look at using the serial ports both devices have and send the data using a serial TX RX function. I have used a similar process to communicate between a RPi Zero and Arduino.

Regards
Jim

2 Likes

What is the rotation angle of that servo? Speed is quoted over 60 degrees, but the comments imply it is 180.

If it operates through 180 degrees then for a total travel of 20mm that would indicate that the pulley radius should be about 15mm (you will use a pulley and wire so that you can use the full range of movement, to minimize the pulley diameter and get maximum torque.) . So that torque rating is not quite enough. If the rotation angle is only 60 deg then that is worse.

A stepper will allow you to use whatever rotation angle you want, so that you can increase the angle to use a smaller pulley to get more torque. Increasing the rotation angle will reduce the speed, but whether or not that will be a problem depends on the stepper.

The other advantage of a stepper is that you can use that higher batttery voltage - the battery you mention has a voltage that is too high for that servo.(11v vs 6v). The disadvantage of a stepper is that you need a driver module, but there are several very good small drivers available.

1 Like

Hi Jeff
From what I have seen published servo speed seems to be normally stated over 60º even the servo may be 180º or 270º.
Cheers Bob

2 Likes

Hi,
The first thing that comes to mind for me is a Sail Winch Servo like Hitec Winch Servo but, as others have suggested, you may be under estimating the torque and holding power of the servo required. My other suggestion would be a High Voltage Retract Servo like High Voltage Retract Servo or some other HV servo that accepts up to 8.4v. You could then run a buck converter to power the Pi from the same 2s LiPo.

Cheers,
Russ

1 Like

I did some rough calculations on a pulley size for the Servo.
Ignoring the arc the rotation would move through I used trigonometry to calculate the radius of the pulley. All servo software I have used move related to an integer degree, I not found any that move by a fraction of a degree.

From Trigonometry
Sin degree = Opposite / Hypotenuse. (right angle triangle)
image
If we move the servo 1 degree for each position, angle = 1 / 2 = 0.5:
Sin 0.5 degrees = 1.25 / Raduis
0.0087 = 1.25 / Radius
Therefore Radius = 1.25 / 0.0087 = 14.367 cm (rather large)

If we move the servo 5 degrees for each position, angle = 5 / 2 = 2.5:
Sin 2.5 degrees = 1.25 / Raduis
0.0436 = 1.25 / Radius
Therefore Radius = 1.25 / 0.0436 = 2.867 cm (a more reasonable size)

Actual pulleys available is an entirely different matter.
The same calculations could apply to using a Stepper Motor, degerming the step angle first.

Maybe my maths is off, happy to be corrected.
Don’t know if this helps any.

Regards
Jim

2 Likes

@Robert93820 The movement not being liner is not a problem as I have already worked out the angle travelled to get the required distance (doing extension mathematics). Like the stepper motor idea but the linear actuator will be too slow, whatever I do the quicker the movement the better (hence why I went for a servo).
@James46717 Sadly each step is slightly different (I will attach an image below). The constant drain will be the downfall of the stepper motor then so thanks for telling me that. Thanks for the links as well really helpful. I am looking at getting them to communicate wirelessly want as few cables as possible. Is there a certain name that I need to connect through or some sort of IP address? I will probably create another post of this.

Thanks for the calculations will sit down and check them later but your working out looks pretty Spot On.
@Jeff105671 I am pretty sure the operation angle is 60-90 degrees it doesn’t do 180 degrees, but I’m not sure what it quotes off. I will look into the stepper motors and understand the Torque speed equation quite well not the first time it has come up in the last 3 months.
@Russell143137 Thanks will look into those.

|219.75280898876406x292.4317665435564

|434.34018691588784x241.34105960264907

Thanks
Caleb

2 Likes

Communication wirelessly, good idea. One device could need to be setup as a WiFi hotspot, probably the RPi 4. Then the RPi Zero could connect to it. OR you could opt for Bluetooth connection between both devices.
I have successfully setup a RPi Zero on a Robot Cart a a WiFi Hotspot, running a web server. A Tablet of Phone connects to the web page to send commands to the RPi Zero. Have NOT connected two RPi’s via WiFi, but theoretically it should work. Web page may not be an option in you case.

The only Bluetooth I have done is two micro:Bits, the library was already developed by someone else. Unsure what is available via Bluetooth for the RPi, but should be doable as they are basically Linux devices.

BTW I have found the micro:Bits to be the easiest to setup, communicating with each other via the built in Radio functions.

Anyway, all the best.
Jim

PS Thanks for the pics of the cable travel, easy to see what needs to be done and that it is not linear.

2 Likes

Hi Caleb,

If you’re looking for an easy way to write code that interfaces with a web interface, Flask is a great choice

We’ve got a great guide on Flask if you’re interested :slight_smile:

Keen to see this project progress!
-James

1 Like