Managing motors with dual L298N

Im about to finish my own “NO EXCAUSES” maslow mill. Made of cheapest materials :stuck_out_tongue:


Im preparing to install shield based on my 1.2 version.

6 Likes

This looks fantastic!

I would be interested to hear your review of that Makita router and if it stays happy and cool during long cuts.

Also, I like how you have attached your ring? Did you bend and drill through a steel dowel? It looks fantastic

Ring is made from very soft steel 12 mm.
I was planing to make somthing like this:

But I went in shop they had metal bender. 8$ for material with bending to ring (it must be soft steel, otherwise it will tear and act like spring).
Then i drilled 4mm holes in places where CNC ring have mounting points.
I don’t have money to buy cnc ring :stuck_out_tongue:

I made few tweaks in my maslow 1.2 shield schema. Added more GND Pins and 1 more 5V out pin.

4 Likes

Nicely done!

I’ve got problem. Every motor test fails. They wont even move(or I’m blind).
Im using A58SW-555B motors 1:290 27RPM witch buildin encoders.

I will try again tomorrow because today, only think ive done is to run GC on old laptop

I run GC on linux witch succes, but still every motor test fails.
I created test programs to set mill plate in middle of board using arduino, so H bridges works fine and moves plate w/o problem.
My bet is that encoder is connected badly. I rotated encoder witch finger and get message that Error Message that Sled is not Keeping Up
Help me understand that.

90% of the time when we get this report, the problem is that the power cord is
plugged into the arduino rather than the motor shield (they have the same plug
and are very close to each other)

David Lang

Arduino takes power from USB. There is separation between shield and external L298N bridges (they share only GND and control pins).


Look at the shematics of my DIY version. There is no connection for external power supply, this connection is placed on board that carry H bridges.
Soo, what i should correct :expressionless:
Shall i add Transoptor separation or somthing?

What is the procedure of motor testing?
Moment… shall i calibrate 1st?

Lets consider all options
I can power arduino mega from power supply and use Mega with ESP8266 if power is the case. I can optically separate USB for TTL communication and use 12V 5amps from power supply to run whole shield+Arduino.

I can power arduino witch 12V via power plug and it still goes through regulator, will I get better result?
It look like default shield works as power shield for arduino. My shield is doing this only for motor controlls, encoders that hangs on long cables dont get much power.

The default shield only uses the 12V power for the motors. The Arduino gets its 5v power from the USB connection, and the Arduino uses that 5v power for the encoders.

The ‘Test Motors’ function tests one motor at a time, first putting 5v on one of the IN pins of that motor’s L298 and Gnd on the other IN pin for 3? seconds. Then it reverses which pin gets the 5v. That motor should run one way then the other. If not, check that the signals connect to the correct Arduino pins. Check the ENAble pin of the L298 too. When the motor turns, GC checks the encoder signals to see that the motor is turning in the expected direction. If the motor turns but fails both directions, check the encoder connections to make sure the encoder has 5v and Gnd, and maybe try swapping the EncA and EncB.

1 Like

Connection with H bridges works. Tested it when i moved sled to middle of workplace.

Test program

int in5 = 11; // OUTPUT
int in6 = 12; // OUTPUT
int enC = 10; // PWM
int in1 = 4; // OUTPUT
int in2 = 6; // OUTPUT
int enA = 5; // PWM

void setup() {
//R
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(enA, OUTPUT);
//L
pinMode(in5, OUTPUT);
pinMode(in6, OUTPUT);
pinMode(enC, OUTPUT);

}

void loop() {
digitalWrite(in5,HIGH);
digitalWrite(in6,LOW);
digitalWrite(enC,HIGH);

digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
digitalWrite(enA,HIGH);
}

/\ this program moved sled w/o problem. Tomorrow ill try reconnect everythink and use Ohmmetter to check the connection. How to check encoders? I rotated it with fingers and watched serial monitor. Left encoder send something.
Does GC display directly that encoder fails? My motors work laud when they move… but when tested they didn’t work at all.
I will reset EEPROM, and do calibration w/o motor test.

I will, 1st in arduino program if that wont help ill swap in1 and in2, then I’ll do it phisically :stuck_out_tongue:

w8 till morning

Your test program has pin assignments that match the version 1.2 board layout. When GC starts and connects to the Arduino, it should report ‘PCB v1.2 detected’ to indicate that those pin assignments are being used.


On Windos

Can i force GC to move motors w/o reading encoders? ATM motors wont move at test.

Encoders works. Motors don’t works.
<Idle,MPos:0.00,0.00,0.14,WPos:0.000,0.000,0.000>
[PE:0.56,-0.66,127]
It counts good.

I don’t know why 3 axis works on test program but wont work on maslow firmware.
Connections are good.

Offer a price for original 1.2 shield with shipping to Poland. I’m desperate to run it asap.
Maybe there is somthing special in default version.

Pff. 50$ for pcb with h bridges… no wai
Ill install older firmware

I will Connect Another Arduino as State Detector. If firmware works it should give me clean results that there is any controll signal from mega. Remember that I had an error about Reading from EPROM. When i wipe out EeProm i get connection time out error… can that be the problem?

One thing that I see in this picture is “FAKE_SERVO ON” , something introduced in Firmware v1.28 (not yet released, thanks for helping with the testing :+1:t2::grin:).

That means that the firmware acts as if it has motors attached, but does not actually run the motors. The firmware defaults to “FAKE_SERVO OFF”, and turns it on if the keyboard sends ‘cmd-f’ or ’ curl-f’. Typing a plain ‘f’ on the keyboard will turn it off again and make the motors run as expected.

The corresponding version 1.28 of GroundControl includes a setting in Settings/GroundControl to change the character for controlling “FAKE_SERVO OFF/ON”, whichever lowercase character you choose for “OFF”, and ‘ctrl’ or ‘cmd’ of that character for “ON”. The state is saved in EEPROM to persist over reboots, but wiping the EEPROM sets it “OFF”.

2 Likes

get connection time out error… can that be the problem?

That error in GroundControl usually means either that the Arduino is not on the serial port (check the serial port connection in GC) or that the Arduino doesn’t have the cnc_ctrl_v1.ino firmware programmed in it (maybe still the test program?)

Rly. Bad joke. I hope when ill wake up at the morning everythink will work correctly.
Ill install older version of firmware on another Arduino module.


yeey