Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:34 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Kustom Version of Picomite VGA Basic

Author Message
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 02:16pm 09 Apr 2022
Copy link to clipboard 
Print this post

I've been up all night playing with MMBasic on the Pico and trying to sort out my Picomite VGA Build, and while I do no not mean to Arrogant or rude, The Court said I am Special and Incompetent, so as such I need to compile my own Kustom Version of MMBasic, where the Syntax error is Replaced with the ID10T Error! There should be only 2 Error codes, the ID10T and the PEBKAC errors (the problem exists between keyboard and chair) I just got my first Kernal Picnic Error ( problem in chair, not in computer)
LOL LOL
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:27pm 09 Apr 2022
Copy link to clipboard 
Print this post

Are you sure you haven't been up all night drinking ?

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 10:41pm 09 Apr 2022
Copy link to clipboard 
Print this post

  thwill said  Are you sure you haven't been up all night drinking ?

Best wishes,

Tom


   
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 12:09am 10 Apr 2022
Copy link to clipboard 
Print this post

  Quote   Are you sure you haven't been up all night drinking ?

Best wishes,

Tom/QUOTE]
no I've was up all night working on a New Picomite VGA 1.3 & trying to learn MMBasic
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:55pm 10 Apr 2022
Copy link to clipboard 
Print this post

No offence, your initial post was more than usually eccentric even for TBS.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 03:58pm 10 Apr 2022
Copy link to clipboard 
Print this post

  thwill said  No offence, your initial post was more than usually eccentric even for TBS.

Best wishes,

Tom


No Offense taken Buddy, I'm a TEXAN you can't offend or embarrass us, I was / am Frustrated trying to figure out how to control a stepper motor from a Picomite, using a stepstick stepper driver, with a button, I know I can it can be done, but I just got to Read/learn more. I am having the best time playing with MMBasic and building Picomite stuff:) it's all like being in Jr. High again playing with 8bit computers and  HeathKits. it's Kicked MY OCD in to Overdrive

Great Respect

Rickard
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 04:51am 11 Apr 2022
Copy link to clipboard 
Print this post

If you can post the datasheets for the stepper and the driver, I am sure someone can help you get it working.

Plenty of people have had stepper motors running off MMBASIC in the past, including me, so it most certainly is possible, but we'd need the datasheets to help you further at this point.

One thing I remember from when I was playing with stepper motors, is that you need to make allowances for ramping up and ramping down the spindle-speed if you are using the stepper motor as a rotational motor and not just native little steps.

I found that if you don't ramp-up and ramp-down, the motor will either stall on its way to full speed or on its way down to stopped.

You might not be wanting to do that kind of thing though, but I mention it, cos it caught me out at the time!  
Smoke makes things work. When the smoke gets out, it stops!
 
DaveJacko
Regular Member

Joined: 25/07/2019
Location: United Kingdom
Posts: 83
Posted: 09:52pm 12 Apr 2022
Copy link to clipboard 
Print this post

Ramping a stepper.. not yet done it with a micromite..

(really needs C or Assembler or some really clever Backshedder)

however, with light loads and limited speeds, you can start at full speed.
Have a look at my attempt on youtube:   https://youtu.be/Buybf25-wbg
Runs 2 axes simultaneously, fastest axis limit is 1000 steps per second.
(might be poss to improve on this - use pulse output wire link to interrupt input?)
The code is concise will post if you like.
Steppers and Stepsticks are good fun..
regs, Dave
Try swapping 2 and 3 over
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 12:09am 13 Apr 2022
Copy link to clipboard 
Print this post

  DaveJacko said  Ramping a stepper.. not yet done it with a micromite..

(really needs C or Assembler or some really clever Backshedder)

however, with light loads and limited speeds, you can start at full speed.
Have a look at my attempt on youtube:   https://youtu.be/Buybf25-wbg
Runs 2 axes simultaneously, fastest axis limit is 1000 steps per second.
(might be poss to improve on this - use pulse output wire link to interrupt input?)
The code is concise will post if you like.
Steppers and Stepsticks are good fun..
regs, Dave


Yeah Dave any info you can post would be most helpful I don't care about ramping up I'm meow doing stuff like moving XY Tables , Rotary tables, spin indexers on my Sureline lathe-mill setup. the real goal is bit of kit that I can plug 2 or 3 steppers in to and have a button for each direction that moves the stepper a predetermine # of steps and a home button that resets the stepper the Big Reason I'm so Head strong on the Stepstick is they are cheep, I have like 50 of them, and if I can get a stepstick working then it's an easy change over to the big drivers like the ones on my Bridgeport Just Step and Direction.
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 12:09am 13 Apr 2022
Copy link to clipboard 
Print this post

Duplicate post
Edited 2022-04-13 10:11 by Rickard5
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5089
Posted: 05:31am 13 Apr 2022
Copy link to clipboard 
Print this post

You van controle a steppen motor from basic. a multi axis simultaneous control may require to use the picomite PIO sequencer.
PicomiteVGA PETSCII ROBOTS
 
DaveJacko
Regular Member

Joined: 25/07/2019
Location: United Kingdom
Posts: 83
Posted: 09:08pm 13 Apr 2022
Copy link to clipboard 
Print this post

Wow! the PicoMite PIO has amazing potential !

Here is my code for the project shown on the earlier youtube link.
An XY plotter using string, 2 stepsticks and steppers, also a model RC servo.
https://youtu.be/Buybf25-wbg
I think it's not bad, but I did write it!




' Hello world in G-Code

' gantry plotter DPJ 2020


init
Pin(enabpin)=0
ls=9333 'steps=350mm
xnow=ls/2 'on the centre
ynow=ls/2 '27=1mm
l1now=ls*0.707 '1/sqr(2)
l2now=ls*0.707 '=250mm

mainlp:

t$=Inkey$
If t$="" Then GoTo mainlp
If t$=" " Then Pin(enabpin)=1:PWM 2,stop: End
If t$="u" Then penup
If t$="d" Then pendn
If t$="p" Then plotdata

a$=a$+t$
If Len(a$)>3 Then a$=Right$(a$,3)

If a$=lc$ Then moveby -266,0
If a$=rc$ Then moveby 266,0
If a$=uc$ Then moveby 0,-266
If a$=dc$ Then moveby 0,266

GoTo mainlp

Sub MoveTo(mtx,mty) '======  MoveTo
moveby mtx-xnow,mty-ynow
End Sub


Sub MoveBy(mbx,mby)  ' ======  Move By

' calc turns from mbx,y

l1now=Sqr(xnow*xnow+ynow*ynow) 'maybe +residual l1now
l2now=Sqr((ls-xnow)*(ls-xnow)+ynow*ynow)
xtarg=xnow+mbx
ytarg=ynow+mby
l1targ=Sqr(xtarg*xtarg+ytarg*ytarg)
l2targ=Sqr((ls-xtarg)*(ls-xtarg)+ytarg*ytarg)
l1mov=l1targ-l1now
l2mov=l2targ-l2now

xnow=xtarg
ynow=ytarg

' now turn motors by l1mov,l2mov

'directions..
If l1mov>0 Then Pin(dirxpin)=0 Else Pin(dirxpin)=1
If l2mov>0 Then Pin(dirypin)=1 Else Pin(dirypin)=0

'major axis is..
If Abs(l1mov)>=Abs(l2mov) Then 'l1 is major
l1i=Sgn(l1mov)
l2i=l2mov/Abs(l1mov)
ni=Abs(l1mov) 'num of incs
Else 'l2 is major axis
l2i=Sgn(l2mov)
l1i=l1mov/Abs(l2mov)
ni=Abs(l2mov)
EndIf


l1acc=0:l2acc=0

For i=1 To ni ' do move
l1acc=l1acc+l1i
l2acc=l2acc+l2i

If l1acc>=1 Then l1acc=l1acc-1:Pin(stpxpin)=1
If l1acc<=-1 Then l1acc=l1acc+1:Pin(stpxpin)=1
If l2acc>=1 Then l2acc=l2acc-1:Pin(stpypin)=1
If l2acc<=-1 Then l2acc=l2acc+1:Pin(stpypin)=1

wait1
Pin(stpxpin)=0
Pin(stpypin)=0

Next i

End Sub


Sub PlotData ' ====== plot G-Code Data

Restore
xb=xnow:yb=ynow

gcloop:

Read t$

If Left$(t$,3)="G00" Then penup
If Left$(t$,3)="G01" Then pendn
If t$="M02" Then GoTo exgc

xcp=Instr(1,t$,"X")
ycp=Instr(1,t$,"Y")
'can also find F's and Z's

lcp=Len(t$)
If xcp<>0 Then
nx=Val(Mid$(t$,xcp+1,ycp-1))
ny=Val(Mid$(t$,ycp+1,lcp-ycp))
moveto xb+nx*30,yb-ny*30
EndIf

GoTo gcloop

exgc:

End Sub


Sub init '---- init

stpxpin=2
stpypin=3
stpzpin=4
dirxpin=5
dirypin=6
dirzpin=7
enabpin=9
stoppin=15
'servopin=26 pwm

SetPin 2,dout
SetPin 3,dout
SetPin 4,dout
SetPin 5,dout
SetPin 6,dout
SetPin 7,dout
Pin(9)=1 'enable off
SetPin 9,dout
SetPin 15,din,pullup 'int?

e$=Chr$(27) 'escape
uc$=e$+"[A" 'cursor keys
dc$=e$+"[B"
rc$=e$+"[C"
lc$=e$+"[D"

SetTick 1,int1ms  'timer

Pause 100

End Sub

Sub penup
PWM 2,50,7
Pause 100
End Sub

Sub pendn
PWM 2,50,10
Pause 100
End Sub

Sub int1ms   ' --timer subs
iflag=1
End Sub

Sub wait1
w1lp:
If Not iflag Then GoTo w1lp
iflag=0
End Sub


'Hello World'
'in G-Code rendered with Stickfont
'converted with G-Code to Data prog.txt
'- a simple program producing data statements for MMbas

' DPJ sept2020

Data "G00Z0.0"
Data "X1.9048Y10.0"
Data "G01Z0.0F0.0"
Data "X1.9048Y0.0"
Data "G00Z0.0"
Data "X8.5714Y10.0"
Data "G01Z0.0F0.0"
Data "X8.5714Y0.0"
Data "G00Z0.0"
Data "X1.9048Y5.2381"
Data "G01Z0.0F0.0"
Data "X8.5714Y5.2381"
Data "G00Z0.0"
Data "X12.1764Y3.8095"
Data "G01Z0.0F0.0"
Data "X17.8907Y3.8095"
Data "X17.8907Y4.7619"
Data "X17.4145Y5.7143"
Data "X16.9383Y6.1905"
Data "X15.9859Y6.6667"
Data "X14.5573Y6.6667"
Data "X13.6049Y6.1905"
Data "X12.6526Y5.2381"
Data "X12.1764Y3.8095"
Data "X12.1764Y2.8571"
Data "X12.6526Y1.4286"
Data "X13.6049Y0.4762"
Data "X14.5573Y0.0"
Data "X15.9859Y0.0"
Data "X16.9383Y0.4762"
Data "X17.8907Y1.4286"
Data "G00Z0.0"
Data "X21.4462Y10.0"
Data "G01Z0.0F0.0"
Data "X21.4462Y0.0"
Data "G00Z0.0"
Data "X25.3545Y10.0"
Data "G01Z0.0F0.0"
Data "X25.3545Y0.0"
Data "G00Z0.0"
Data "X31.1675Y6.6667"
Data "G01Z0.0F0.0"
Data "X30.2152Y6.1905"
Data "X29.2628Y5.2381"
Data "X28.7866Y3.8095"
Data "X28.7866Y2.8571"
Data "X29.2628Y1.4286"
Data "X30.2152Y0.4762"
Data "X31.1675Y0.0"
Data "X32.5961Y0.0"
Data "X33.5485Y0.4762"
Data "X34.5009Y1.4286"
Data "X34.9771Y2.8571"
Data "X34.9771Y3.8095"
Data "X34.5009Y5.2381"
Data "X33.5485Y6.1905"
Data "X32.5961Y6.6667"
Data "X31.1675Y6.6667"
Data "G00Z0.0"
Data "X43.9436Y10.0"
Data "G01Z0.0F0.0"
Data "X46.3245Y0.0"
Data "X48.7055Y10.0"
Data "X51.0864Y0.0"
Data "X53.4674Y10.0"
Data "G00Z0.0"
Data "X58.5256Y6.6667"
Data "G01Z0.0F0.0"
Data "X57.5732Y6.1905"
Data "X56.6208Y5.2381"
Data "X56.1446Y3.8095"
Data "X56.1446Y2.8571"
Data "X56.6208Y1.4286"
Data "X57.5732Y0.4762"
Data "X58.5256Y0.0"
Data "X59.9541Y0.0"
Data "X60.9065Y0.4762"
Data "X61.8589Y1.4286"
Data "X62.3351Y2.8571"
Data "X62.3351Y3.8095"
Data "X61.8589Y5.2381"
Data "X60.9065Y6.1905"
Data "X59.9541Y6.6667"
Data "X58.5256Y6.6667"
Data "G00Z0.0"
Data "X65.903Y6.6667"
Data "G01Z0.0F0.0"
Data "X65.903Y0.0"
Data "G00Z0.0"
Data "X65.903Y3.8095"
Data "G01Z0.0F0.0"
Data "X66.3792Y5.2381"
Data "X67.3316Y6.1905"
Data "X68.284Y6.6667"
Data "X69.7125Y6.6667"
Data "G00Z0.0"
Data "X72.254Y10.0"
Data "G01Z0.0F0.0"
Data "X72.254Y0.0"
Data "G00Z0.0"
Data "X81.4004Y10.0"
Data "G01Z0.0F0.0"
Data "X81.4004Y0.0"
Data "G00Z0.0"
Data "X81.4004Y5.2381"
Data "G01Z0.0F0.0"
Data "X80.448Y6.1905"
Data "X79.4956Y6.6667"
Data "X78.067Y6.6667"
Data "X77.1146Y6.1905"
Data "X76.1623Y5.2381"
Data "X75.6861Y3.8095"
Data "X75.6861Y2.8571"
Data "X76.1623Y1.4286"
Data "X77.1146Y0.4762"
Data "X78.067Y0.0"
Data "X79.4956Y0.0"
Data "X80.448Y0.4762"
Data "X81.4004Y1.4286"
Data "G00Z0.0"

Data "M02"   'end of prog


Try swapping 2 and 3 over
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025