Hello, I’m very new to coding and I’m trying to set up some auto code for practice. My auto code runs perfectly through CAN, SPARK MAX, and a NEO550. But when I run it through a SPARK and a BAG motor, it has random ‘clicks’ where it rotates randomly throughout my auto, and it happens in a different place every single time I run it. Here’s a snippet of my code, can someone tell me what I’m doing wrong? Thank you!
First suspicion would be that “motor” is being referenced in two different locations and they are interfering with each other.
A simple test would be to rename “motor” to something else, e.g., “fred”
Only make the name change in Begin and Autonomous nowhere else and that would test if it’s a multiple reference problem.
Thank you for your suggestion! Sorry it’s been so long, we’ve been busy with other marketing commitments, but we’re back to working on the robot. We gave your first suggestion a shot, and the problem still arose. But we discovered that the timings and clicks all stopped when we turned the Robot Drive Safety Config off. Would there be any safety issues that arise from turning this safety config off? Thank you very much for helping.
Use of the Motor Safety will indeed cause that problem with what you coded.
It kicks in and cuts off motor output after 100ms from the last motor call and your time delays are all longer than 100ms.
No problem in disabling the motor safety for this purpose, especially during Autonomous driving.
It’s intended to protect against a run away robot from coding mistakes.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.