LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Fri Sep 22, 2017 8:41 am

Hey All,
I am new to Raspberry Pi, and I am wondering if it is possible to connect more than 5V to a ground pin? I am working on an RC hobby car and will be controlling my servos and motors through the Pi 3. I will have another power supply of a 7.4V LiPo battery to power my servos and my Pi, but I was wondering if I could ground my servos onto the board at 7.4V or if I would have to limit my servos to a 5V power supply?

Thanks in advance :D ,
Lucas
Just a High School Student from Australia doing some fun stuff :) .

gordon77
Posts: 5077
Joined: Sun Aug 05, 2012 3:12 pm

Re: Is it possible to connect more than 5V to ground?

Fri Sep 22, 2017 9:36 am

You can't connect any voltage to ground! I assume you mean you want to connect two grounds from different devices together.
Do you have a circuit diagram?

User avatar
davidcoton
Posts: 5084
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Is it possible to connect more than 5V to ground?

Fri Sep 22, 2017 9:40 am

Treat your system as several different subsystems, running withn different supply voltages.

The grounds of every subsystem (usually) can/should/must be connected, else they won't talk to each other. Remember a wired connection requires a circuit -- signal and ground.

The tricky bit is ensuring that the signals between subsystems are at a voltage that is both safe and effective on both sides -- your Pi GPIO pins are designed to work at 3.3V, if you connect them to 5V or more your Pi will have serious problems. That said, it is very common for a subsystem running at a higher voltage to be designed for lower voltage signals.
Signature retired

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground?

Mon Oct 16, 2017 10:27 am

So are you guys saying that I can only have a max of 3.3V being supplied to my servos? I've read elsewhere that 5V is the max that can be used via the Pi, is this not the case? What my question is though is if I can have an external power supply of 7.4V directly powering my servos and then grounding then to the Pi.

Sorry I am not confident at all with circuits (and thus why I don't have a circuit diagram, sorry Gordon), but I was planning on running my servos at a 7.4V (directly from battery) in order to get the best effectiveness out of how my servos perform whilst on track and then grounding that to the Pi. And then I'd be using GPIO pins to formulate pwm signals to send to my servos (based off the joystick position of my PS4 controller that I'm using to control my vehicle).

Davidcoton, are you saying that the GPIO pins run off the power supplied through the servos I will be using. Is that what you mean by the phrase:
The tricky bit is ensuring that the signals between subsystems are at a voltage that is both safe and effective on both sides -- your Pi GPIO pins are designed to work at 3.3V, if you connect them to 5V or more your Pi will have serious problems
?
You can't connect any voltage to ground! I assume you mean you want to connect two grounds from different devices together.
I thought that you had to connect the voltage to ground otherwise it would be an incomplete circuit (although my circuitry knowledge is bad so I could be wrong)? And yes I want to be able to connect both my servos to the same ground but I am unsure if having the servos powered at 7.4V and grounding that to the Pi will damage the Pi, will it?
Just a High School Student from Australia doing some fun stuff :) .

gordon77
Posts: 5077
Joined: Sun Aug 05, 2012 3:12 pm

Re: Is it possible to connect more than 5V to ground?

Mon Oct 16, 2017 11:40 am

You can power your servos with whatever you need but you will need to interface to the pi gpio which can only work with 3.3v. You need to interface with relays, transistors, optoisolators, mosfets etc.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13142
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Is it possible to connect more than 5V to ground?

Mon Oct 16, 2017 12:18 pm

LucasStep02 wrote:
Mon Oct 16, 2017 10:27 am
You can't connect any voltage to ground! I assume you mean you want to connect two grounds from different devices together.
I thought that you had to connect the voltage to ground otherwise it would be an incomplete circuit (although my circuitry knowledge is bad so I could be wrong)?
Connecting any voltage to ground is called shorting the voltage to ground, and the resulting current flow might let the magic smoke out... :mrgreen:

And yes, you always need to close the loop, as currents always run in a loop (electrons cannot just appear or disappear, except perhaps in a quantum mechanical sense, but not in this context), but you close the loop by connecting the ground points of the circuits together.

User avatar
davidcoton
Posts: 5084
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Mon Oct 16, 2017 6:17 pm

davidcoton wrote: The tricky bit is ensuring that the signals between subsystems are at a voltage that is both safe and effective on both sides -- your Pi GPIO pins are designed to work at 3.3V, if you connect them to 5V or more your Pi will have serious problems. That said, it is very common for a subsystem running at a higher voltage to be designed for lower voltage signals.
A control wire going to a servo system can reflect back the supply voltage of that servo. If that is more than 3V3 (which it often will be), then there must be an interface circuit between the Pi GPIO and the servo control. This can be a transistor, a MOSFET, or an opto-isolator. Many servo/relay boards have this built in, but in some cases you have to take secial actions (remove a link and connect two different supply voltages to different parts of the board) to keep the Pi safe.

BTW, if the two subsystems are connected by an opto-isolator, they do not have to share a ground connection.
Signature retired

timrowledge
Posts: 1348
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Mon Oct 16, 2017 6:51 pm

Servo *power* and servo *signal* are two different things. Typically in a large model plane for example you might find the servo power leads connected to a 7.4v li-po but the control signals from the receiver might be anything from 4-7v depending on the exact type. So you'd (very simplistically) have a ground with all the servos and rx grounds connected, a power rail with all the servo +ve leads connected, a regulator to take the 7.4v down to whatever the rx wants (often 5v) and signals from the rx to each servo. It can get much more sophisticated too, with SBUS or fibre-optic connections and so on.

The best way to run several servos from a Pi is via a suitable HAT - the adafruit one here (https://www.adafruit.com/product/2327) is a good example, with documentation. It's a cheap way to protect your pi and your sanity.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Tue Oct 17, 2017 9:28 am

you always need to close the loop, as currents always run in a loop (electrons cannot just appear or disappear, except perhaps in a quantum mechanical sense, but not in this context), but you close the loop by connecting the ground points of the circuits together.
I knew you had to ground the devices you are using but was always just assuming it was for the voltage current to flow back through to the original source of power (battery for most cases). Thanks for the clarification :) .
there must be an interface circuit between the Pi GPIO and the servo control. This can be a transistor, a MOSFET, or an opto-isolator
After a quick Google search I (assume I) found that these devices act like a resistor that dampens the voltage to a level at which the signals can act safely. Is this the case? How simple are these devices to put into action (within the coding and the circuitry)? And/or is there a simpler option that requires less wiring and circuitry and how effective is this?

BTW on this, I am happy to learn as much as I need/want to for the coding of components but would like to keep the circuitry to a minimum as I have very limited resources for wiring components.
The best way to run several servos from a Pi is via a suitable HAT - the adafruit one here (https://www.adafruit.com/product/2327) is a good example, with documentation. It's a cheap way to protect your pi and your sanity.
This option doesn't look that viable for me as I would like to be able to use more than 3.3-5V on my servos because the more voltage I lose on my servos, the more power that gets taken away. Is it possible to still run the battery's power to the servos and then use the HAT's though? This would make the option very appealing to me if this was possible as I'd be able to not lose the voltage but be able to communicate a lot easier.

Also with this HAT option, is it possible to run motors and other devices (such as LED's and accelerometers and lux sensors) from the board?
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Tue Oct 17, 2017 11:12 am

What are you using your servos for?
Typical R/C cars use 1 servo for steering and 1 for speed (but mostly these are replaced by Electronic Speed Controllers [ESC] these days).
Most servos are rated at 4.8-6V and supplying them with more voltage is usually not necessary and will just fry them, or reduce their life. You can get some pretty torquey servos at 5V these days,despite their small size.
In the R/C world, the motor batteries (7.2V for NiCds and 7.4V for Lipos) are usually reduced to 5V to power the receiver and servos using a Battery Elimination Circuit [BEC]. Sometimes just a couple of power diodes are used to drop the voltage, but this suffers from undervoltage as the batteries reduce their voltage, whereas a BEC will keep a more stable supply for longer and would be preferable. Previously, the radio and servos were powered by a separate 5-6V battery pack (e.g. 4xAA batteries), but often these were removed for weight reasons (especially if you were using them for competition).
My suggestion is to use a proper servo hat to ensure you supply your servos with the correct voltage and to level shift the GPIO pin voltages to the correct values for control.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: RC Hobby Comp Car - Servos and ESC

Tue Oct 17, 2017 12:17 pm

Most servos are rated at 4.8-6V and supplying them with more voltage is usually not necessary and will just fry them, or reduce their life. You can get some pretty torquey servos at 5V these days,despite their small size.
Currently I am using the savox servos sw1210sg (here is the link to the website with specs http://www.savoxusa.com/Savox_SW1210SG_ ... 1210sg.htm) and they have an operating voltage of 4.8V to 7.4V. I would prefer to have my supplied voltage at least 6V but am happy to go to 4.8V if I need to.
What are you using your servos for?
I am using two servos in order to have both front and rear wheel steer to give me the smallest turning circle possible. The comp I am in is not your typical speed buggy comp, it is more of a slow controlled cross-terrain obstacle course that we have to navigate with precision over speed. With your suggestion of using a HAT, can I connect other devices (such as LED's, an accelerometer and a lux sensor) onto the board and control them?

Although I will also be using an ESC to control my DC motors and that's another issue I was going to ask about in my next reply to this topic. Is it even possible to connect (and use effectively) an ESC to the Raspberry Pi using Python 3? So far I've found how to initialise an ESC on multiple webs but am yet to find how to get an ESC to work. I am currently looking at these webs (https://solenerotech1.wordpress.com/201 ... pberry-pi/ and http://www.instructables.com/id/Driving ... pberry-Pi/] as these have been the most helpful (especially the Instructables web but I've only just found this one this week).

BTW, here is a schematic (a pretty average one, but that's all the company has given): http://docs.axialracing.com/instruction ... _Brake.pdf
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Tue Oct 17, 2017 1:21 pm

LucasStep02 wrote:can I connect other devices (such as LED's, an accelerometer and a lux sensor) onto the board and control them?
It depends on the HAT - check their specs.
Some are controlled over I2C so they only use 2 GPIOs, leaving the other GPIOs free to do with what you want. Of course, LEDs could be controlled by the servo outputs if you want to "bling it up" with fading up or down!
These hats control the PWM signal in hardware so they may be more precise.
Where the controller requires the Pi to generate the PWM signal itself, you should look to using a hardware / DMA approach. Both links you provided link to libraries to do that for you, and python source code, so you should have all you need from there.
The servo hats I looked at did not provide level shifting and relied on the servo accepting a 3.3V pwm signal, so check your servos and ESC can also accept such a signal level.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574


LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Wed Oct 18, 2017 8:24 am

This option doesn't look that viable for me as I would like to be able to use more than 3.3-5V on my servos because the more voltage I lose on my servos, the more power that gets taken away. Is it possible to still run the battery's power to the servos and then use the HAT's though? This would make the option very appealing to me if this was possible as I'd be able to not lose the voltage but be able to communicate a lot easier. Also with this HAT option, is it possible to run motors and other devices (such as LED's and accelerometers and lux sensors) from the board?
Dismiss this statement, I have had the opportunity to look at the Adafruit servo HAT more properly after school today and it looks perfect for what I would like it for! Thanks for your suggestions guys!

Just a question and it might be silly but I honestly don't know any better. Could this HAT potentially control DC motors as well through the PWM signals? I know that the motors run off PWM signals (this is how you get varying speeds rather than just off and on) so is it possible? This would completely eradicate the need for an ESC and make my whole life right now a lot easier
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Wed Oct 18, 2017 11:28 am

No.
There are 2 separate concerns that you need to consider:
1) the control signal
2) the power requirements.

The servo hat is managing the timing and accuracy of the PWM control signal, which is required for both servos and the ESC. It is relieving the RPi of the real-time aspects of generating this signal. The RPi can be used to generate this signal directly through various libraries using DMA approaches if necessary, but it would not be as accurate. Nevertheless, this control signal, whether it comes from the HAT or the RPi GPIO pins, is a low level control signal that cannot drive anything of any power.

The Servo and the ESC are essentially doing the same thing. They are using the control signal to vary a higher current power source to drive something more powerful. In the case of the servo, its internal dc motor is relatively small and consumes in the order of 1A maybe, whereas the ESC can handle 20-30A or more. So you cannot eliminate the ESC. You could replace it with a H-Bridge motor controller, or another servo that wipes an arm across a high power variable resistor like we did before ESCs came along, but you will always need something to amplify the small PWM control signal into a high current signal. The RPi or servo HAT are not capable of providing such high currents directly.


The servo hat is converting a control command from the RPI into a continuous PWM signal to adjust the position of the servo using the signal wire. It is relieving the RPi of generating a real-time accurate signal. It is supplying power to the servo through the 5V/Gnd wires, but this is not much in comparison to what your main DC motor requires. The signal and the power lines are separate and combined in the servo to drive its motor.

The ESC is combining the small, low-power, PWM control signal with the high power capability of your 7.4V Lipos to generate a 7.4V High current/power signal. it is performing the same job as the servo, just in a more powerful way.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Thu Oct 19, 2017 12:38 am

That is good to know, but then how do you control an ESC with the Pi using Python coding? This is something that I have been looking into for a number of weeks but cannot find an answer to. Some forums like this one talk about it but then either it is left unfinished as they could not find the answer or they find the answer but don't then put up a final post with how they solved the problems. Can anyone please help?
Just a High School Student from Australia doing some fun stuff :) .

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Thu Oct 19, 2017 12:36 pm

Also with the Adafruit HAT for servos (link above), I am running into some problems finding out some info the HAT needs from my servos. So basically I need to know the frequency of the servos (in Hz) but I cannot find it. Can I just assume it runs off the standard 50Hz like most servos?

Also, here is what is on the description for the HAT and the tutorial stuff:
If you need to calculate pulse-width in microseconds, you can do that by first figuring out how long each cycle is. That would be 1/freq where freq is the PWM frequency you set above. For 1000 Hz, that would be 1 millisecond. Then divide by 4096 to get the time per tick, eg 1 millisecond / 4096 = ~0.25 microseconds. If you want a pulse that is 10 microseconds long, divide the time by time-per-tick (10us / 0.25 us = 40) then turn on at tick 0 and turn off at tick 40.
What is a tick and why does it equal 4096? And is this the case for all servos?

And with the technical specs I have for the servos I am using (link here: http://www.savoxusa.com/Savox_SW1210SG_ ... 1210sg.htm ) it has the pulse signals in terms of usec (microseconds). So how do I get from this to what I need? And how do I implement these values, or are they the tick values that I need to use?

Sorry if these questions are silly, I am just trying to understand what I am reading and how I will need to code my servos.
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Thu Oct 19, 2017 8:27 pm

You have everything you need in those links, but perhaps you just need a bit of help understanding what they mean.

So firstly what is a Pulse Width Modulated signal?
It is a signal of a fixed frequency with a variable mark-space ratio. i.e. as the size of the pulse (the mark) increases in width, the gap between pulses (the space) reduces in width to compensate, so the the length of the mark plus the space is a constant. This constant value is the cycle time.
In the following figure, the cycle time is 20. It starts off with a pulse width of 5 that changes to 9

Code: Select all

    +----+              +----+              +--------+          +--------+         
    | 5  |     15       | 5  |     15       |    9   |    11    |   9    |         
----+    +--------------+    +--------------+        +----------+        +-----
    |         20        |         20        |            20     |
   
The servo HAT generates this waveform for you. You just need to initialise the cycle time (e.g. 20) and set the width of the pulse whenever you want to change it.
It is the size of the pulse that determines the position of the servo, or the speed of the Electronic Speed Controller.

So how would the servo HAT generate this waveform?
One way is with a clock generator, a 12-bit binary counter and 2x 12-bit comparators.
The clock generator creates a square wave at a set frequency. Each tick of this clock will increment the binary counter. The counter will count from 0 to 4095 (4096 steps) and then rollover to 0 again. Each comparator is set to different 12-bit values and monitor the binary counter output. When the counter equals the first comparator (on), the output of the HAT goes high. When the counter equals the second comparator value (off) the HAT output goes low.

So setting the clock generator rate determines the tick time. The tick time multiplied by 4096 is the cycle period, since it will take 4096 ticks of the clock for the counter to wrap around. The frequency is 1/(cycle period).
The pulse width is (off-on)*tick time.
The tick time is a feature of the design of the servo HAT as it has a 12 bit counter. Other designs may have more or less ticks per cycle, which affects the resolution of the time that you can set. The more ticks per cycle, the more accurate you can set the pulse time.

The library is designed so that you need to set the cycle frequency(Hz) and the on and off tick times, probably because these make nice integer value ranges.

Most servos will operate at 50Hz, so the cycle period is 20ms. So hopefully you can see now why the tick time is 20ms/4096 = 4.88us.

Your servo spec sheet says that the middle position of the servo is 1500us. At 50Hz, that is 1500us/4.88us = 307 ticks.
So to set the middle position you set ON=0, OFF=307 when you call the library function to set the pwm width. The HAT will repeat that waveform until you set it to something else.

If you set a different pwm frequency you will need to adjust the on/off tick numbers accordingly to set the same pulse width.

The above is all theoretical from my point of view as I don't have a servo HAT to try this out, but hopefully it will help in your understanding.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Sat Oct 21, 2017 2:16 am

Yes! Thanks so much! That just explained things so well in a way that I could understand, thanks!

So, from what you have helped with, I have come up with this code:

Code: Select all

import RPi.GPIO as GPIO
import pygame
pygame.init()
from time import sleep

GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)

pwm=PWM(0x40)
pwm.setPWMFreq(50)

servoFront=0
servoRear=1

pwm.setPWM(servoFront, 0, 307)
pwm.setPWM(servoRear, 0, 307)

tickTime=5/1024

pygame.joystick.init
sleep(3)

while 1:
    pulseLength=(pygame.joystick.Joystick.get_axis + 3)*500
    tickValue=pulseLength/tickTime
    pwm.setPWM(ServoFront, 0, tickTime)
    pwm.setPWM(servoRear, 0, tickTime)
    
else:
    pygame.quit()
    GPIO.cleanup()
Would this work (theoretically, as I am getting my HAT in a few days but just want to make sure I won't damage anything with faulty code)? And I have a question that you guys may or may not be able to answer, why in the function "setPWM(channel, on, off)" does on equal 0 but off is the value that changes? The way that I am thinking about it is that the waveform of PWM signals, shouldn't the high be where the values change and the low (off in the function) be 0?
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Sat Oct 21, 2017 6:52 am

Read the servo specs to find the min and max values for the pulse length. Hint: the min is not zero. So scale the joystick values so centre position = 1500us or 307 ticks. Min joystick= min servo pulse, max joystick= max servo pulse length.

Don't normalise your equations. 5/1024 is the same as 20/4096. But the latter describes what it means better.

The on/off values are the values of the counter when you want the signal to change to on or off. Refer to the diagram. The counter starts at 0 at the start of each 20 tick period so that's when we turn it on. When the counter reaches 5 we want the signal to be off. The length is the off time minus the on time.

You could set on=10 off=15. The pulse length is still 5 but it will be shifted to the right by 10 ticks. Setting on=0 just makes it easy because off=pulse length.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Sat Oct 21, 2017 11:44 pm

Read the servo specs to find the min and max values for the pulse length. Hint: the min is not zero. So scale the joystick values so centre position = 1500us or 307 ticks. Min joystick= min servo pulse, max joystick= max servo pulse length.
The reason I have the pulseLength equation the way it is is because the joystick values come back in a range from - 1 to 1. So I've added 3 in order to get positive values (for when it is multiplied, I'll get positive values back). I then multiply the joystick value (+3) by 500 in order to get the pulse length I want from 1000-2000 (being full left to full right). I then use that value I get and input it into the other equations to get the tick value to be able to write the function "setPWM(channel, on, off)" in order to write the servos into position.

Is there a better way to get the value I need or will what I have said above not do what I need it to?
Don't normalise your equations. 5/1024 is the same as 20/4096. But the latter describes what it means better.
Okay, I'll change that. It would definitely help to have the proper values so I know what it means.
You could set on=10 off=15. The pulse length is still 5 but it will be shifted to the right by 10 ticks. Setting on=0 just makes it easy because off=pulse length.
Okay, thanks for the clarification with that. :)
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Sun Oct 22, 2017 3:01 am

Ah ok I missed that understanding of the value of the 3.

Sometimes you will want to reduce equations if every ounce of performance is key, but this is normally done by reducing the number of operations or using simpler ones that use up less cpu cycles, but these should be well commented to explain what you did. In this case it does neither and makes the code harder to understand what is going on.

Tip: Never write code for yourself - write it to allow a maintainer to understand how to modify the code, because one day that might be you :)
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Sun Oct 22, 2017 4:56 am

Sorry, but just going back over a previous reply I have a question.
The ESC is combining the small, low-power, PWM control signal with the high power capability of your 7.4V Lipos to generate a 7.4V High current/power signal. it is performing the same job as the servo, just in a more powerful way.
So if they are doing the same sort of thing (servos and ESC), is it possible for me to use my ESC through the ports of my PWM HAT? If so how or what sort of functions do I need to use to control my ESC through the HAT?
Just a High School Student from Australia doing some fun stuff :) .

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Sun Oct 22, 2017 1:39 pm

In general, yes. But you'll have to read through the specs of your ESC. It may have extra functions to calibrate it or set the range of the joystick etc. which may require sending specific pwn signals.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

LucasStep02
Posts: 16
Joined: Fri Sep 22, 2017 8:28 am
Location: Queensland, Australia

Re: Is it possible to connect more than 5V to ground? <-- Warning Nonsense!

Mon Oct 23, 2017 10:44 am

In general, yes. But you'll have to read through the specs of your ESC.
Sweet as! Thanks. I am currently following this thread (viewtopic.php?f=63&t=195492&p=1223520&h ... C#p1223520) after reading what it has said as it is looking directly into using the PWM HAT that I now have to control an ESC.

A question though on the ESC, what am I looking for to use to be able to write the code? Here is the specs sheet for the ESC I have: http://docs.axialracing.com/instruction ... _Brake.pdf . What do I use to code how much the motors turn and in which direction they turn? Any help would be greatly appreciated with this. :)

Also another question I have about the PWM HAT I now have. Is it possible to power my Pi through the 5V output pin of my HAT? I am just wondering because then I could just run two wires from my HAT (ground to pin 6 and power to pin 2 or 4) to power my Pi, thus eliminating the need for more wiring and/or batteries.
Just a High School Student from Australia doing some fun stuff :) .

Return to “Beginners”