Replies: 2 comments 2 replies
-
No, do not do that. Add your code to the millisecond tasks list instead.
A kinematics implementation sounds like the best approach. But I am not sure - you may need a control loop continuously correcting the motion which could be tricky with the planner and segment buffers in between.
No, but you can open files for writing to the SD card via the VFS. The SD card is mounted as the root filing system when available. And you can send debugging output to a dedicated UART port, or even to the main channel if you want near real-time access. |
Beta Was this translation helpful? Give feedback.
-
Ok, thank you for the pointer. I've never really worked with this sort of function implementation before so excuse my incompetence, but is this sort of how I would want to set it up? In a new long unsigned timeLastPoll = 0;
long unsigned dt = 900; // (us)
void do_sensing() {
if (micros() - timeLastPoll >= dt) {
timeLastPoll = micros();
// collect sensor data
// do calcs
// store relevant measurements in global variables
}
}
void init_sensing() {
task_add_systick(do_sensing, NULL);
} Then I would initialize this task in #if PMW3360_ENABLE
extern void init_sensing (void);
init_sensing();
#endif
Hmm could I not just embed the control logic in the kinematics implementation? I honestly don't entirely have my head wrapped around how those buffers are worked in. Would this be a good use case for the pid functions? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Glad to be here.
I have been working on an open source Handheld CNC Router project for a couple years now. When I first started this project, I made the gCode interpreter and most of the base firmware from scratch because it seemed less complicated than modifying a pre-existing interpreter to fit my needs. Now that I want to do more complex operations, though, it is starting to make more and more sense to just start with a pre-made, reliable gCode interpreter. Given that, grblHAL seems like an awesome choice.
Anywho, I was wondering if I could get some guidance to point me in the right direction for integrating my firmware into grblHAL. These are my main questions/considerations (apologies for any oversights):
Other things that might be useful to know:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions