I appreciate any help in understanding what I am doing wrong. I have a modified servo panel and a logitech joystick control installed. I have the wheels on d0 and d1. I have two servos with one on d3 and d4. The wheels are running correctly on the joystick but the two servos are running totoally intermittent on the second stick on the joystick controller. I have tried to program joystick 2 and 3 and actually both at the same time. I am all over the place. Sometimes the X servo works sometimes the Y servo works. Sometimes neither and sometimes both work. I am at a loss at what I am doing wrong. Can anyone help.
Also when I got them both running one time using joystic 2 and 3. I tried to first locate the servos with the Servo(d2, 50) and Servo(d3, 50) and then slow them down with ServoSpeed(d2, 25) and ServoSpeed(d3, 25). I put this script in the initiation File. It slowed down the servos to a crawl and they wouldn't work until I used the joystick. They also did not seem to want to find position I requested. I know this is something I am doing but to the life of me I cannot figure it out according to the ARC manual or the EZ-Script manual. Do I need to add ControlCommand script? Any advice you can give would be greatly appreciated. Thanks
Upgrade to ARC Pro
Your robot can be more than a simple automated machine with the power of ARC Pro!
Two HB-25 motor controllers hooked to pins d0 and d1. These are used for forward, reverse, left and right movement of the robot.
Two 180 degree standard servos for horizontal and vertical head movement on d2 and d3. I am using these to control head movement and future camera.
I am controlling these with a Logitech wireless controller.
I have set speeds and location back to 0 rebooted and it did make vertical servo move up and down correctly using the right joystick. I have tried programming this joystick with joystick 2 and three. I do not know if it makes a difference but neither would control both axis at the same time. I programmed joystick 2 and three at the same time and both worked but acted random.
As for the values on speed I have tried various speeds from 10 to 0. It will slow servo down to crawl but doesn't seem to do this proportionately. 2 seems to be the same as 8.
I have looked on the samples and am going to add some code like you have done on different units to see if I can get it to work correctly.
Ok as far as the HB-25s are concerned... Do you have a h-bridge movement control (Not the Modified servo movement control) in ARC set up for them? These are parallax motor controllers right? For regular DC motors (not servos) right? The left joystick control will drive the Movement Panel which in turn would control your 2 HB-25s (and the dc motors connected to them)....
If you're are using modified 360 deg servos to drive your robot then you don't need the HB-25s... You're Movement Panel will then be the Modified servo movement control....
I am trying to slow the servos down because I am using an elongated iPhone car mount to provide the head. Since it has a long neck it amplifies the movement.
I may be doing several things wrong but I am in the process of learning this whole system.
Thanks for helping me in such a fast fashion.
I still don't see why you need to change the servo speeds for your pan and tilt servos, though...
I have to dig into this farther as I am sure there is a way to get the x and y (pan and tilt) servos to act proportionally via the right analog joystick control....
Or we could just asj DJ to update stick 2 and 3 to ramp similar to stick 1, but I find he is more likely to add a fix or feature immediately after one of us develop a viable workaround than if we just ask. I think it helps prioritize. If he sees we are willing to make it work ourselves it must be important
As for the HB-25s the HB probably does stand for H-bridge. The information for the HB-25 says it plugs in like a servo. If you think setting it to a H-Bridge control panel would work better let me know. I know the HB-25 only requires signal and ground to control it.
Here is the link to the HB-25 operation manual.
Thanks again for helping.
We may need to also do some scripted ramping for them to work smoothly.
I'll get the pan/tilt thing figured out first. That is exactly what I want to use stick 2 for as well, so I need to solve it.
Thanks for your help.
When I define my pan/tilt servos in Joystick 2, only the Y axis works when I use the right joystick control. The X axis responds to the RT/LT buttons on the front of the controller, but not to the left/right of the joystick.
If I define the same servos in Joystick 3, just the opposite. X axis works (but not with the LT/RT buttons, but Y axis doesn't.
If I define it in both 2 and 3, both axis and buttons work.
I am not actually sure what Joystick 3 is supposed to control. Joystick 1 drives both the stick and the D-pad if I turn on D-pad mode, and just the stick if I turn off D-pad mode, and the D-pad doesn't do anything.
This is all with the Logitech G710 in X-Mode. Doesn't work at all in D-mode, and the Logitech drivers don't work in Windows 8.1 but it is recognized by Windows as an XBox 360 controller.
Since I have a Roli with an H-bridge, the speed ramping is working fine on stick 1, but I will play around tomorrow with my box bot and rotational servos to see if I can figure out something for you there with virtual ports and scripting.
What you are getting is exactly what I am getting. If I set up both 3 and three I get both X and Y to work but I don't think that it is working as designed. Also when I try to set the speed it is not proportional as Richard stated. Scripting servo speeds with ServoSpeed Script in initiation file seems to work but very jerky and non proportional.
Rich, As far as setting the joystick two to analog, do you know how is that done on a Windows G710 Logitech game controller. I would like to have the 2 joystick work correctly.
Thanks again for all the help. It seems looking at yours and my results it is a controller programming problem. I will also keep trying to find the answer.
If you switch from Xinput to DirectInput (the little slider switch on the front from X to D), and install the Logitech drivers, Joystick 2 works like it should and drives both servos. Also, the LT and RT buttons become visible to ARC, where they were not (just drove the X-Axis) in Xinput mode.
As far as having slower/better control of the servos, either in your initialization script or in a separate script you run before using the joystick, set the servo speeds to 1 or higher (0 is fastest, and is too twitchy for joystick control. My pan and tilt is working well with it set to 1). You don't get proportional speed, but do get proportional position (the further you push the stick the further the servo moves, which I think in a pan and tilt is what you would be looking for).
Keep in mind that a servo needs to receive a position command at least once before ServoSpeed() script command will work, so you should have your initialization script set the position of the pan/tilt servos to 90, then set the speed, then the joystick should work.
There is one glitch I have found in DirectInput mode though. Randomly, the debug window throws an error "Already Running Joystick" repeated about 6 times, and when the error is being written the movement is a little jerky. Seems totally random when it hits. I thought I had it reproducing just on going left with the x axis, and then it stopped doing it and hasn't repeated for about 10 minutes.
Tomorrow I'll look into proportional speed on modified servos. I am suspecting we'll need some scripting there, but maybe the DirectInput mode will fix that too.
I am now waiting for the boxbot batteries to charge. I thought I had a charged set, but I was mistaken, so it will be several hours before I can continue, so I may not get to it today.
thetechguru did over the top help on this. I really appreciate the help.