Managing motors with dual L298N

Ho ho hold your horses. Today I just assembled my Maslow with 3 encoders and it wont work :stuck_out_tongue:

At the moment i just pushed the test motor button and didn’t get any readout. Tomorrow i will test one encoder on osciloscope to see what is the problem.

1 Like

Ok. I tested one of them on my old maslow shield at home… I swapped maslow shields yesterday then i tested encoders :expressionless:
Pfff.
You know what? I spend 2h to swap the shields and my encoders works only on old shield :stuck_out_tongue:
Ok. I need to check what is wrong with my maslow BIG shield :stuck_out_tongue:

did the motors move at all?

as long as they are wired to the h-bridge you should have them move, even if the
ā€˜test motors’ doesn’t see the encoders and fails.

Yes. Motors did move :stuck_out_tongue:
I prabbly messed up the power trail :stuck_out_tongue: for encoders

1 Like

U know what? I’m stupid. I just connected left motor to right encoder :expressionless:
pff.

UPS. Wrong Pic :stuck_out_tongue:

Ok. Now the maslow with optical encoders finally responds.
Yup. Its working already :stuck_out_tongue:
All three motors responds to orders. No modification done :P.

Ok. Now its time for benchmark :stuck_out_tongue:

2 Likes

Story of this work in 6 parts :stuck_out_tongue:

6th part will be about how it looks as finished project. I need to put it better order :stuck_out_tongue:

Yey. Automatic subtitles works as well xD
It’s a playlist so watch all of them. Probably 4 available atm because I’m still learning how to upload things to my channel :stuck_out_tongue:

1 Like

ok, if the motors move, either the controller isn’t seeing the pulses from the
encoder, or it’s seeing them backwards, try switching either the power wires to
the motor or the encoder A/B pins (either will work)

note, the test motors routine should look for the motors moving a given distance
IN EITHER DIRECTION and then detect the direction and set a motor direction
variable

This is far from the first time that someone was using non-standard motors and
got bit from the assumption about which direction the motor turns when power is
applied


I had passed motor test maybe few times. I calibrated and now I cant pass test on top motor and Z motor :stuck_out_tongue:
During calibration evertything was working great. But when it comes to Z axis…
Right motor signal interfere with Z axis encoder :stuck_out_tongue:
What a fail. No wai. Z axis build is a failure :stuck_out_tongue:
Robber band as pulley works as buffer and causes to run Z motor in very bad manner.
At the moment only top motors works correctly.

One step from trowing this thing to trash :smiley:

Top motors act like with magnetic encoders :P. Maybe shielded cable would help preventing interference.

Funny/bizzare observations while moving motors individually:
When i move Z axis → both chains starts shaking :stuck_out_tongue:
When i move Right motor → Z axis starts moving randomly and tries to adjust itself.
Only left motor act like it should because it got grounded shield on whole length.

Experience I’ve get from this project is priceless :smiley:
@dlang I’m using only my DIY shields (I already went with 3 versions of them). I can prepare one shield in 1h so its convenient for me. I tried to make it ass foolproof as possible. I probably had all possible issues with them. So I’m making all tinkering in real time.

I can’t mount Z axis encoder directly to TR screw so i should try GT2 timing belt rather than rubber band.

Lets Cry a bit at my Maslow :stuck_out_tongue:

I think this is a good hunch. How many ppr are your encoders? I found that witch encoders higher than the stock ones I was losing pulses in the cables.

2400 PPR and it extends chains to perfect length. 2000mm set --> 2000mm I get

1 Like

Ok. I will try to mount Z axis motor on GT2 timing belt. Then i will have free shaft where i will mount encoder to it.
I will change to shielded cables. Normal 2x0,5 to every motor and 4x0,5 + shield to encoders.

1 Like


Ok. I’m going back to business.
Half of Monday i will spend on remaking Z axis to look same as my top motor mounts :stuck_out_tongue:
Optical encoder mounted directly to motor shaft. Then transmission via belt to TR screw.

Then i will change wires for my encoder to shielded ones.

1 Like

Ok. I rebuild the Z axis

And still. Even on shielded cables when i move Z axis i’m getting movement on both top motors.
I will share video in a moment.

Video need to be processed.

Last idea :stuck_out_tongue:
I can multiply resolution by adding transmission for encoders :stuck_out_tongue:
Two options… I can add this encoder to the end of motor shaft. 3mm w/o any key doesn’t look good. 2400*192 = 460800 PPR xD

Mounting it to output shaft via GT2 belt is possible but there are only fev combination. Minimal GT2 wheel got 20T. Maximal I’ve got on market is 40T.

Is the chatter on the gears from non optimized pid loops or from much lower resolution of encoders?

1 Like

This are 2400 PPR Optical encoder :stuck_out_tongue: 9x lower resolution :P.
I don’t know how to fix it now :stuck_out_tongue:
PID settings are default becouse I don’t know what will be result of changing this values.

I think your PID settings are the issue and the ā€œcontrol system loopā€ with the encoder thinks the shaft is never reaching its setpoint so it keeps moving back and forth to find the final position. Maybe someone else on here knows the technique to tune the pid so you can get the pieces to stop moving. Typically when PID tuning starts with the P value, but I’ve never done it with Maslow. I would look to adjusting those, but I’m not sure the direction to change it or the amount you can change it without it not working at all.

1 Like

I think that the Maslow firmware PID loop has no deadzone, and it calculates in
floating point numbers, so it is never going to settle, it’s always goin to
bounce back and forth across the setpoint.

I don’t know enough about PID setups to even start on fixing this though.

David Lang

Tomorrow morning i will try to lower floating point spaces to 2 places.

MarcinanBarbarzynca,

From a newbie perspective who was just really introduced to Maslow recently. Your project is insanely fascinating. Being able to read all these discussions as we can clearly watch your progress is fantastic and makes me want to start ordering parts of amazon and try it myself. (A lot easier to get wife to stomach $25 dollars worth of parts a week and work on a project than a chunk of like $500.00) Even though it will eventually be there… bite size bytes I guess. Also since the whole COVID 19 China scare I am stuck at home for months from work. So I need a new hobby and this looks like a great one to help pass the time and learn some more about coding.

2 Likes

Let us know if you get stuck anywhere, we’re here to help!

1 Like