Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : MMBasic V6.03.00 release candidates

   Page 26 of 26    
Posted: 11:30am
18 Jun 2026
Copy link to clipboard
matherp
Guru

I can probably re-institute it, easier than changing the manual, but I can't see any utility * then return vs F2

vegipete: please test the version posted above. Hopefully fixes the dropped steps
 
Posted: 11:33am
18 Jun 2026
Copy link to clipboard
Bleep
Guru


Hi Peter,
Yes that is now doing exactly what I hoped for, I've also given the reverse a cursory test and that also seems to be working as you describe, including the new parameter confirm. :-) Thanks very much for persevering, and the extra detail in the manual.
Regards Kevin.
 
Posted: 11:55am
18 Jun 2026
Copy link to clipboard
ville56
Guru

  matherp said  ... but I can't see any utility * then return vs F2


you are right... just saw the inconsistence.
 
Posted: 05:01pm
18 Jun 2026
Copy link to clipboard
mozzie
Guru

G'day Peter,
Some further testing with the firmware posted above for VegiPete has shown the following symptoms:

With:
Stepper axis y,gp4,gp5,,,600,4996,1000,5
Stepper axis a,gp8,gp9,,,300,9996,1000,5

G-Code? = g0 a100

X-POS  =   +0.0000
Y-POS  =   +0.0000
Z-POS  =   +0.0000
A-POS  =  +98.4600
Buffer =   32
3963.3297

G_Code? = g0 y100

X-POS  =   +0.0000
Y-POS  =  +99.6150
Z-POS  =   +0.0000
A-POS  =   +0.0000
Buffer =   32
8523.0898

In both cases the axis never reaches 100 and the program requires ctrl-c to exit.

It would appear the steps are lost when the output frequency is slightly below the 50khz stepper system frequency. Something is telling me that perhaps the maximum output frequency for an axis should be 50khz/2 to stop ?? heterodyning ?? when the frequencies are close.

This is repeatable with many combinations where (steps/mm * mm/min) / 60 is close to 50000. Different acceleration rates also change the outcome.

Program used for testing:
' prog to test stepper functions (simple)

Option default integer

On Error skip:Stepper close

Print Chr$(27)+"[2J"+Chr$(27)+"[H"; ' clear console

Timer=0
SetTick 200,Show_Pos
Stepper init 0.05,32,,1
Stepper axis x,gp1,gp2,gp3,,600,4996,1000,5
Stepper axis y,gp4,gp5,,,400,7498,1000,5
Stepper axis z,gp6,gp7,,,300,9996,1000,5
Stepper axis a,gp8,gp9,,,300,9996,1000,5
Stepper position home
Stepper run 0

Do
 Pause 1000
 Print @(0,84)"                               "
 Print @(0,84)"";
 Line Input "G_Code? = ",A$
 If a$="" Then Exit Do
 If UCASE$(LEFT$(A$,1))="G" Then Stepper gs A$ Else AXIS_CNG
 Timer = 0
 Do :Loop Until Peek(stepper active)=0 ' wait until motion complete
Loop

Pause 250 ' wait for final position update
Stepper close
End

Sub Show_Pos
 Print @(0,108)"X-POS  = " Str$(Peek(stepper x),-4,4)
 Print @(0,120)"Y-POS  = " Str$(Peek(stepper y),-4,4)
 Print @(0,132)"Z-POS  = " Str$(Peek(stepper z),-4,4)
 Print @(0,144)"A-POS  = " Str$(Peek(stepper a),-4,4)
 Print @(0,156)"Buffer = " Str$(Peek(stepper buffer),4)
 Print @(0,168)Timer
End Sub

Sub AXIS_CNG
 Print
 Input "Input axis, steps/mm, max mm/min, max accel",B$,s.mm,mm.m,m.ac
 Stepper tune B$,,s.mm,mm.m,m.ac
 Stepper position home
End Sub

The new STEPPER TUNE command is proving very useful already.
> option list
PicoMite MMBasic RP2350A V6.03.00RC21
OPTION SYSTEM SPI GP18,GP19,GP16
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 200000
OPTION LCDPANEL ST7796S, LANDSCAPE,GP14,GP13,GP12
OPTION TOUCH GP15,GP17
GUI CALIBRATE 0, 3982, 3931, -1273, -851
OPTION GUI CONTROLS 254
>

Also did a OPTION DISK SAVE and OPTION DISK LOAD and my GUI controls went from 128 to 254, both RC21

Regards, Lyle.
 
Posted: 05:47pm
18 Jun 2026
Copy link to clipboard
Frank N. Furter
Guru

Is this actually supposed to appear when an error message occurs while accessing a file via the File Manager?
Error: Invalid in a program (F2 line 10)

Shouldn't that be "F4"?

Are there no more automatic backups now? That's too bad. I know that Volhout complained that he only has limited space on his drive. Couldn't this feature be made optional?

Frank
 
Posted: 05:54pm
18 Jun 2026
Copy link to clipboard
vegipete
Guru


My tests of the above firmware are good. I'm seeing the correct number of step pulses for every value I've tried from A0.0625 (1 pulse) and up. If I request a move of A100, I actual get it, both in the number of pulses, and the reported A position afterwards. And it works fine even up to a 50kHz pulse rate. (An actual motor has other ideas, what with resonance and all, but that is a different story.) The rogue pulses at sub-system start-up also seem to be gone.

The pulse pattern looks like a brute force fix at the end of the pulse train, with a few pulses at 5ms intervals added to get the correct number.  ;-)
With an S-Curve accel profile, this is very noticeable. 44 of 'em in this capture. (Accel = 50000 in this example.)

 
Posted: 06:23pm
18 Jun 2026
Copy link to clipboard
JanVolk
Guru

Peter,

Test starting MP3 player from FM with various OPTION RESOLUTION and OPTION PLATFORM OLIMEX USB
OPTION RESOLUTION 640, 848, 1024, and 1280 play the entire MP3 file correctly.
OPTION RESOLUTION 800 Error: Not enough Heap memory
OPTION RESOLUTION 720 freezes after a certain time, and only a hard reset helps.
Very occasionally also with OPTION RESOLUTION 1024 and 1280, where the MP3 file (> 3 MB) is not played completely, after which only a hard reset helps.


> US USB Keyboard Connected on channel 1
> Mouse Type: Gaming 16-bit
 X/Y bits: 16/16
 Buttons: 5
 Report length: 10 bytes
 Has wheel: Yes (byte 5)
 Has pan: No
USB Mouse Connected on channel 2

> option list
PicoMiteHDMI MMBasic USB RP2350A Edition V6.03.00RC21
OPTION SERIAL CONSOLE COM1,GP0,GP1
OPTION SYSTEM I2C GP20,GP21
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION MOUSE SENSITIVITY     1.0000
OPTION KEYBOARD US
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION RESOLUTION 720x400 @ 283200KHz
OPTION DISPLAY 33, 90
OPTION HDMI PINS  1, 3, 7, 5
OPTION GUI CONTROLS 100
OPTION SDCARD GP22, GP6, GP7, GP4
OPTION AUDIO GP26,GP27', ON PWM CHANNEL 5
OPTION RTC AUTO ENABLE
OPTION MODBUFF ENABLE  192
OPTION F1 help
OPTION F5 list commands
OPTION F6 list functions
OPTION F7 list pins
OPTION F8 option list
OPTION F9 fm
OPTION PLATFORM OLIMEX USB
>

Error : Not enough Heap memory
> option list
PicoMiteHDMI MMBasic USB RP2350A Edition V6.03.00RC21
OPTION SERIAL CONSOLE COM1,GP0,GP1
OPTION SYSTEM I2C GP20,GP21
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION MOUSE SENSITIVITY     1.0000
OPTION KEYBOARD US
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION RESOLUTION 800x600 @ 360000KHz
OPTION DISPLAY 50, 100
OPTION HDMI PINS  1, 3, 7, 5
OPTION GUI CONTROLS 100
OPTION SDCARD GP22, GP6, GP7, GP4
OPTION AUDIO GP26,GP27', ON PWM CHANNEL 5
OPTION RTC AUTO ENABLE
OPTION MODBUFF ENABLE  192
OPTION F1 help
OPTION F5 list commands
OPTION F6 list functions
OPTION F7 list pins
OPTION F8 option list
OPTION F9 fm
OPTION PLATFORM OLIMEX USB


Jan.
 
Posted: 09:50pm
18 Jun 2026
Copy link to clipboard
matherp
Guru

  Quote  Also did a OPTION DISK SAVE and OPTION DISK LOAD and my GUI controls went from 128 to 254, both RC21
You cannot reliably do a load of options between versions. Any test before you OPTION RESET and load the options by hand are basically meaningless
  Quote  est starting MP3 player from FM with various OPTION RESOLUTION and OPTION PLATFORM OLIMEX USB
OPTION RESOLUTION 640, 848, 1024, and 1280 play the entire MP3 file correctly.
OPTION RESOLUTION 800 Error: Not enough Heap memory
OPTION RESOLUTION 720 freezes after a certain time, and only a hard reset helps.
Very occasionally also with OPTION RESOLUTION 1024 and 1280, where the MP3 file (> 3 MB) is not played completely, after which only a hard reset helps.

Mp3 playback is very memory/CPU intensive, if it doesn't work in a particular resolution than you can't use it
Edited 2026-06-19 07:51 by matherp
 
Posted: 11:51pm
18 Jun 2026
Copy link to clipboard
JanVolk
Guru

Peter,

Thanks for answering my previous question.

Another question regarding sound.
Why do standard .wav files play very loudly and .mod files very softly on an RP2040VGAUSB with I2S? (Tested with flappy.bas and blocks.bas)
Or does this need to be specifically controlled with PLAY Volume in the program? This is the same with a PWM output (RP2350HDMIUSB) and with an I2S output (RP2040VGAUSB).
Tested with PP2040VGAUSB (I2S module) and with RP2350HDMIUSB .mp3 with RP2350 also soft sound (PWM output Olimex HDMI USB).

Jan.
Edited 2026-06-19 09:57 by JanVolk
 
Posted: 07:29am
19 Jun 2026
Copy link to clipboard
mozzie
Guru

G'day Peter,
Found a new Pico2 so loaded RC21(2) onto it, same result, stepper system never reaches the value in the G-Code and peek(stepper active) is still 1, requires Ctrl-C to escape in this instance:

Stepper axis x,gp1,gp2,gp3,,600,4996,1000,5
G-Code? = g0 x100
X-POS  =  +99.6150

Stepper axis y,gp4,gp5,,,400,7498,1000,5
G-Code? = g0 y100
Y-POS  =  +99.1325

Stepper axis z,gp6,gp7,,,300,9996,1000,5
G-Code? = g0 z100
Z-POS  =  +98.4600

Whilst these rates are at the upper end of normal use they are quite reasonable, consider a machine I did some work on:
200 step motor @ 4 microsteps geared 8.3333333:1(100/12) = 6666.6667 steps / rev
12mm winch drive with 1.5mm wire rope = 40mm / turn (measured)
6666.6667 step / rev @ 40mm / rev = 166.6667 steps / mm = 0.006mm / step
Rapid feedrate of 18000mm / min = 300mm / sec (1.1km/h)

Stepper axis x,gp1,gp2,gp3,,166,18000,1000,5
G-Code? = g0 x100
X-POS  =  +95.0783
(Ctrl-C)
G-Code? = g1 x100 f18000
X-POS  =  +95.0783

That is theoretical, whether the motor / drive could achieve that frequency is another matter, however some of these modern drivers are light years ahead of 20 years ago.
Testing has shown this goes as far back as V6.02.01
Test program same as previous post.

What I would like to suggest is to limit the per axis (STEPS / MM * MAX FEEDRATE) to (25000 * 60), this is 50khz/2 and has been rock solid in all the testing so far.

> option list
PicoMite MMBasic RP2350A V6.03.00RC21
OPTION FLASH SIZE 4194304
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 200000
>


Regards, Lyle.
 
Posted: 09:39am
19 Jun 2026
Copy link to clipboard
matherp
Guru

mozzie and vegipete: please try attached. Definitely gets to 100 on all mozzie's examples and should remove most if not all of the tail guard pulses that vegipete was seeing

PicoMite.zip
Edited 2026-06-19 19:43 by matherp
 
Posted: 10:36am
19 Jun 2026
Copy link to clipboard
dddns
Guru

Hello,

I would like to transfer a file from one Pico to another over serial with X/Ymodem on a previously via Setpin defined Com port. Could it be possible to use X/Ymodem on an individual Com port?
 
Posted: 11:58am
19 Jun 2026
Copy link to clipboard
PhenixRising
Guru

FWIW:

S-Curve in BASIC

dim as integer res,samptime, time_to_accel_ms,intspeed,tog
dim as float f,ramp_segments,frac

time_to_accel_ms = 500

ramp_segments = 1/time_to_accel_ms

sync 1,M
tog=1
do
 inc samptime,1
 sync 'wait for next ms
 frac = samptime*ramp_segments

 f=(3-2*frac)*frac^2

 intspeed = f * 2000
 
 if tog then print samptime, intspeed
 tog=not tog
 

loop until samptime=time_to_accel_ms

end



 
Posted: 01:09pm
19 Jun 2026
Copy link to clipboard
mozzie
Guru

G'day,
Peter, testing so far looking good, always hitting target value and pulses counted with CIN tally with axis movement   Will test on machine when next out in shed.

Phenix, neat solution    tried implementing something similar on a 8 bit PIC micro in assembler years ago and gave up in the end. Peter has implemented S-Curve in the Stepper system, something I need to try out.

Regards, Lyle.
 
Posted: 02:00pm
19 Jun 2026
Copy link to clipboard
PhenixRising
Guru

  mozzie said  G'day,
Peter, testing so far looking good, always hitting target value and pulses counted with CIN tally with axis movement   Will test on machine when next out in shed.

Phenix, neat solution    tried implementing something similar on a 8 bit PIC micro in assembler years ago and gave up in the end. Peter has implemented S-Curve in the Stepper system, something I need to try out.

Regards, Lyle.


Yeah, bit concerned that the profiling sounds like it doesn't hit target. Shouldn't need to bang out extra pulses.
 
Posted: 05:13pm
19 Jun 2026
Copy link to clipboard
vegipete
Guru


For my configuration, I'm getting the correct number of pulses and complete moves. Trapezoidal moves look about the same as before - they look fine. SCurve moves are better but they show an asymmetry, as the stitched image below shows. The lower section is mirrored and aligned to show the difference. Still some number of trailing guard pulses, but many fewer than before.

Please don't reduce the max step rate unnecessarily - the fastest possible the better. Conventional mechanical systems may not handle it, but stranger use cases might benefit. (Ultrasonic piezo positioner, for example.)

 
Posted: 05:52pm
19 Jun 2026
Copy link to clipboard
PhenixRising
Guru

  vegipete said  
Please don't reduce the max step rate unnecessarily - the fastest possible the better. Conventional mechanical systems may not handle it, but stranger use cases might benefit. (Ultrasonic piezo positioner, for example.)


Agreed. Annex32 RDS is 200KHz and others exceed 500KHz. It's not always about a stepper motor. Modern servo amplifiers take pulse & direction as a position command.
 
Posted: 07:02pm
19 Jun 2026
Copy link to clipboard
twofingers
Guru


PicoMiteHDMI MMBasic USB RP2350A Edition V6.03.00RC12

Hi Peter,
I don't know if this is a bug, but in my view, it is at least strange or unexpected:
Print @(0,39*12)"test";:Input test
Print @(0,20*12)"test";test
Print @(0,38*12)"test";:Input test
Print @(0,20*12)"test";test
End


An INPUT command on the bottom line of the screen shifts the entire screen content up by one line. It appears that when entering data for the INPUT command, an extra line feed (Chr$(10) or \n) is generated after the input is finalized.

I am well aware that the INPUT command is very rarely used in the bottom line.

Regards
Michael
Edited 2026-06-20 07:18 by twofingers
 
Posted: 05:59am
20 Jun 2026
Copy link to clipboard
toml_12953
Guru

Is there a simple way to specify which serial port to use for the console on the fly? Sort of like this if it were possible:

OPTION CONSOLE SERIAL1
    or
OPTION CONSOLE SERIAL2


I know this syntax isn't supported but I'm looking for an easy way to do this.
Edited 2026-06-20 15:59 by toml_12953
 
Posted: 06:46am
20 Jun 2026
Copy link to clipboard
Mixtel90
Guru


Not that I know of, and the reason is probably historical!

Access via the console is like using the root account in Linux. Everything is open, your program can be broken into and you need physical access to do it. It's a security issue. You don't give the program user access to the console under normal circumstances. That was the original view anyway.

Setting up the console port is permanent as you don't want it to get changed to something else and lose programmer's access to the machine because a user program has crashed.
 
   Page 26 of 26    


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

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