Go Down

Topic: Connecting LiPo battery to a motor controller via breadboard (Read 259 times) previous topic - next topic

speecu

Hello, i come here with a problem. I want to connect a  Li-Pol Redox 1800mAh 30C 3S 11,1V battery to power up the stepper motor Stepper Motor: Bipolar, 200 Steps/Rev, 35×28mm, 10V, 0.5 A/Phasehttps://www.pololu.com/product/1208 which is controllable by A4988 Stepper Motor Driver Carrier https://www.pololu.com/product/1182. All of this want to connect on a breadboard and here is a problem because this battery has DEANS connectors and i dont know how to connect this battery with stepper motor driver ? Can someone help me with this? Thanks for the answers :D

UKHeliBob

Quote
this battery has DEANS connectors and i dont know how to connect this battery with stepper motor driver ?
Ideally you need a mating Deans connector to which you have soldered breadboard friendly wires to, perhaps with DuPont connector pins to connect to the breadboard or bare wires to the motor driver.  Deans connectors are not so common in the RC modelling world as they used to be but a local Model Shop is likely to have them available

DO NOT be tempted to cut the Deans connector off as there is then a danger of the battery wires shorting together with dangerous results.

How are your soldering skills and what soldering experience and equipment do you have ?  Have you got any heat shrink tubing that would fit over the battery wires if the Deans connector was not there ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

speecu

Honestly i have little soldering experience, and when it comes to heat shrink tubing i have some. So i need to find a mating Deans connector and have to soldered it to the wires, am i right?(About soldering i will have a help with more experience person). It will be good if i will solder it to this type of wires(couse i get this with breadboard): https://botland.com.pl/en/connection-cables/1022-connecting-cables-male-male-65pcs.html

UKHeliBob

Those wires will certainly allow you to connect the mating Deans connector to a breadboard but may not be able to handle the current being transferred.  In my experience those leads provide very bad connections to the breadboard and the breadboard must also be able to handle the current.  Why not solder the wires from the mating Deans connector directly on the stepper driver and eliminate the breadboard connections ?

If you do connect such wires via a breadboard ALWAYS plug them into the breadboard before connecting the 2 Deans connectors so that there are never 2 battery wires that could connect together or short together by some means
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

speecu

Okey so u suggest me to solder the wires i have to the mating Deans connector like this https://www.sparkfun.com/products/11864 and on the other side of wires solder to the stepper motor controller to VMOT and GND pins, a may right? And one more question, cause there is something about capacitors for the stepper driver, do i need to use it or my power voltage for a stepper motor is small enough to skip it?

UKHeliBob

Quote
so u suggest me to solder the wires i have to the mating Deans connector like this https://www.sparkfun.com/products/11864 and on the other side of wires solder to the stepper motor controller to VMOT and GND pins
That is correct.  The Lipo presumably has the female Deans connector on it so that when it is unplugged from the mating male connector no pins are exposed.  Mind you, I have always disliked Deans connectors and prefer XT60s

If you have seen advice about using capacitors with the stepper drivers then I suggest that you follow it.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

speecu

Okey so if i need this capacitor i have to connect battery to stepper driver via breadboard inspite soldering it to pins because i won't be able to use capacitor there.

UKHeliBob

Where in the circuit is the capacitor connected ?
If it is across the power connections to the stepper driver then you can solder it into place
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

speecu

It is said that it has to be put across motor power VMOT and grounded somewhere near the board

speecu

I did everythink right like there is in this photo, connect every pin like is show and my stepper motor do nothink :/. Do u have any idea why?

slipstick

Maybe you don't have any code to drive it? Or the code you have but haven't shown us is bad? Or your wiring is wrong e.g. no pin numbers are shown on the "microcontroller" (what is it ?). Or perhaps you have connected the capacitor the wrong way round?

We know that your "motor power supply" is a 3S Lipo but what is your "logic power supply"?

How about posting a picture of your setup so we can see for ourselves that you have done everything right?

Steve

speecu

Okey so i made a pictue of my setup. its just a schemat because i couldnt get stm32f407G board in this program so i add random one. I wire pin PA1 to step and PA2 to dir. Logic supply is from microcontroler wire 5v and GND. I use capicitor 100µF and this LiPo is a random Lipo like microcontroler. Here is my code, i took it from one of the examples and changed for stm32 board. I used Arduino IDE couse the board im using which is stm32f407G-DISC1 can be programed there.
CODE:
#define dirPin PA2
#define stepPin PA1
#define stepsPerRevolution 200
void setup() {
 // Declare pins as output:
 pinMode(stepPin, OUTPUT);
 pinMode(dirPin, OUTPUT);
}
void loop() {
 // Set the spinning direction clockwise:
 digitalWrite(dirPin, HIGH);
 // Spin the stepper motor 1 revolution slowly:
 for (int i = 0; i < stepsPerRevolution; i++) {
   // These four lines result in 1 step:
   digitalWrite(stepPin, HIGH);
   delayMicroseconds(2000);
   digitalWrite(stepPin, LOW);
   delayMicroseconds(2000);
 }
 delay(1000);
 // Set the spinning direction counterclockwise:
 digitalWrite(dirPin, LOW);
 // Spin the stepper motor 1 revolution quickly:
 for (int i = 0; i < stepsPerRevolution; i++) {
   // These four lines result in 1 step:
   digitalWrite(stepPin, HIGH);
   delayMicroseconds(1000);
   digitalWrite(stepPin, LOW);
   delayMicroseconds(1000);
 }
 delay(1000);
 // Set the spinning direction clockwise:
 digitalWrite(dirPin, HIGH);
 // Spin the stepper motor 5 revolutions fast:
 for (int i = 0; i < 5 * stepsPerRevolution; i++) {
   // These four lines result in 1 step:
   digitalWrite(stepPin, HIGH);
   delayMicroseconds(500);
   digitalWrite(stepPin, LOW);
   delayMicroseconds(500);
 }
 delay(1000);
 // Set the spinning direction counterclockwise:
 digitalWrite(dirPin, LOW);
 //Spin the stepper motor 5 revolutions fast:
 for (int i = 0; i < 5 * stepsPerRevolution; i++) {
   // These four lines result in 1 step:
   digitalWrite(stepPin, HIGH);
   delayMicroseconds(500);
   digitalWrite(stepPin, LOW);
   delayMicroseconds(500);
 }
 delay(1000);
}

Zapro

A4988 requires at least 8V to work.

You will NOT have it working at 4.2V.

// Per.

Go Up