From 9304f92664aecd14e9eaa618e9e51eaefe532c46 Mon Sep 17 00:00:00 2001 From: eddyem Date: Wed, 28 Mar 2018 09:46:41 +0300 Subject: [PATCH] remove setting console to noecho input --- MMPP_control/main.c | 2 - STM32/steppers/rme.html | 298 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 STM32/steppers/rme.html diff --git a/MMPP_control/main.c b/MMPP_control/main.c index 4e54b15..47d5b62 100644 --- a/MMPP_control/main.c +++ b/MMPP_control/main.c @@ -29,7 +29,6 @@ static glob_pars *G; void signals(int signo){ - restore_console(); restore_tty(); exit(signo); } @@ -121,7 +120,6 @@ int main(int argc, char **argv){ setbuf(stdout, NULL); initial_setup(); G = parse_args(argc, argv); - setup_con(); // no echo tty_init(G->comdev); handshake(); // test connection & get all positions if(G->showtemp){ diff --git a/STM32/steppers/rme.html b/STM32/steppers/rme.html new file mode 100644 index 0000000..21e9901 --- /dev/null +++ b/STM32/steppers/rme.html @@ -0,0 +1,298 @@ +

Management of two stepper motors

+ +

Based on STM32F030F4P6

+ +

Pinout

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pin Type Role
PA0 AIN Steppers current
PA1 AIN Input voltage 12V
PA2 AIN EndSwitch1 of motor0
PA3 AIN EndSwitch0 of motor0
PA4 PUPD Tim14Ch1 - motor0 steps
PA5 PUPD Motor1 enable
PA6 PUPD Tim3Ch1 - motor1 steps
PA7 PUPD Motor1 direction
PA9 OD USART1 Tx
PA10 FIN USART1 Rx
PA13 FINPU EndSwitch0 of motor1
PA14 FINPU EndSwitch1 of motor1
PB1 PUPD Turn off current sensor
PF0 PUPD Motor0 enable
PF1 PUPD Motor0 direction
+ + +

Protocol

+ +

Any command have format “# CMD”, where # is device ID (the_conf.devID) or “-1” if there’s +only one device at the bus. After it can be any number of spaces and command symbols. +If the command recognized and it’s right, ALL OK would be returnded. If the command is bad, answer +BADCMD. Error in command sintax: ERR. If the answer would take more than one line it would +be ends by DATAEND.

+ +

First symbol of commands

+ + + + +

All wrong commands will return BADCMD, commands with bad format or wrong number return ERR. +Commands with lot of output ends with DATAEND. Some commands (like flash write) will return +just ALL OK if succeed.

+ +

Getters

+ +

Getters returning more than one field ends with DATAEND meaning that’s all data.

+ + + + +

Motors' manipulation

+ +

Next char should be ‘0’ or ‘1’ — motor’s number. If wrong, Num>1 answer would be returned. +There’s only two commands in this section:

+ + + + +

Setters

+ +

Change of any setter takes place in MCU RAM immediately. To store them permanently run +write flash command.

+ + + + +

Motor speed setters

+ +

To set motor speed to N steps per second, give command C or S with argument equal to +3000/N. E.g. to set current speed for DevID=0, motor0 to 50 steps per second give command 0SC050.

+ +

Denominator and numerator setters

+ +

Have naxt letter similar to ADC getter (D - Vdd, I - motors' I, or M - motors' U). +The value of numerator shouldn’t be very large as uint32_t used in multiplications.

+ +

Device ID setter

+ +

After this command device will immediately change it’s ID, if you “lost” device after this +procedure you should reboot it or (if there’s only one device on the bus) call it by “universal ID” +(-1).

+ +

USART speed setter

+ +

The USART speed will be changed after next reset (e.g. by MCU software reboot command), so it +don’t work without storing in the flash. Check it twice before writing as wrong numbers can make device +lost until next re-flashing.