Kinarm | Interactive Robotics Brain Injury Research

  • Products
  • Clinical Applications
  • News
  • Support
  • About Us
  • Contact

Mobile nav

Moving targets

Moving targets

Posted on Aug 4, 2017

DWQA Questions › Category: Custom Task Development › Moving targets
0 Vote Up Vote Down
Michael Huang asked 6 years ago

Hi,
I am trying to make the target moving straight. I noticed that in the moving target sample. The way to make it moving is to change VCODE(3) and VCCODE(4). In my case it will be VCODE(4)=VCODE(4)-speed*counter. The problem is the counter cannot reset when it turns to second target. I have tried to use mod, but this will not solve the problem eventually

Thanks,
Michael

2 Answers
0 Vote Up Vote Down
Duncan McLean Staff answered 6 years ago

Hi Michael,

The moving target sample was really just intended as an example – the use of the counter in this case was a convenience.

You could make your own counter with a bit of embedded MATLAB. Something like this should work:

function counter=Counter(reset)
persistent value

if isempty(value) || reset == 1
value = -1;
end

value = value + 1;
counter = value;
end

In your Stateflow you would need to send the “reset” input on this code to 1 briefly at the start of each trial.

This counter would run at the default speed of the model. i.e. 2 or 4 kHz. If you want the counter to run at 1 kHz then you would need to right click on the MATLAB block, get properties, and explicitly set the update rate to 0.001 (i.e. 1 ms).

There are many other ways to solve this problem, it just depends on the specifics of what you want to do.

Cheers!
Duncan

Michael Huang replied 5 years ago

Hi Duncan,
When I right click the MATLAB function block, properties, there are general, block annotation and callbacks. There is no option to set the update rate

0 Vote Up Vote Down
Duncan McLean Staff answered 5 years ago

Hi Michael,

Sorry, rather than “properties” you should open “block parameters”.

Support

  • User Guides & Documentation
  • Software Downloads
  • Install/Maintain Your KINARM Lab
  • Training Videos
  • New User Training
  • Creating Custom Tasks
  • Sample Custom Tasks
  • Q&A Forum
  • Publications by Research Area

Products

  • Platform Comparison
  • Kinarm Exoskeleton Lab
  • Kinarm End-Point Lab
  • Kinarm Standard Tests
  • Dexterit-E
  • Dexterit-E Explorer
  • NHP Kinarm Exoskeleton Lab

Clinical Applications

  • Clinical Applications
    • Stroke and TIA
    • Traumatic Brain Injury (TBI)
    • Neurological Disease
    • Pediatric
    • Primarily Non-Neurological
  • Clinical Research Sites
  • Publications

News

  • Kinarm News
  • Events
    • Neuroscience
    • Kinarm Camp
  • Product Notices
  • @KinarmLab Twitter Feed
  • Open Jobs

Support

  • Kinarm Help & Support
  • User Guides & Documentation
  • Software Downloads
  • Installing & Maintaining Your Kinarm Lab
  • Training Videos
  • New User Training
  • Creating Custom Tasks
  • Sample Custom Tasks
  • Q&A Forum

About Us

  • About Us
  • Our People
  • Quality
  • Supplier Requirements
  • End-User License Agreement
  • Intellectual Property
  • Privacy & Terms

Contact

  • Contact Kinarm
    • International Sales Agents
  • Request an Account
footer-logo

140 Railway St. Kingston, ON K7K 2L9 Canada Toll Free: (888) 533-4393 Phone: (613) 507-4393 info@kinarm.com

© Copyright BKIN Technologies. All Rights Reserved

Quality | Privacy Policy | Web design/development by 1dea Design + Media Inc.