Connect PWM Joystick
- Peter Balch
- Topic Author
- Offline
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #29530672
by Peter Balch
Connect PWM Joystick was created by Peter Balch
I've got an HBL2390 driving two brushless motors (it's going to be a wheelchair). I can use the Roborun+ utility to control the motors over a serial line - it all works fine using the Roborun sliders.
I now want to connect a PWM joystick and it looks like I ought to be able to use Roborun to configure the HBL2390 to respond properly to joystick input. It's an x-y joystick so I want to push the joystick forward (i.e. y positive) to make both motors go forward; joystick forward-right to make the right motor stop; and so on. All standard stuff.
I've connected the joystick to the 25-pin connector. x-axis into pin 15, y-axis into pin 16.
On the Configuration page, I've set Pulse Inputs / Pin 1 / Capture Type: Duty Cycle; Input Use: Motor Command 1. And I've set Pin 2 the same way.
On the Run page, I can see the numbers appearing in the Pulse In box. They range from 0 to 4000 as I move the joystick with the centre position being 2000 (approx).
I can't work out how to configure the HBL2390 to accept that as motor commands.
If I click the Mute then the motors just go at full speed forwards.
What am I doing wrong? It it documented somewhere?
Thanks
Peter
I now want to connect a PWM joystick and it looks like I ought to be able to use Roborun to configure the HBL2390 to respond properly to joystick input. It's an x-y joystick so I want to push the joystick forward (i.e. y positive) to make both motors go forward; joystick forward-right to make the right motor stop; and so on. All standard stuff.
I've connected the joystick to the 25-pin connector. x-axis into pin 15, y-axis into pin 16.
On the Configuration page, I've set Pulse Inputs / Pin 1 / Capture Type: Duty Cycle; Input Use: Motor Command 1. And I've set Pin 2 the same way.
On the Run page, I can see the numbers appearing in the Pulse In box. They range from 0 to 4000 as I move the joystick with the centre position being 2000 (approx).
I can't work out how to configure the HBL2390 to accept that as motor commands.
If I click the Mute then the motors just go at full speed forwards.
What am I doing wrong? It it documented somewhere?
Thanks
Peter
Please Log in or Create an account to join the conversation.
8 years 3 months ago #29530673
by TechSupport
Replied by TechSupport on topic Connect PWM Joystick
If the motors run away, then something is telling them to run away. Is this in open loop mode or a closed loop mode?
Please Log in or Create an account to join the conversation.
- Peter Balch
- Topic Author
- Offline
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #29530674
by Peter Balch
Replied by Peter Balch on topic Connect PWM Joystick
On the configuration page,
Power Output / Motor 1 / Motor Output / Speed and Acceleration / Operating Mode: Open Loop
Is that what you mean?
That's how I've had it set up for the "sliders" in Roborun and it's been well-behaved.
Peter
Power Output / Motor 1 / Motor Output / Speed and Acceleration / Operating Mode: Open Loop
Is that what you mean?
That's how I've had it set up for the "sliders" in Roborun and it's been well-behaved.
Peter
Please Log in or Create an account to join the conversation.
8 years 3 months ago #29530675
by TechSupport
Replied by TechSupport on topic Connect PWM Joystick
Go into the "run" tab of the utility and on the bottom right corner area, select some channels.
Motor command
motor power
Their values should be 0 currently.
When you select "mute", see if both of them report +1000 or -1000, and then also see what the value shows up in the upper right area in your pulse input section.
Motor command
motor power
Their values should be 0 currently.
When you select "mute", see if both of them report +1000 or -1000, and then also see what the value shows up in the upper right area in your pulse input section.
Please Log in or Create an account to join the conversation.
- Peter Balch
- Topic Author
- Offline
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #29530676
by Peter Balch
Replied by Peter Balch on topic Connect PWM Joystick
Motor Command 1 and Motor Power 1 are at zero and the wheels are stationary. The Pulse In pane reports Pin 1 2016, Pin 2 2010.
I click the Mute box.
Motor Command 1 and Motor Power 1 both go to 1000 and the wheels spin like crazy.
Peter
I click the Mute box.
Motor Command 1 and Motor Power 1 both go to 1000 and the wheels spin like crazy.
Peter
Please Log in or Create an account to join the conversation.
8 years 3 months ago - 8 years 3 months ago #29530677
by TechSupport
Replied by TechSupport on topic Connect PWM Joystick
What about the pulse inputs value when the mute is selected?
Please Log in or Create an account to join the conversation.
- Peter Balch
- Topic Author
- Offline
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #29530678
by Peter Balch
Replied by Peter Balch on topic Connect PWM Joystick
They remained unchanged at a little over 2000.
Shall I send you a screenshot or save the setup and send it?
Peter
Shall I send you a screenshot or save the setup and send it?
Peter
Please Log in or Create an account to join the conversation.
- Peter Balch
- Topic Author
- Offline
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #29530679
by Peter Balch
Replied by Peter Balch on topic Connect PWM Joystick
Aha! If I try different joystick positions, I can get the motors to go at high-speed forwards or backwards.
It looks like I need to configure the joystick centre and slope.
Peter
It looks like I need to configure the joystick centre and slope.
Peter
Please Log in or Create an account to join the conversation.
8 years 3 months ago #29530680
by TechSupport
Replied by TechSupport on topic Connect PWM Joystick
In the range values, you set the min, center, and max.
Please Log in or Create an account to join the conversation.
- Peter Balch
- Topic Author
- Offline
Less
More
- Posts: 26
- Thank you received: 0
8 years 3 months ago #29530681
by Peter Balch
Replied by Peter Balch on topic Connect PWM Joystick
That did it.
Thanks. I hadn't discovered those settings boxes.
It now works with the x-axis controlling the left motor and the y-axis controlling the right motor. I presume there's some way of combining them to give a "skid steer". Is that what you call "mixed mode"?
Peter
Thanks. I hadn't discovered those settings boxes.
It now works with the x-axis controlling the left motor and the y-axis controlling the right motor. I presume there's some way of combining them to give a "skid steer". Is that what you call "mixed mode"?
Peter
Please Log in or Create an account to join the conversation.
Moderators: tonysantoni
Time to create page: 0.091 seconds