
jp15sil24

I have modified my 3-wheel robot by replacing the two 360-degree servos with a motor equipped with a differential. This motor is controlled by a dual H-bridge using PWM signals. While I'm not entirely sure if this is the optimal setup, I'm still learning and experimenting with various possibilities. Currently, the single motor controls both rear wheels, allowing for synchronized forward and reverse movement, which is functioning well.
For steering, I have installed a servo at the front to control the wheel's left-right movement. However, I'm encountering an issue where the joystick correctly manages the forward and reverse motion but fails to control the steering. I would like to have a single control interface or "tool" that can manage both forward/reverse and left/right steering using the servo. If achieving this with a joystick is not feasible, could you suggest an alternative solution?
DJ mentioned that you tweak the values for the Utility map() to suit your needs. We need to see your code to see what has changed from DJ's example code to better help you.
Try this.... (I removed the Utility.map() and did the math inline to have better control of what it does)
Forward Script
Reverse Script
@dj sures, Significant improvement. It no longer springs to the right or left as he did before. I modified the max speed in the joystick configuration. That way,i can steer correctly. Very good, thanks. I'll try with a wireless joystick.Not sure it will better but id like to try the skill Joystick (Direct Input).
Check to ensure your joystick is a Direct Input or XInput type. You'll know if one doesn't work, try the other. Newer joysticks are usually XInput. Some have a switch that will say D or X on it. Old joysticks are Direct Input.
@Athena explain the difference between Direct Input and XInput for joysticks
Certainly! Here's a brief explanation of the differences between Direct Input and XInput for joysticks:
Direct Input:
XInput:
Choosing Between Them:
If you have any more questions or need further assistance, feel free to ask!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.