Asked — Edited
Resolved Resolved by Rich!

Questionatic L298n Red Connection

Following the instruction video, i was able to set up the Hbridge L298N RED

the problem im facing is, it only controls the read motor, not the turning motor.

the video online shows dj setting up just one motor. am i missing something?


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

#41  

Looks like maybe a rack and pinion like I was describing earlier. When the end of the rack is reached, the gear on the motor keeps spinning off the end of the rack holding the position until the motor stops , then the spring returns it to center.

If you need help figuring out how to set up the custom movement panel, post which digital ports you have the H-bridge plugged into on the EZ-B and I'll step you through setting it up.

Alan

#42  

its set up just like the Hbridge video.

Though im guessing the d8 shouldn't control both motors

#43  

Right, you will need 4 digital ports. Two to trigger forward and back on your drive motor, and one for each direction of your steering motor.

See Rich's excellent tutorial linked at the beginning if this thread for wiring (he also covers the jumper settings for speed control either both motors controlled by the same pwm, ir separately).

However, the H-bridge control won't work in your setup because it will be giving commands to the drive motor for steering. Once wired up let me know the port ids and I'll help with the next part.

(or, I may write it up more generically when I am in front of my computer in an hour or two)

Alan

United Kingdom
#44  

You'll also need to decide if you want the turning to be while moving forwards or while reversing.

Problems aside, you may be better using a few scripts and ControlCommand() to trigger them for forwards, reverse, forwards & left, forwards & right, backwards & left and backwards & right.

The forward/reverse & left/right could just fire off ControlCommand() too (one for each part).

Then your forward command would simply be setting the required ports high or low and PWM (if required).

For example purposes, presuming ports D0 to D3 are on In1 to In4. D4 & D5 for PWM. Motor channel 1 is drive Motor channel 2 is steering

Forwards would be


Set(D0, On)
Set(D1, Off)
PWM(D4, 100)

Reverse would be


Set(D0, Off)
Set(D1, On)
PWM(D4, 100)

Stop would be


Set(D0, Off)
Set(D1, Off)
PWM(D4, 0)

Emergency Brake (if applicable/required) would be


Set(D0, On)
Set(D1, On)
PWM(D4, 100)

Turning of the steering motor would be similar but with D2, D3 and D5. Forward would make it turn one direction and Reverse would make it turn the other. Stop would return to centre. There's a possibility that Emergency Brake would hold it wherever it is. If that's the case, add in two limit switches, one for full lock left and one for full lock right and throw in some monitoring, this will improve safety and remove that bad practice I mentioned yesterday.

Part of the turning code would be; For one direction


Set(D2, On)
Set(D3, Off)
PWM(D5, 100)

The other direction flip the ons and offs.

Use as part of a bigger script with feedback pots or limit switches to protect against damage.

Then add a custom movement panel. For each direction use ControlCommand() to start or stop the required scripts to set the pins on the H-Bridge as necessary.

#45  

Heres my setup, just like DJs video

User-inserted image