
E4-B4 has been a little neglected lately, so or been playing trying to give him more graceful drive movements, so I'm looking for a little help with a ramping script to be used in a custom Movement Panel for my motor controller. I read a thread some time ago where DJ posted that ServoSpeed() commands can be used, so I have tried the following script for moving forwards...
servospeed(d3,5)
servospeed(d1,5)
PWM(D3, 0)
PWM(D1, 0)
Set(D2, Off)
Set(D0, Off)
PWM(D3, 65)
PWM(D1, 65)
I have setting tried different servo speeds, but the ramping part does not seem to work. I have also had a go at converting @Rich's Sabertooth ramping script, but could not get my head around where I needed to make the changes. Can anyone help me with a ramping script to ramp up when I hit forward or reverse, and ramp down when I hit "Stop" for the following movement commands...
#Forwards
Set(D2, Off)
Set(D0, Off)
PWM(D3, 65)
PWM(D1, 65)
#Reverse
Set(D2, On)
Set(D0, On)
PWM(D3, 65)
PWM(D1, 65)
#Stop
Set(D2, Off)
Set(D0, Off)
PWM(D3, 0)
PWM(D1, 0)
Thanks.
I may be way off base here, but if I were trying to get a servo to ramp up I would try:
If the ramping is too slow incrementing by 1 you could increment $NextInc by a larger number. Though probably changing sleep time would do the trick.
I haven't actually tested this. Just off the top of my head.
Same for ramp down but start at current speed setting and decrement until minimum/stop speed setting is reached.
@WBS.
Thanks for the reply. I'm not sure if that's the kind of thing I'm looking for, but it could be. Not sure how to use it with my direction commands, but I'll have a play with it to see if I can make something of it (unless someone comes up with another solution).
Thanks, and happy holidays.
Bumping thread as I still need help with this.
Steve, are you using a Sabertooth?
Hi Bob.
No, it's a DEOK motor controller/H-Bridge.
https://www.amazon.co.uk/gp/aw/d/B00M1JZ7O2/ref=yo_ii_img?ie=UTF8&psc=1
The servospeed only adjusts ramping on continuous rotation servos. Something like the Sabertooth ramping script is needed for a PWM H-bridge (although interestingly, if you drive your movement with a joystick/game controller it ramps the PWM so maybe this is something DJ could just add to the Movement Panel to do when driven by the keyboard or script commands too)
If you are using a Sabertooth, I am pretty sure you can turn on Ramping with Describe software. Now that I finally have my basement back and getting my tools unpacked, I am finally going to wire up my Sabertooth to some wheelchair motors and start getting some hands-on knowledge on this.
Alan
Hey Alan.
This is a quote from DJ talking about the script example he posted in the link on post #1 above...
It looked to me that this should work with the motor controller I'm using as it uses PWM as well. It will be a couple of months at least before I get my hands on a sabertooth, so I'm stuck using the motor controller in post #6 for now.Hmm... I'll play with that on my Roli which has an LM298 H-Bridge and see if I can figure it out. As usual, no guarantee on time. Lot's to do and not enough hours in a day to do it...
Alan