
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.
Just to be sure. You are using H-bridge PWM Movement. In settings Left and Right PWM are both set to D4?
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
Yup. Using the PWM panel with sliders.
OK. I'll get a joystick plugged in tonight or this weekend and see if I can get it figured out.
Nice one. Thanks Alan.
I am not sure how much help I am going to be. I plugged in my joystick, an old Microsoft Sidewinder USB joystick, and it did exactly what it was supposed to do. Pushing the stick a little set the speed controls to low, and Roli crawled away slowly. Pushing the stick further, brought the speed up to max and he took off down the hall. Same thing with each direction. This joystick has a wide range of motion, so the speed changes were very smooth.
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
Thanks for trying it out Alan. Yup, that was exactly the same thing that was happening to me, with the joystick over-riding the init script I had. Yes I do have the vairable speed tick box checked. The brand of joypad I'm using is a CSL C210 wireless pad.
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.
OK. I have some other stuff I want to work on this weekend, and can't dedicate the whole weekend to robotics, but if I have some time I will try to adapt the Sabertooth Ramping project to work with an L298N with PWM speed control instead.
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
Well after tring a few script examples I'm still not having much luck solving this. I've come across a new issue here which is not helping matters. The couple of things I tried mentioned in this thread still moves the sliders in the Movement Panel back to full. Really not sure what to do now. confused