Menu

Topic-icon Configuring pins SBL-1360

More
3 years 1 month ago #29532469 by pedropasquini
Hello i just started working with this motor controller for my school project.

1) I conected the controller to a power source and while i was exploring the configuration through Roboteq+ Utility i noticed i could choose both analog input 1 and digital input 1 to work, and they are both assigned to one pin.

Will it not work (conflict, or something of the sort). Or it will activate the first Digital In (Pin 4) and then my first analog input will be (Pin 8 - Called ANA2))?
Wouldnt it be better for us to choose a pin and then assign one of the possible configuration?

Should i assume that Ain1 (in Configuration, left-hand side (Inputs/Outputs) is the same as ANA1 (showed in the Pinout form?)

2) There are 8 pins just above the ground and controller power
What are they, did i miss something in the datasheet or the user manual? (image attached)
Attachments:

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #29532470 by blake
Replied by blake on topic Configuring pins SBL-1360
1) The input types (Analog, pulse, digital) share input pins as you have noticed. Each input can only be used for one input type at a time. So, you cannot use Ana1 and DI 1 at the same time. If you are wanting to use an analog input and a digital input you'll need to use two separate pins.

You are correct in that ANA1 and AIN1 are referring to the same input.

2)These 8 pins are not documented because they will never be used by you. They are used internally by us to program the controller. You can just ignore them as they will have no relevant use to you.

Good luck with your project, let us know if you have any other questions.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #29532471 by pedropasquini
Thanks for the fast reply!
So basically we need to take precaution while configuring those pins so the configs dont overlap, yes?

I'm at school right now and i still need some components for the circuit. I'll sure post here anything regarding this topic.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #29532472 by blake
Replied by blake on topic Configuring pins SBL-1360

pedropasquini wrote: Thanks for the fast reply!
So basically we need to take precaution while configuring those pins so the configs dont overlap, yes?


Yes that is correct

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #29532487 by pedropasquini
Ok, one more thing, I am reading those sample scripts and i am trying to understand: What action should we choose for those pins in this case? or do we have to choose an action at all?


print("starting ... \r") ' Lets user know script is starting

top:

Throttle = getvalue(_AIC, 1) ' Replace 1 with the analog input number on which the joystick is connected

FwdButton = getvalue(_DIN, 2) ' Replace 2 with the digital input on which forward button is connected

RevButton = getvalue(_DIN, 3) ' Replace 3 with the digital input on which forward button is connected

if (FwdButton = 1 and RevButton = 0) ' if Fwd button only is pressed, make command = the joystick value
OutputPower = Throttle

elseif (FwdButton = 0 and RevButton = 1) ' if Rev button only is pressed, make negative command = the joystick value
OutputPower = -Throttle

else ' if no button is pressed, or if both are pressed, command = 0
OutputPower = 0
end if

setcommand(_G, 1, OutputPower) ' Apply the command

wait(10)
goto top ' Repeat indefinitely every 10ms

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #29532489 by blake
Replied by blake on topic Configuring pins SBL-1360
In this particular script example you do not need to select any Action (Input Use), you can leave it as "No Action". However, you do need to activate the input by enabling it's capture type as "Absolute". You can do this by selecting that option in the drop down menu on the Configuration tab, or by just including it in your script, see below.

print("starting ... \r") ' Lets user know script is starting

setconfig(_amod, 1, 1) ' sets analog input 1 capture type to absolute

top:

Throttle = getvalue(_AIC, 1) ' Replace 1 with the analog input number on which the joystick is connected

FwdButton = getvalue(_DIN, 2) ' Replace 2 with the digital input on which forward button is connected

RevButton = getvalue(_DIN, 3) ' Replace 3 with the digital input on which forward button is connected

if (FwdButton = 1 and RevButton = 0) ' if Fwd button only is pressed, make command = the joystick value
OutputPower = Throttle

elseif (FwdButton = 0 and RevButton = 1) ' if Rev button only is pressed, make negative command = the joystick value
OutputPower = -Throttle

else ' if no button is pressed, or if both are pressed, command = 0
OutputPower = 0
end if

setcommand(_G, 1, OutputPower) ' Apply the command

wait(10)
goto top ' Repeat indefinitely every 10ms

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.096 seconds
Go to top