BEST Robotics Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
rolfes

Junior Member
Registered:
Posts: 4
Reply with quote  #1 
Hello-
My middle school youth used a limit switch to control one lift and are close to getting it working in Simulink based on some help from this forum. They also having it working in RobotC.   I asked them to use the potentiometer to limit the 2nd lift on their robot (as a learning experience) and the hardware is in place.  Does anyone know how to program this in Simulink?  We have done this in RobotcC and confirm data values of the pot...just don;t know enough about modelling to help the youth get it in Simulink.
0
widerbestrobot

Junior Member
Registered:
Posts: 23
Reply with quote  #2 
You'll have to wait for shiremath to answer to confirm this but...

The way to program it is to use a analog input block (main page in the library). And that will give you your variable input
I don't know what the range is but i would assume it is -127 to +127 based on the joysticks and everything else in the cortex.
Then once you have that block you can hook it up to whatever other block you want.
0
rolfes

Junior Member
Registered:
Posts: 4
Reply with quote  #3 
Thanks for the reply.  An analog input block makes sense.

In RobotC, the potentiometer changes from values 2137 (low point) to 2833 (high point) per the debugger. Does it as you state go between the ranges -127 and 127 in Simulink? Also, the youth want to be able to press a button and it lifts or lowers the entire range automatically.  I can see how to do this with logic in RobotC but not Simulink.
0
rolfes

Junior Member
Registered:
Posts: 4
Reply with quote  #4 
Amit from Simulink was able to help (see below).  This helps to ensure what is setup will work. 

Simulink, also has a debugging environment. We call this the External mode. The simplest way to find the range of potentiometer is to connect a display to the potentiometer block(analog import) and vary the potentiometer. By doing this you can verify the range of the potentiometer.

0
shiremath

Moderator
Registered:
Posts: 78
Reply with quote  #5 
Hello rolfes,

I understand this response to your question is late but hopefully you were able to figure this out eventually. I was subscribed to get notices on new threads on the topic but looks like it did not happen. In any case, if you are still interested in knowing how to do this, please let me know at bestrobotics@mathworks.com.

Essentially, there are two parts to the problem that you are trying to solve:
1) Use potentiometer data to control the arm lift
2) Automate the arm lift or drop using a digital button.

I will try to address both these questions in a blog entry very soon. 

If there are other similar requests in the future, post it as a separate thread or email us at bestrobotics@mathworks.com

Cheers
SH
0
widerbestrobot

Junior Member
Registered:
Posts: 23
Reply with quote  #6 
I'm going to have access to the robot soon for a science fair (we are a homeschool team and it is rather difficult to use the robot in the off season). When I get it I will hopefully figure out a way to use the potentiometer in Simulink, and then post a video about it to this thread.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.