BEST Robotics Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
sdfalcon

Junior Member
Registered:
Posts: 2
Reply with quote  #1 
There is a delay when activating a any joystick controller input (button or joystick).  For example when you push a button there is a delay before the motor or servo responds.  I assume this is because of some kind of scan time setting.  Is there some way to improve this.

We are using the latest simulink vex components to build and deploy to hardware.

Thanks
0
jgraber

Moderator
Registered:
Posts: 184
Reply with quote  #2 
I haven’t compared Simulink to others.
There is some delay in Cortex because your program runs on slave cpu, which has serial link to master, which sends 10ms base Pwm to motor port where mc29 interprets it as 1ms Pwm to dc motor. As a result, there is a random 12-30ms delay between command and motor change.
If you have more than this there might be something in your program. Can you post your program?
0
JoseAvendano

Moderator
Registered:
Posts: 4
Reply with quote  #3 
It is entirely possible that the delay might be associated CPU communication. However, here are two things you might want to check on the Simulink side to make sure your modeling is not the problem.

1. There are certain blocks that can slow down the responsiveness of your output commands, specially if you are using a Stateflow chart there might be cases where a couple of time steps might be necessary to get an output if not corrently implemented. If you share your model we can take a further look and see if this might be the case.

2. There is a "step-size" parameter in Simulink models. This is the rate at which the  program will run on the hardware. You might want to check that and modify if necessary to make if perform faster. You find it under configuration parameters>Solver>Additional parameters. I included a screenshot as well.

Hope this helps!

Best,

Jose

Attached Images
png config.PNG (41.11 KB, 4 views)

0
BCR-Jim

Junior Member
Registered:
Posts: 2
Reply with quote  #4 
Double check the sample rate setting in the joystick/button block.  If you have an input port for simulation set up it will not give you the option of setting the sample rate.  Make sure the box is unchecked for the input port and set the sample rate at .01 and this improved our reaction.
0
sdfalcon

Junior Member
Registered:
Posts: 2
Reply with quote  #5 
Sorry that I have not replied to the other suggestions, but I decided to try to convert everything over to easyC to see if it had the same delays.  I did NOT, so I was convinced it had something to do with the programming or settings in Simulink.

BCR-Jim had the answer that solved the issue.  Because we had set all the joystick controller inputs with input ports, I had not seen the sample rate field before. Setting them all to 0.01 solved the delay issue.  BTW.. once you set the value, you can reenable the input port and it still works.  Not sure why that field is taken away when you select input port.

Anyway,  Thanks for the help and solution.
0
jgraber

Moderator
Registered:
Posts: 184
Reply with quote  #6 
Thanks for writing back to close the loop on what worked for you. 
That will be helpful for future teams reading the forum with the same problem.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.