
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.
@Steve G. Everything we solve for you will be used in my Steampunk K9 project, so better for me if we get it sorted now rather than after I start my build (particularly since I expect I will be using wheelchair motors and a Sabertooth since I expect my bot to be very heavy, so I want absolute control over his speed and direction to prevent killing someone or breaking furniture.....)
I am basically using Roli as a test bed for the bigger project.
Alan
On the Movement Panel itself, on the right side, there are two slide controls. These set the max speed of each PWM channel (which are the same for you since you have the same port connected to both).
If you are just using an H-Bridge Movement Panel, it doesn't allow PWM control in the panel, just in scripting, and may not achieve what you want.
Alan
One thing I did notice, is in the joystick control, there is a checkbox to "use variable movement speed". do you have that checked?
However using the H-bridge movement panel, I could not set a maximum speed. The joystick over-rode the speed I had set in my init script as soon as I pushed it to maximum.
I think for setting a maximum speed you may need a custom movement panel, and something similar to the sabertooth ramping scripts that Rich wrote for Gwen's project. Scripts attached to the Sabertooth Ramping project on EZ-Cloud (it will obviously need to be modified to send the correct commands to the H-bridge instead of the SendSerial() commands it uses now).
Either that, or get a joystick with a wider range of motion so that you have more control. What brand/model joystick are you using?
Alan
I'm having a little with the drive motors at the moment, where the drive along for a short while then quickly gradually lose power, I wait a few seconds, then they drive normal and slowly lose power again, so I think my 12v drivetrain battery is knackered which is now making testing a little difficult (I think that's the cause anyway). Just ordered a new 11.1v LiPo which should be with me Tuesday so I'll carry on experimenting then and keep you informed.
This will actually be useful for my Roli as well. I have a little pocket size BT joystick and it doesn't have proportional output on the direction buttons. They just emulate hitting the arrow keys on the keyboard, so if I create this custom Movement Panel and script, it will work for me too.
Alan
Now, since it turns out you need a more powerful H-Bridge, anything I come up with will need to be adapted to the commands for that bridge, but we'll cross that bridge when we get there (or if you decide to bite the bullet and get a Sabertooth, things are much simpler. It turns out Rich's ramping script was superfluous because you can hook the Saberooth up to a TTL adapter and give it a command to tun auto-ramping on, and we can make a custom Movement Panel that has whatever you want as your max speed be the command that gets sent to move in that direction).
Alan
I was thinking, all we really need for this is a setting in the Movement Panel config menu, where we move a slider control to where we want it set, and tick a check box next to it saying "use this slider setting for the max speed". Unchecked, the slider/speed would go back to default maximum. Something DJ may consider adding to his to do list. Just a thought to make things a little easier perhaps.
I think it is one way he judges the priority of things. The more we are willing to work for it, the more likely it is that other customers will want it too.
Alan
Just refresh my memory (without me re-reading the topic). What's the end goal? What must be achieved?
Should be modifiable to work with the new H-Bridge steve ordered due to the 298n not being sufficient for his motors.
Alan
I opened a Modified control panel and inserted the following scripts in to the config menu.
Code:
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.
[edited to remove question that made no sense once I opened ARC and looked at the options]
Alan