Micro Joysticks In Place Of Dial On Servo Testers

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
Servo testers are built for the purpose of testing a hobby RC servo. Their output is one cycle every 20 ms and is on for somewhere between 1 & 2 ms.

I doubt that they can effectively be used to control an ESC which expects a signal on from 0 to 100% of each cycle. The best you’ll get out of the servo tester is 10% ( 2ms / 20ms = 10% )

This would give you about a 0.5V output from the ESC (10% of 5V). Which likely won’t move the servo motor.

The code examples you’ve been given should work, if the microprocessor is wired correctly, pin assignments in the code are correct, the pot is of good quality…

So as Yaakov said, it’s impossible or at best strongly unlikely that this can be debugged remotely. Sorry, I’m out as well.
A couple people said earlier that it should work. I saw two videos of someone doing it on YouTube.
 

Ya’akov

Joined Jan 27, 2019
10,370
I can't really help with the details but you might have some luck with this or one of the others like it:

https://www.amazon.com/dp/B00N30UK2M/

Depending on the value of the pot, you might be able to substitute your joystick pot. At lease this is a 0-100% PWM generator not a servo tester. I don't know if it will work but it's cheap enough that it's worth a try.

As I said, though—I really can't help to troubleshoot it if it doesn't. Just trying help as best I can.
 

djsfantasi

Joined Apr 11, 2010
9,237
A couple people said earlier that it should work. I saw two videos of someone doing it on YouTube.
They said what? It “should” work? You can hear anything you want on the Internet. My guess is those people don’t know how a servo tester works, so they say it “should” work. There’s a huge difference between “should” and “will” work. So give it a try and you’ll learn for yourself.
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
I found code to try with this. I don't know how to link the code properly but it's below. I'm wondering what I set it to to make it work for a DigiSpark. I believe I need to change A0 to one of the PBn things.

/* Arduino Brushless Motor Control by Dejan, https://howtomechatronics.com */ #include <Servo.h> Servo ESC; // create servo object to control the ESC int potValue; // value from the analog pin void setup() { // Attach the ESC on pin 9 ESC.attach(9,1000,2000); // (pin, min pulse width, max pulse width in microseconds) } void loop() { potValue = analogRead(A0); // reads the value of the potentiometer (value between 0 and 1023) potValue = map(potValue, 0, 1023, 0, 180); // scale it to use it with the servo library (value between 0 and 180) ESC.write(potValue); // Send the signal to the ESC }
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
I got it to work. Not with the DigiSpark but with an Arduino Nano. Thanks again.

How can I monitor the battery voltage of these systems
 

Ya’akov

Joined Jan 27, 2019
10,370
I got it to work. Not with the DigiSpark but with an Arduino Nano. Thanks again.

How can I monitor the battery voltage of these systems
Glad to hear it. If the Nano fits in the space, that's great.

Usually, you use a voltage divider and an ADC pin to monitor batteries. Are you talking about the whole system, the Arduino's supply, ???
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
Glad to hear it. If the Nano fits in the space, that's great.

Usually, you use a voltage divider and an ADC pin to monitor batteries. Are you talking about the whole system, the Arduino's supply, ???
I want to know how much voltage is left in the battery. I would like it to read out in an extremely simple way with colored LEDs.
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
Is it also powering the Nano, or is that on a different battery?
It's powering the Nano by way of the ESC through the 5 volt wire. I may use a different ESC in the future in which case it would be also powered by the same battery and running through a voltage reducer
 

Ya’akov

Joined Jan 27, 2019
10,370
It's powering the Nano by way of the ESC through the 5 volt wire. I may use a different ESC in the future in which case it would be also powered by the same battery and running through a voltage reducer
OK, well the principle is that you use a voltage reference (which I believe the Nano has built in) to provide something to measure against. 1.1V in the case of the internal reference. Then you use a voltage divider to get a measurement of the battery you want to monitor using an ADC pin and compare the reference to the measurement calculating a voltage.

I fear there may be some complication in your case, though. I am not sure how reliably your measurement will track the state of charge, so the indicators might be misleading.

Would something like this that plugs into the balance connection be usable?
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
Would something like this that plugs into the balance connection be usable?
That other method sounds a bit complex and like you said if it's not going to be that reliable so that little product on Amazon is probably a good way to go it's compact and it would make things simple. Assuming that it's simple to rewire the balance plug on the battery so that the voltage meter can be kept at a distance from the battery
 

Ya’akov

Joined Jan 27, 2019
10,370
That other method sounds a bit complex and like you said if it's not going to be that reliable so that little product on Amazon is probably a good way to go it's compact and it would make things simple. Assuming that it's simple to rewire the balance plug on the battery so that the voltage meter can be kept at a distance from the battery
I would make an extension, or maybe one already exists...

Check this. You could cut it and splice more in the center. If you don't make it too long, this would be a nice center part.
 

Ya’akov

Joined Jan 27, 2019
10,370
Cool, thank you

When you say if I don't make it too long are you referring to the 33-ft length
The longer the cable the greater the voltage drop. I don't know how sensitive the device is to the cell voltage. They also have an 18AWG version which wud be lower resistance, but you'll have to test to see if there is any issue. For a short run like a meter or two I don't think you'll have any trouble but I an't be sure.

Alternatively, it is really is a problem you might be able to remote the display and keep the board close to the battery.
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
The longer the cable the greater the voltage drop. I don't know how sensitive the device is to the cell voltage. They also have an 18AWG version which wud be lower resistance, but you'll have to test to see if there is any issue. For a short run like a meter or two I don't think you'll have any trouble but I an't be sure.

Alternatively, it is really is a problem you might be able to remote the display and keep the board close to the battery.
Okay. Thank you for all the ideas. I am pretty sure I will make it work with those ideas
 

Thread Starter

DragonTheta

Joined Feb 6, 2022
89
Out of curiosity because it would be even more effective although I'm definitely happy with the solution so far what would I have to do to get a readout that was colored LEDs that could flash
 

Ya’akov

Joined Jan 27, 2019
10,370
Out of curiosity because it would be even more effective although I'm definitely happy with the solution so far what would I have to do to get a readout that was colored LEDs that could flash
Well, it's a project. Were I trying to do it relatively simply I'd probably get a MAX17043 breakout board and connect it to one of the cells via the balance connector as a witness to the other cells as well, then write a program that would track conditions that could be considered green, yellow, and red and indicate them on one or more WS8212 addressable RGB LEDs.

But it's a project. No particular part is hard, it's just going to be a lot of new things for you.
 
Top