Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
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?

#27  
Can you take some close up pictures of the steering assembly? Is it some kind of rack and pinion set-up? Maybe the motor gear just goes off the end of the rack and keeps spinning at the extent of the turn.

The whole reason we are trying to push you away from using an H-bridge for controlling a steering wheel is that there must be some way to keep the motor from trying to continue pushing the wheel since there is no way to tell the H-bridge to stop at the end unless it is built into the mechanism. But since you have a working mechanism, then getting a custom Movement Panel to make it work should not be difficult at all.

Alan
#28  
Alan, This was taken earlier, i will get a better picture up a little later.

User-inserted image
#29  
Maybe something from below? Can't really see what the motor is attached to from there.
#30  
@Perses ... When they invented air travel I am sure many people still argued that trains were the better way...

Suit yourself dude... as Rich said, it's your project
#31  
@Alan, i took that with my phone, ill be back at the desk leter tonight for better photos.

@Richard, Bad analogy here, apparently, (once again) if servos were the way to go, Manufacturing plants for rc vehicles would of been using them. I may be wrong, if they are indeed servos, but they appear to be motors.

And this is not just one rc vehicle, this is majority of rc vehicles sold worldwide.

So I think the analogy you have provided might be backwords.
#32  

Quote:

And this is not just one rc vehicle, this is majority of rc vehicles sold worldwide.


Maybe RC toys, which I haven't really looked at in any detail. Real RC cars and planes all use servos.

Alan
United Kingdom
#33  
Using a H-Bridge for the steering motor is considered bad practice and is not the solution that I could ever advise on. Forcing a motor to push against it's limits is bad for the motor and while, in this case at least it may not be enough to break the chassis (who knows if it is or not?) it could on other chassis. It will also increase the current draw of the motor which will decrease the battery life amongst other things.

As Alan said, high end RC cars and planes use servos. Cheap $10 RC cars are built to budget and are often found to be poorly built, this one is no exception to that rule.

Also, the YouTube video posted where this method is used, well the scotch tape holding it all together speaks for itself really. At least it has spring return to centre position (without that, good luck!)

If you want a quality build which wont cause problems and wont fall apart spend the time to retrofit a servo to the steering or at the very least a feedback pot.

The quickest way is not always the easiest way.
#34  
Thanks for the advice, despite the fact that it Advocates for reinventing the wheel.

If no one can answer how to use the front motor with ezb, i will consider this post closed due to lack of experience on the matter. This wasn't a question for speculation. It was a, 'I want to use an rc vehicle, by only implementing an Hbridge like with arduino'.

The answer is inconclusive.

Kudos to Rich for steering conversation to switching to a servo, or installing treads.
United Kingdom
#35  
The answer is "doing so will damage the components and is bad practice therefore I am not willing to provide an answer which leaves you with a sub standard end product".

The answer you seek is in the tutorial I wrote which I have referred to multiple times and linked to in the first reply. The tutorial explains how the L298n works. By reading it and understanding it you will find the answer you are looking for.

What we need to understand is that other people may also use this post for guidance, they may search for the same thing but with a lesser quality motor or chassis or a larger motor, both of which could cause damage as previously mentioned. While it may be fine by you to risk ruining a chassis or motor it's not something I want to advise to anyone.

Read the tutorial I posted, learn about what signals to which pins will cause what to happen to both motor channels. It's all there.

Just to reiterate, the lack of the solution you wish to have is not due to inexperience or lack of knowledge but due to refusal to enable bad practice.
#36  
The answer of how to use a front motor is to use a custom movement panel, rather than an H-bridge movement panel, so you can control which digital pins go high or low based on your desired action.

I think we answered that back on the first page. We then tried to explain why it is a bad idea and the kinds of problems you are likely to experience by using an H-bridge in a manner for which it was not designed, but the question was answered.

Alan
#37  
No RC car worth having uses motors for steering rather than a servo.
#38  
@Perses You don't like my analogy?.... LOL.... How about this then.... You can steer an airplane with the rudder... It's not easy or very efficient but it can be done.... If you're the pilot though, wouldn't it be a no brainer just to use the ailerons?.... As @Zap said, real RC cars use servos to steer. Toys use cheap alternatives in order to reduce manufacturing costs...

Head on over to an RC enthusiast forum and ask them how they steer their RC cars....
#39  
thats fine, damaging it is of no consequence to me. this is just for testing. Will eventually move to a custom rig, but for now am trying to conserve space by using onboard motors.

Basically, if it ain't broke, dont fix it. thanks for the work around advice, but id like to stay with my thickskulled rudder idea.


@zap, i agree but the closest rc shop is far, and have no time for it.

I can always order online, but thats waiting time. i was looking for a quick working fix without much work, so i can focus on programming instead of engineering.
#40  
@Alan, here are some closeups


User-inserted image


User-inserted image


User-inserted image


User-inserted image
#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

Code:


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


Reverse would be

Code:


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


Stop would be

Code:


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


Emergency Brake (if applicable/required) would be

Code:


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

Code:


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