Community Question

Hi there.

So, I have 2 drive motors running through a L298 H-bridge. I have set these up with a "H-bridge with speed control" movement panel and all is working well, but here's where I need a little guidance.

At the moment the motors are controlled via joystick 1. I have the variable speed box checked and the sensitivity set right down to the lowest option in the joystick 1 config menu. Problem is it is still quite sensitive so I need to reduce the maximum motor speed by at least half when the joystick is fully pressed. Is this achievable, and if so how do I go about doing this? I'm guessing there is some scripting involved somewhere. I have had a look through the script menu but I don't know what I need to use. I will also need a reduced maximum speed for these motors for when for when things go autonomous when I get round to setting that up.

Many thanks,

Steve.
Rich
Commented November 2014
I'm more than certain that an adaptation of the custom movement panel on Gwen's B9 would achieve what is needed here.

Just refresh my memory (without me re-reading the topic). What's the end goal? What must be achieved?
thetechguru
Commented November 2014
Goal: Conrinue to allow speed ramping when using a Joystick to control an HB 298n, but be able to set a max speed lower than speed(256) or pwm(100). Today, the Joystick over-rides the speed setting in the Hbridge with PWM movement panel.

Should be modifiable to work with the new H-Bridge steve ordered due to the 298n not being sufficient for his motors.

Alan
Steve G
Commented December 2014
Well I got my motor controller and have just installed, had a play around with the joystick again trying to finally sort out the max speed issue, and finally solved it with Rich's help in another thread in post 4 . ;)

I opened a Modified control panel and inserted the following scripts in to the config menu.

Code:


To Stop...

Set(D1, On)
Set(D3, On)
PWM(D0, 0)
PWM(D2, 0)

To go forwards...

Set(D1, On)
Set(D3, On)
PWM(D0, 60)
PWM(D2, 60)

and to go in reverse...
Code:
Set(D1, Off)
Set(D3, Off)
PWM(D0, 60)
PWM(D2, 60)



This works like a charm. I haven't added left of right code as I have a separate servo for this. Hopefully this will help you out too Alan (let me know how you get on), and thanks again to Rich for your help :). I just need to stop the wheels spinning when I power the EZB and waits to make a connection, which I have asked about here in post #15.

thetechguru
Commented December 2014
Oh, that was much simpler than I expected.
[edited to remove question that made no sense once I opened EZ-Builder and looked at the options]

Alan
Steve G
Commented December 2014
Much simpler than I expected too :). Only thing is that I have lost vairable speed from the joystick, but Rich did leave a script with some math to deal with this which I may play around with.
Question
Avatarby Steve G
Published Thursday, November 13, 2014