Problem controlling steppers

Greetings, i'm new to arduino and i wanted to make a school project that basically controls 3 steppers by taking serial input from the computer as coordonates for the steppers.
I used the AccelStepper library and ran into a problem when i created the draw function. When running the code with the draw function,the steppers don't work and not even the initial steps in setup() are executed. If i comment out the draw function, the steppers work.
This is my full code

#include <AccelStepper.h>
AccelStepper X(4, 2, 3, 4, 5);
AccelStepper Y(4, 6, 7, 8, 9);
AccelStepper Z(4, 13, 12, 11, 10);
#define motorspeed 200
#define accel 500
unsigned int xval=0;
unsigned int yval=0;
unsigned int zval=0;
unsigned int xcount=0;
unsigned int ycount=0;
unsigned int xtot=0; 
unsigned int ytot=0; 
unsigned int ztot=0;
unsigned int loading=0;
unsigned int lines=0;
int ccount = -1;
unsigned char pos[180][180]; //180x180 x-y grid
char incomingByte;
void setup(){
  Serial.begin(9600);
//calibration -- set axes to 0,0
    X.setMaxSpeed(motorspeed);
    X.setAcceleration(accel);
    X.runToNewPosition(250);
    Y.setMaxSpeed(motorspeed);
    Y.setAcceleration(accel);
    Y.runToNewPosition(250);
    Z.setMaxSpeed(motorspeed);
    Z.setAcceleration(accel);
    Z.runToNewPosition(250);
    delay(1000);
        if(X.currentPosition() == 250)
        X.setCurrentPosition(0);
              if(Y.currentPosition() == 250)
        Y.setCurrentPosition(0);
              if(Z.currentPosition() == 250)
        Z.setCurrentPosition(0);
}
void loop(){
interpret();
draw(); // start moving steppers
}
void draw(){
int go=0;
for(int x=0;x<180;x++)
	for(int y=0;y<180;y++){
	go=pos[x][y];
	if(go==1)
	{
	X.runToNewPosition(x);
	Y.runToNewPosition(y);	
	Z.runToNewPosition(18);
	}
	if(go==0)Z.runToNewPosition(35);}
for(int y=0;y<180;y++)
	for(int x=0;x<180;x++){
	go=pos[x][y];
	if(go==1)
	{
	X.runToNewPosition(x);
	Y.runToNewPosition(y);	
	Z.runToNewPosition(18);
	}
	if(go==0){Z.runToNewPosition(35);}
}}

void catecifre(){ //divide if necessary
if (incomingByte == ','){
	if(xcount==1 && xtot==0){ 
		xval=xval/100;xtot=1;}
	if(xcount==2 && xtot==0){ 
		xval=xval/10;xtot=1;}
	if(ycount==1 && ytot==0){
		yval=yval/100;ytot=1;}
	if(ycount==2 && ytot==0){ 
		yval=yval/10;ytot=1;}
}}
void interpret(){ // interpret serial coordonates from aaa,bbb,c to xval=aaa yval=bbb and zval=c, all combinations
if (Serial.available() > 0) {
incomingByte = Serial.read();
if (incomingByte == '*'){xval=0;yval=0;zval=0;ccount=-1;xcount=0;ycount=0;xtot=0;ytot=0;ztot=0; //asterisk is new line
int data = int(incomingByte) - '0';
switch(ccount){
case 0:
	xval += data*100;
	xcount=1; 
	break;
case 1:{
	catecifre();
	if(xtot==1){break;} 
	if(xtot==0){xval += data*10; xcount=2;} 
	break;}
case 2:{
	catecifre(); 
	if(xtot==0 && ytot==0 && xcount==2 && ycount==0){xval +=  data; xcount=3; xtot=1;} 
	if(xtot==1 && ytot==0 && xcount==2) {break;} 
	if(xtot==1 && ytot==0 && xcount==1 && ycount==0) {yval+=data*100; ycount=1;} 
	break;}
case 3:{
	catecifre(); 
	// if(ytot==1 && ycount==1){} 
	if(xtot==1 && ytot==0 && xcount==3 && ycount==0){break;} 
	if(xtot==1 && ytot==0 && xcount==2 && ycount==0){yval+=data*100; ycount=1;}
	if(xtot==1 && ytot==0 && xcount==1 && ycount==1){yval+=data*10; ycount=2;}
	break;}
case 4:{
	catecifre(); // virgula?
	if(xtot==1 && ytot==0 && xcount==3 && ycount==0){yval+=data*100; ycount=1;} 
	if(xtot==1 && ytot==0 && xcount==2 && ycount==1){yval+=data*10; ycount=2;} 
	if(xtot==1 && ytot==0 && xcount==1 && ycount==2){yval+=data; ycount=3; ytot=1;} 
	if(xtot==1 && ytot==1 && xcount==1 && ycount==1){zval=data; ztot=1;} 
	if(xtot==1 && ytot==1 && xcount==1 && ycount==2){break;} 
	if(xtot==1 && ytot==1 && xcount==2 && ycount==1){break;} 
	break;}
case 5:{
	catecifre();
	if(xtot==1 && ytot==1 && xcount==1 && ycount==3){break;} 
	if(xtot==1 && ytot==1 && xcount==2 && ycount==2){break;} 
	if(xtot==1 && ytot==1 && xcount==3 && ycount==1){break;} 
	if(xtot==1 && ytot==0 && xcount==3 && ycount==1){yval+=data*10; ycount=2;}
	if(xtot==1 && ytot==0 && xcount==2 && ycount==2){yval+=data; ycount=3; ytot=1;} 
	if(xtot==1 && ytot==1 && xcount==1 && ycount==2){zval=data; ztot=1;} 
	if(xtot==1 && ytot==1 && xcount==2 && ycount==1){zval=data; ztot=1;}
	break;}
case 6:{
	catecifre();
	if(xtot==1 && ytot==1 && xcount==3 && ycount==2){break;} 
	if(xtot==1 && ytot==1 && xcount==2 && ycount==3){break;} 
	if(xtot==1 && ytot==0 && xcount==3 && ycount==2){yval+=data; ycount=3; ytot=1;} 
	if(xtot==1 && ytot==1 && xcount==2 && ycount==2){zval=data; ztot=1;} 
	if(xtot==1 && ytot==1 && xcount==1 && ycount==3){zval=data; ztot=1;} 
	if(xtot==1 && ytot==1 && xcount==3 && ycount==1){zval=data; ztot=1;} 
	break;}
case 7:{
	catecifre();
	if(xtot==1 && ytot==1 && xcount==3 && ycount==3){break;} 
	if(xtot==1 && ytot==1 && xcount==2 && ycount==3){zval=data; ztot=1;}
	if(xtot==1 && ytot==1 && xcount==3 && ycount==2){zval=data; ztot=1;} 
	break;}
case 8:{
	if(xtot==1 && ytot==1 && xcount==3 && ycount==3){zval=data; ztot=1;} 
	break;}
case 9:{ 
  pos[xval][yval]=zval;
  lines++;
break;}}
ccount++;
}}}

Is there a way to solve my problem?
Thanks in advance.

unsigned char pos[180][180]; //180x180 x-y grid

Which Arduino are you using that has room for that?

That array takes 32400 bytes.
This is more than is available on any arduino.

The array acts like a buffer , i found that 180x180 is the maximum value accepted by the compiler and my Uno but since then i modified the code to take input and store it in a 50x50 array, move the steppers and take another input again (5 times since i need 250x250 grid). The stepper problem remains. I'm' not sure but something in the draw function blocks the entire library from initialising.

You did not answer the question about which Arduino you have. A 328-based Arduino has 2K of SRAM. A 50 by 50 array is still 2500 bytes. Last time I checked, 2500 was greater than 2000.

....value accepted by the compiler and my Uno...

I know the technical limitations of my Arduino Uno R3(and i'm already trying to implement all the values using PROGMEM in flash memory) but even if i remove all other functions, the accelstepper library is still blocked. My problem is not that the RunToNewPosition() function is blocked in loops(because the documentation warns about this) but all moving functions that can be used in it's place such as move(), moveTo(), run(), runSpeed().... that's the only problem that i have. I have the latest version (1.15).

I know the technical limitations of my Arduino Uno R3(and i'm already trying to implement all the values using PROGMEM in flash memory)

I'm not convinced that you do. Moving an array that you need to write to to PROGMEM is not possible. PROGMEM is read only.

Creating an array that is larger than the Arduino can handle will cause all kinds of memory access issues, including complete failure to run.

I must've misread progmem's documentation but if it's read-only i'll just use it with a predetermined set of values (as much as i can fit in flash) for moving the steppers, after all, it's just for a school project.
Thanks for clearing a few things up XD, maybe in the future i'll continue this project and perhaps expand it to store values in an SD card, but for now i think it's enough for my project.

I am not sure why you need this array at all, can you explain in words what you think it is doing for you.

The array, regardless of it's 2d size acts like a buffer for the values i send from the pc through serial to the arduino so that instead of moving the steppers with each coordinate received from pc i store a few coordinates and then issue commands to the steppers

You do not need a square 2D array for that, just an array two elements wide and as many deep as you want to store the numbers.