# Code. I am a Bad Student; or, Monkey See Monkey Do will not Do Do Dooo!

**URL:** <https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862>\
**Category:** Uncategorized\
**Created:** [February 17, 2023, 4:11pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862 "2023-02-17T16:11:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Webb](https://avatars.discourse-cdn.com/v4/letter/w/e56c9b/32.png) [@Webb](https://forum.onefinitycnc.com/u/Webb)\
**Post date:** [February 17, 2023, 4:11pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862/1 "2023-02-17T16:11:49Z")

</div>

Over at YouTube University, I found this routine for spindle warmup:

(Spindle Warm-up) ;  
(Run this program before machining) ;  
T01 M06  
S500 M03  
G04 X100  
S1000 M03  
G04 X100  
S2500 M03  
G04 X100  
S5000 M03  
G04 X100  
S7500 M03  
G04 X100  
S10000 M03  
G04 X100  
M30

Igor, my Journeyman, pays no mind to these commands and just sits there doing nothing. I did go into Igor’s controls and set the spindle minimum to 500RPM. No difference. I also tried entering just a portion of the script and Igor spun up to 500 and stayed there rather than dwelling at 500 and them moving up to 1000. I had to stop the spindle manually after it became clear that the script was not functioning correctly:

S500 M03  
G04 X100  
S1000 M03  
G04 X100  
M30

What am I missing?

Jim

---

<div class="post-metadata">

**Author:** ![349iq2345](https://avatars.discourse-cdn.com/v4/letter/3/bb73d2/32.png) [@349iq2345](https://forum.onefinitycnc.com/u/349iq2345)\
**Post date:** [February 17, 2023, 4:34pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862/2 "2023-02-17T16:34:53Z")

</div>

Hey Jim,

> [@Webb](#):
>
> G04 X100

“X” is not a valid address for [G04 (Dwell)](https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g4) in the LinuxCNC and the Buildbotics G-code dialects. Try ‘G04 P100’ instead. Note that unlike historic CNC machines, LinuxCNC and Buildbotics assume the P value to be in seconds, not milliseconds.

Please be aware that running under 6,000 rpm is not recommended, especially on **air-cooled** , 24,000 rpm spindles (says my spindle manual)

#### See also

[Spindle Warm-up Program](https://forum.onefinitycnc.com/t/spindle-warm-up-program/13791/2)

---

<div class="post-metadata">

**Author:** ![349iq2345](https://avatars.discourse-cdn.com/v4/letter/3/bb73d2/32.png) [@349iq2345](https://forum.onefinitycnc.com/u/349iq2345)\
**Post date:** [February 17, 2023, 5:10pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862/3 "2023-02-17T17:10:48Z")

</div>

Hey Jim,

> [@Webb](#):
>
> I also tried entering just a portion of the script and Igor spun up to 500 and stayed there rather than dwelling at 500 and them moving up to 1000. I had to stop the spindle manually after it became clear that the script was not functioning correctly:
> 
> S500 M03  
> G04 X100  
> S1000 M03  
> G04 X100  
> M30
> 
> What am I missing?

I also ran both of your code examples. The Onefinity Controller always jumps to the line before the last line. Weird. But an explanation would be: It seems that the Onefinity Controller jumps immediately to the last line that contains a “G04 X…” that it considers as a syntax error, which is the line before the last line. So all your script does is [M30 (program end)](https://linuxcnc.org/docs/html/gcode/m-code.html#mcode:m2-m30).

After “search and replace” the “G04 X” with “G04 P”, your script works correctly.

---

<div class="post-metadata">

**Author:** ![Webb](https://avatars.discourse-cdn.com/v4/letter/w/e56c9b/32.png) [@Webb](https://forum.onefinitycnc.com/u/Webb)\
**Post date:** [February 17, 2023, 8:41pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862/4 "2023-02-17T20:41:09Z")

</div>

Thanks, Aiph5u!

My understanding is that the warmup is designed to get the grease to travel through the entirety of all the bearings before the spindle is subjected to load, where heat becomes a problem with air-cooled because the fan can’t keep up. I’ve run the spindle through each of these RPM and noted little heat on the casing of the spindle. I’m going to go read the link you’ve provided. I hope all is well for you.

Jim

---

<div class="post-metadata">

**Author:** ![Webb](https://avatars.discourse-cdn.com/v4/letter/w/e56c9b/32.png) [@Webb](https://forum.onefinitycnc.com/u/Webb)\
**Post date:** [February 17, 2023, 8:44pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862/5 "2023-02-17T20:44:02Z")

</div>

By the way - I wish I’d have had a T Shirt that had “M30” printed on it when I was in high school. When the teacher asked if I’d finished my homework, I’d have pointed at the “M30.”

---

<div class="post-metadata">

**Author:** ![349iq2345](https://avatars.discourse-cdn.com/v4/letter/3/bb73d2/32.png) [@349iq2345](https://forum.onefinitycnc.com/u/349iq2345)\
**Post date:** [February 17, 2023, 9:09pm UTC](https://forum.onefinitycnc.com/t/code-i-am-a-bad-student-or-monkey-see-monkey-do-will-not-do-do-dooo/18862/6 "2023-02-17T21:09:50Z")

</div>

Hey Jim,

it’s just what my spindle manufacturer wrote into the manual. I always tend to follow the manufacturer because in case of failures I can tell them I did 🙂. Thanks, hope all is well with you too, Jim!
